本文整理匯總了PHP中rename_folder函數的典型用法代碼示例。如果您正苦於以下問題:PHP rename_folder函數的具體用法?PHP rename_folder怎麽用?PHP rename_folder使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了rename_folder函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: salvesta_objekt
function salvesta_objekt()
{
global $site;
global $objekt;
global $class_path;
if ($objekt->objekt_id) {
if ($objekt->on_sisu_olemas) {
# -------------------------------
# Objekti uuendamine andmebaasis
# -------------------------------
rename_folder($site->fdat['pealkiri'], $objekt->objekt_id);
} else {
# -------------------------------
# Objekti loomine andmebaasis
# -------------------------------
}
}
}
示例2: array
<!--ul class="thumbnails ff-items"-->
<ul class="grid cs-style-2 <?php
echo "list-view" . $view;
?>
" id="main-item-container">
<?php
$jplayer_ext = array("mp4", "flv", "webmv", "webma", "webm", "m4a", "m4v", "ogv", "oga", "mp3", "midi", "mid", "ogg", "wav");
foreach ($files as $file_array) {
$file = $file_array['file'];
if ($file == '.' || isset($file_array['extension']) && $file_array['extension'] != lang_Type_dir || $file == '..' && $subdir == '' || in_array($file, $hidden_folders) || $filter != '' && $file != ".." && strpos($file, $filter) === false) {
continue;
}
$new_name = fix_filename($file, $transliteration);
if ($file != '..' && $file != $new_name) {
//rename
rename_folder($current_path . $subdir . $new_name, $new_name, $transliteration);
$file = $new_name;
}
//add in thumbs folder if not exist
if (!file_exists($thumbs_path . $subdir . $file)) {
create_folder(false, $thumbs_path . $subdir . $file);
}
$class_ext = 3;
if ($file == '..' && trim($subdir) != '') {
$src = explode("/", $subdir);
unset($src[count($src) - 2]);
$src = implode("/", $src);
if ($src == '') {
$src = "/";
}
} elseif ($file != '..') {
示例3: fix_filename
if ($rename_folders) {
$name = fix_filename($name, $transliteration, $convert_spaces, $replace_with);
$name = str_replace('.', '', $name);
if (!empty($name)) {
if (!rename_folder($path, $name, $transliteration, $convert_spaces)) {
response(trans('Rename_existing_folder'), 403)->send();
exit;
}
rename_folder($path_thumb, $name, $transliteration, $convert_spaces);
if ($fixed_image_creation) {
foreach ($fixed_path_from_filemanager as $k => $paths) {
if ($paths != "" && $paths[strlen($paths) - 1] != "/") {
$paths .= "/";
}
$base_dir = $paths . substr_replace($path, '', 0, strlen($current_path));
rename_folder($base_dir, $name, $transliteration, $convert_spaces);
}
}
} else {
response(trans('Empty_name'), 400)->send();
exit;
}
}
break;
case 'create_file':
if ($create_text_files === FALSE) {
response(sprintf(trans('File_Open_Edit_Not_Allowed'), strtolower(trans('Edit'))), 403)->send();
exit;
}
if (!isset($editable_text_file_exts) || !is_array($editable_text_file_exts)) {
$editable_text_file_exts = array();
示例4: fix_filename
case 'rename_folder':
if ($rename_folders) {
$name = fix_filename($name, $transliteration);
$name = str_replace('.', '', $name);
if (!empty($name)) {
if (!rename_folder($path, $name, $transliteration)) {
die(lang_Rename_existing_folder);
}
rename_folder($path_thumb, $name, $transliteration);
if ($fixed_image_creation) {
foreach ($fixed_path_from_filemanager as $k => $paths) {
if ($paths != "" && $paths[strlen($paths) - 1] != "/") {
$paths .= "/";
}
$base_dir = $paths . substr_replace($path, '', 0, strlen($current_path));
rename_folder($base_dir, $name, $transliteration);
}
}
} else {
die(lang_Empty_name);
}
}
break;
case 'rename_file':
if ($rename_files) {
$name = fix_filename($name, $transliteration);
if (!empty($name)) {
if (!rename_file($path, $name, $transliteration)) {
die(lang_Rename_existing_file);
}
rename_file($path_thumb, $name, $transliteration);
示例5: fix_filename
case 'rename_folder':
if ($rename_folders) {
$name = fix_filename($name);
$name = str_replace('.', '', $name);
if (!empty($name)) {
if (!rename_folder($path, $name)) {
die(lang_Rename_existing_folder);
}
rename_folder($path_thumb, $name);
if ($fixed_image_creation) {
foreach ($fixed_path_from_filemanager as $k => $paths) {
if ($paths != "" && $paths[strlen($paths) - 1] != "/") {
$paths .= "/";
}
$base_dir = $paths . substr_replace($path, '', 0, strlen($current_path));
rename_folder($base_dir, $name);
}
}
} else {
die(lang_Empty_name);
}
}
break;
case 'rename_file':
if ($rename_files) {
$name = fix_filename($name);
if (!empty($name)) {
if (!rename_file($path, $name)) {
die(lang_Rename_existing_file);
}
rename_file($path_thumb, $name);
示例6: array
} else {
$response = array('error' => 1, 'error_message' => $delete_message);
}
echo $json_encoder->encode($response);
exit;
}
// edit folder
if ($site->user->user_id && $site->fdat['op'] == 'edit_folder' && (int) $site->fdat['folder_id'] && $site->fdat['name']) {
verify_form_token();
include_once $class_path . 'adminpage.inc.php';
include_once $class_path . 'custom.inc.php';
include_once $class_path . 'lgpl/Services_JSON.class.php';
$json_encoder = new Services_JSON();
$folder_id = (int) $site->fdat['folder_id'];
$name = safe_filename2($site->fdat['name']);
$rename_message = rename_folder($name, $folder_id);
if ($rename_message === true) {
$objekt = new Objekt(array('objekt_id' => $folder_id));
$folders = get_subfolders($objekt->parent_id);
// dont send the parent itself
reset($folders);
unset($folders[key($folders)]);
$response = array('error' => 0, 'folder_id' => $folder_id, 'folders' => $folders);
} else {
$response = array('error' => 1, 'error_message' => $rename_message);
}
echo $json_encoder->encode($response);
exit;
}
// get folder files
if ($site->user->user_id && $site->fdat['op'] == 'get_folder_files' && (int) $site->fdat['folder_id']) {
示例7: deleteDir
}
break;
case 'delete_folder':
deleteDir($path);
deleteDir($path_thumb);
break;
case 'create_folder':
create_folder(fix_path($path), fix_path($path_thumb));
break;
case 'rename_folder':
$name = fix_filename($name);
if (!empty($name)) {
if (!rename_folder($path, $name)) {
die(lang_Rename_existing_folder);
}
rename_folder($path_thumb, $name);
} else {
die(lang_Empty_name);
}
break;
case 'rename_file':
$name = fix_filename($name);
if (!empty($name)) {
if (!rename_file($path, $name)) {
die(lang_Rename_existing_file);
}
rename_file($path_thumb, $name);
} else {
die(lang_Empty_name);
}
break;
示例8: array_filter
rename(realpath(dirname(__FILE__)).'/'.$reverse_arr[$i],realpath(dirname(__FILE__)).'/'.$folder_name.'chap_temp'.$folder_no);
}
//3.Sau khi đổi tên trung gian thì gán lại tên mới
$temp_dirs = array_filter(glob($file_dir), 'is_dir');
for ($i=0; $i < count($temp_dirs) ; $i++) {
$str_name = $temp_dirs[$i];
$j = $i + 1;
//check: number of chapter
if($j < 100) {
if($j < 10) {
$folder_no = '00'.$j;
} else {
$folder_no = '0'.$j;
}
} else {
$folder_no = $j;
}
rename(realpath(dirname(__FILE__)).'/'.$temp_dirs[$i],realpath(dirname(__FILE__)).'/'.$folder_name.'chap_'.$folder_no);
}
}
}
rename_folder();
?>
<div class="container bs-docs-container">
<div class="bs-docs-header">
<h1>Đã tải về xong - kiểm tra folder dưới máy nhé ^^!</h1>
<a href='doi-ten.php'>Quay lại trang đổi tên folder</a>
</div>
</div>
示例9: array
<!--ul class="thumbnails ff-items"-->
<ul class="grid cs-style-2 <?php
echo "list-view" . $view;
?>
">
<?php
$jplayer_ext = array("mp4", "flv", "webmv", "webma", "webm", "m4a", "m4v", "ogv", "oga", "mp3", "midi", "mid", "ogg", "wav");
foreach ($files as $file_array) {
$file = $file_array['file'];
if ($file == '.' || isset($file_array['extension']) && $file_array['extension'] != lang_Type_dir || $file == '..' && $subdir == '' || in_array($file, $hidden_folders) || $filter != '' && $file != ".." && strpos($file, $filter) === false) {
continue;
}
$new_name = fix_filename($file);
if ($file != '..' && $file != $new_name) {
//rename
rename_folder($current_path . $subdir . $new_name, $new_name);
$file = $new_name;
}
//add in thumbs folder if not exist
if (!file_exists($thumbs_path . $subdir . $file)) {
create_folder(false, $thumbs_path . $subdir . $file);
}
$class_ext = 3;
if ($file == '..' && trim($subdir) != '') {
$src = explode("/", $subdir);
unset($src[count($src) - 2]);
$src = implode("/", $src);
if ($src == '') {
$src = "/";
}
} elseif ($file != '..') {
示例10: create_cloud
$key = $_GET['key'];
$name = $_GET['name'];
$type = $_GET['type'];
create_cloud($key, $name, $type);
} else {
if ($action == "rename_file") {
$key = $_GET['key'];
$name = $_GET['name'];
$id_file = $_GET['id_file'];
rename_file($key, $id_file, $name);
} else {
if ($action == "rename_folder") {
$key = $_GET['key'];
$name = $_GET['name'];
$id_folder = $_GET['id_folder'];
rename_folder($key, $id_folder, $name);
} else {
if ($action == "create_min_url") {
$url = $_GET['url'];
$type = $_GET['type'];
create_min_url($url, $type);
} else {
if ($action == "get_table") {
$key = $_GET['key'];
$id_cloud = $_GET['id_cloud'];
get_table($key, $id_cloud);
} else {
if ($action == "get_table_columns") {
$key = $_GET['key'];
$id_cloud = $_GET['id_cloud'];
$name_table = $_GET['name_table'];