本文整理汇总了PHP中Includes\Utils\FileManager::getCanonicalDir方法的典型用法代码示例。如果您正苦于以下问题:PHP FileManager::getCanonicalDir方法的具体用法?PHP FileManager::getCanonicalDir怎么用?PHP FileManager::getCanonicalDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Includes\Utils\FileManager
的用法示例。
在下文中一共展示了FileManager::getCanonicalDir方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unpack
/**
* Unpack PHAR archive
*
* @param string $file File path
* @param string $dir Dir to extract to
*
* @return string
*/
public static function unpack($file, $dir)
{
$dir = \Includes\Utils\FileManager::getCanonicalDir($dir) . pathinfo($file, PATHINFO_FILENAME);
try {
$phar = new \PharData($file);
$result = $phar->extractTo($dir, null, true);
} catch (\Exception $exception) {
$result = false;
\XLite\Upgrade\Logger::getInstance()->logError($exception->getMessage());
}
return array($dir, $result);
}
示例2: getUpgradeHelpersDir
/**
* Wrapper for the abstract method
*
* @param mixed $getFullPath Flag OPTIONAL
*
* @return string
*/
protected function getUpgradeHelpersDir($getFullPath = true)
{
$path = \Includes\Utils\FileManager::getCanonicalDir($this->getRepositoryPath());
if (!empty($path)) {
$dir = $this->getUpgradeHelperPath() . 'upgrade' . LC_DS;
}
return \Includes\Utils\FileManager::isDir($path . $dir) ? ($getFullPath ? $path : '') . $dir : null;
}
示例3: __construct
/**
* Constructor
*
* @param string $dir Directory to iterate over
* @param string $pattern Pattern to filter files
* @param int $mode Filtering mode OPTIONAL
*
* @return void
*/
public function __construct($dir, $pattern = null, $mode = \RecursiveIteratorIterator::LEAVES_ONLY)
{
$canonicalDir = \Includes\Utils\FileManager::getCanonicalDir($dir);
if (empty($canonicalDir)) {
\Includes\ErrorHandler::fireError('Path "' . $dir . '" is not exists or is not readable.');
}
$this->dir = $canonicalDir;
$this->pattern = $pattern;
$this->mode = $mode;
}