本文整理匯總了PHP中ConfService::getRootDir方法的典型用法代碼示例。如果您正苦於以下問題:PHP ConfService::getRootDir方法的具體用法?PHP ConfService::getRootDir怎麽用?PHP ConfService::getRootDir使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ConfService
的用法示例。
在下文中一共展示了ConfService::getRootDir方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: copyOrMoveFile
function copyOrMoveFile($destDir, $srcFile, &$error, &$success, $move = false)
{
$mess = ConfService::getMessages();
$destFile = ConfService::getRootDir() . $destDir . "/" . basename($srcFile);
$realSrcFile = ConfService::getRootDir() . "/{$srcFile}";
if (!file_exists($realSrcFile)) {
$error[] = $mess[100] . $srcFile;
return;
}
if ($realSrcFile == $destFile) {
$error[] = $mess[101];
return;
}
if (is_dir($realSrcFile)) {
$errors = array();
$succFiles = array();
$dirRes = FS_Storage::dircopy($realSrcFile, $destFile, $errors, $succFiles);
if (count($errors)) {
$error[] = $mess[114];
return;
}
} else {
$res = copy($realSrcFile, $destFile);
if ($res != 1) {
$error[] = $mess[114];
return;
}
}
if ($move) {
// Now delete original
FS_Storage::deldir($realSrcFile);
// both file and dir
$messagePart = $mess[74] . " {$destDir}";
if ($destDir == "/" . ConfService::getRecycleBinDir()) {
$messagePart = $mess[123] . " " . $mess[122];
}
if (isset($dirRes)) {
$success[] = $mess[117] . " " . basename($srcFile) . " " . $messagePart . " ({$dirRes} " . $mess[116] . ") ";
} else {
$success[] = $mess[34] . " " . basename($srcFile) . " " . $messagePart;
}
} else {
if (isset($dirRes)) {
$success[] = $mess[117] . " " . basename($srcFile) . " " . $mess[73] . " {$destDir} (" . $dirRes . " " . $mess[116] . ")";
} else {
$success[] = $mess[34] . " " . basename($srcFile) . " " . $mess[73] . " {$destDir}";
}
}
}