本文整理汇总了PHP中Symfony\Component\Finder\SplFileInfo::getPathInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP SplFileInfo::getPathInfo方法的具体用法?PHP SplFileInfo::getPathInfo怎么用?PHP SplFileInfo::getPathInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\Finder\SplFileInfo
的用法示例。
在下文中一共展示了SplFileInfo::getPathInfo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: detectSystem
/**
* 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);
}
示例2: extractRegisterInformation
/**
* @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;
}
示例3: getPathInfo
public function getPathInfo($class_name = null)
{
return $this->fileInfo->getPathInfo($class_name);
}