本文整理匯總了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));
}
}
}