/** * try to verify a search result and work around some well known false positives * * @param SplFileInfo $file file to examine * * @return bool|System */ public function detectSystem(SplFileInfo $file) { $fileName = $file->getFilename(); if ($fileName !== "LocalConfiguration.php" && $fileName !== 'localconf.php') { return false; } $path = new \SplFileInfo($file->getPathInfo()->getPath()); // Return result if working return new System($this->getName(), $path); }
/** * @param SplFileInfo $file * * @return array */ public function extractRegisterInformation(SplFileInfo $file) { $content = Yaml::parse($file->getContents()); $result = array('namespace' => $content['namespace'], 'source_dir' => rtrim($file->getPathInfo()->getRealPath(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . ltrim($content['source_dir'], DIRECTORY_SEPARATOR)); $name = array(); preg_match('#(?P<name>[a-z\\-]*)/?$#i', $file->getPath(), $name); $key = $name['name']; $this->moduleList[$key] = $result; return $result; }
public function getPathInfo($class_name = null) { return $this->fileInfo->getPathInfo($class_name); }