本文整理汇总了PHP中Includes\Utils\FileManager::move方法的典型用法代码示例。如果您正苦于以下问题:PHP FileManager::move方法的具体用法?PHP FileManager::move怎么用?PHP FileManager::move使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Includes\Utils\FileManager
的用法示例。
在下文中一共展示了FileManager::move方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preprocessImport
/**
* Preprocess import data.
* Check size limit of CSV files and divide them on several small parts.
* Returns true if file was divided
*
* @return boolean
*/
protected function preprocessImport()
{
$newFiles = array();
foreach ($this->getProcessors() as $processor) {
$files = $processor->getFiles(true);
foreach ($files as $file) {
$fileSize = $file->getSize();
if ($fileSize > static::MAX_FILE_SIZE) {
$newFiles[$file->getRealPath()] = $processor->divideCSVFile($file);
}
}
}
if ($newFiles) {
$dir = \Includes\Utils\FileManager::getRealPath(LC_DIR_VAR . $this->getOptions()->dir);
foreach ($newFiles as $srcFile => $dstFiles) {
if (\Includes\Utils\FileManager::deleteFile($srcFile)) {
foreach ($dstFiles as $fileData) {
$moveTo = $dir . LC_DS . basename($fileData['file']);
\Includes\Utils\FileManager::move($fileData['file'], $moveTo);
$this->options->deltaFiles[basename($moveTo)] = array('delta' => $fileData['delta'], 'file' => basename($srcFile));
}
}
}
}
return !empty($newFiles);
}
示例2: 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));
}
}
}