本文整理汇总了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;