本文整理汇总了PHP中Includes\Utils\FileManager::copy方法的典型用法代码示例。如果您正苦于以下问题:PHP FileManager::copy方法的具体用法?PHP FileManager::copy怎么用?PHP FileManager::copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Includes\Utils\FileManager
的用法示例。
在下文中一共展示了FileManager::copy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBrowscapClient
/**
* Get browscap client
*
* @return \phpbrowscap\Browscap
*/
protected function getBrowscapClient()
{
require_once LC_DIR_LIB . 'Browscap.php';
$cacheDir = LC_DIR_DATA . 'browscap';
if (!file_exists($cacheDir)) {
\Includes\Utils\FileManager::mkdirRecursive($cacheDir);
\Includes\Utils\FileManager::copy($this->getBrowsCapPath(), $cacheDir . LC_DS . 'browscap.ini');
}
return new \phpbrowscap\Browscap($cacheDir);
}
示例2: loadFromLocalFile
/**
* Load from local file
*
* @param string $path Absolute path
* @param string $basename File name OPTIONAL
*
* @return boolean
*/
public function loadFromLocalFile($path, $basename = null)
{
$result = true;
$basename = $basename ?: basename($path);
if (\Includes\Utils\FileManager::isExists($path)) {
foreach ($this->getAllowedFileSystemRoots() as $root) {
if (\Includes\Utils\FileManager::getRelativePath($path, $root)) {
$local = true;
break;
}
}
if (empty($local)) {
$newPath = \Includes\Utils\FileManager::getUniquePath($this->getStoreFileSystemRoot(), $basename);
if (\Includes\Utils\FileManager::copy($path, $newPath)) {
$path = $newPath;
$this->setStorageType(static::STORAGE_RELATIVE);
} else {
\XLite\Logger::getInstance()->log('\'' . $path . '\' file could not be copied to a new location \'' . $newPath . '\'.', LOG_ERR);
$result = false;
}
} else {
$this->setStorageType(static::STORAGE_ABSOLUTE);
}
} else {
$result = false;
}
if ($result && $basename) {
$this->setFileName($basename);
}
return $result && $this->savePath($path);
}
示例3: moveClassFile
/**
* Move/copy class file
*
* @param string $class New class name
*
* @return void
*/
protected function moveClassFile($class)
{
if (!$this->isRoot() && !$this->isRoot($class)) {
if ($this->getClass()) {
\Includes\Utils\FileManager::move($this->getFile(), $this->getFile($class));
} else {
\Includes\Utils\FileManager::copy($this->getFile($class, LC_DIR_CLASSES), $this->getFile($class));
}
}
}