本文整理汇总了PHP中ConfService::getRecycleBinDir方法的典型用法代码示例。如果您正苦于以下问题:PHP ConfService::getRecycleBinDir方法的具体用法?PHP ConfService::getRecycleBinDir怎么用?PHP ConfService::getRecycleBinDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfService
的用法示例。
在下文中一共展示了ConfService::getRecycleBinDir方法的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}";
}
}
}