本文整理匯總了PHP中rrename_after_cleaner函數的典型用法代碼示例。如果您正苦於以下問題:PHP rrename_after_cleaner函數的具體用法?PHP rrename_after_cleaner怎麽用?PHP rrename_after_cleaner使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了rrename_after_cleaner函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: rrename_after_cleaner
function rrename_after_cleaner($source)
{
$files = scandir($source);
foreach ($files as $file) {
if ($file != "." && $file != "..") {
if (is_dir($source . DIRECTORY_SEPARATOR . $file)) {
rrename_after_cleaner($source . DIRECTORY_SEPARATOR . $file);
} else {
unlink($source . DIRECTORY_SEPARATOR . $file);
}
}
}
return rmdir($source);
}
示例2: response
}
// check if server disables copy or rename
if (is_function_callable($action == 'copy' ? 'copy' : 'rename') === FALSE) {
response(sprintf(trans('Function_Disabled'), $action == 'copy' ? lcfirst(trans('Copy')) : lcfirst(trans('Cut'))), 403)->send();
exit;
}
if ($action == 'copy') {
rcopy($data['path'], $path);
rcopy($data['path_thumb'], $path_thumb);
} elseif ($action == 'cut') {
rrename($data['path'], $path);
rrename($data['path_thumb'], $path_thumb);
// cleanup
if (is_dir($data['path']) === TRUE) {
rrename_after_cleaner($data['path']);
rrename_after_cleaner($data['path_thumb']);
}
}
// cleanup
$_SESSION['RF']['clipboard']['path'] = NULL;
$_SESSION['RF']['clipboard_action'] = NULL;
break;
case 'chmod':
$mode = $_POST['new_mode'];
$rec_option = $_POST['is_recursive'];
$valid_options = array('none', 'files', 'folders', 'both');
$chmod_perm = is_dir($path) ? $chmod_dirs : $chmod_files;
// check perm
if ($chmod_perm === FALSE) {
response(sprintf(trans('File_Permission_Not_Allowed'), is_dir($path) ? lcfirst(trans('Folders')) : lcfirst(trans('Files'))), 403)->send();
exit;