本文整理汇总了PHP中eZPackage::filesDirectory方法的典型用法代码示例。如果您正苦于以下问题:PHP eZPackage::filesDirectory方法的具体用法?PHP eZPackage::filesDirectory怎么用?PHP eZPackage::filesDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZPackage
的用法示例。
在下文中一共展示了eZPackage::filesDirectory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: appendFile
function appendFile($file, $type, $role, $design, $filePath, $collection, $subDirectory = null, $md5 = null, $copyFile = false, $modified = null, $fileType = false, $roleValue = false, $variableName = false, $packagePath = false)
{
if (!$collection) {
$collection = 'default';
}
if ($subDirectory === null) {
$subDirectory = false;
if (preg_match('#^(.+)/([^/]+)$#', $file, $matches)) {
$subDirectory = $matches[1];
$file = $matches[2];
}
}
if ($packagePath) {
$subDirectory = $packagePath;
}
$fileItem = array('name' => $file, 'subdirectory' => $subDirectory, 'type' => $type, 'role' => $role, 'role-value' => $roleValue, 'variable-name' => $variableName, 'path' => $filePath, 'file-type' => $fileType, 'design' => $design);
if ($md5 === null) {
$md5 = $this->md5sum($filePath);
}
$fileItem['md5'] = $md5;
$this->Parameters['file-list'][$collection][] = $fileItem;
if ($copyFile) {
// copying file
$typeDir = $type;
if ($type == 'design') {
$typeDir .= '.' . $fileItem['design'];
}
if ($role) {
$typeDir .= '.' . $role;
if ($roleValue) {
$typeDir .= '-' . $roleValue;
}
}
$path = $this->path() . '/' . eZPackage::filesDirectory() . '/' . $collection . '/' . $typeDir;
if ($subDirectory) {
$path .= '/' . $subDirectory;
}
if (!file_exists($path)) {
eZDir::mkdir($path, false, true);
}
if (is_dir($fileItem['path'])) {
eZDir::copy($fileItem['path'], $path, $fileItem['name'] != false, true, false, eZDir::temporaryFileRegexp());
} else {
eZFileHandler::copy($fileItem['path'], $path . '/' . $fileItem['name']);
}
}
}