当前位置: 首页>>代码示例>>PHP>>正文


PHP rename_folder函数代码示例

本文整理汇总了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
            # -------------------------------
        }
    }
}
开发者ID:sauruscms,项目名称:Saurus-CMS-Community-Edition,代码行数:18,代码来源:edit_folder.php

示例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 != '..') {
开发者ID:PotsonHumer,项目名称:OGS_V2,代码行数:31,代码来源:dialog.php

示例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();
开发者ID:ilhammalik,项目名称:yii2-starter,代码行数:31,代码来源:execute.php

示例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);
开发者ID:mambax7,项目名称:xoopseditors,代码行数:31,代码来源:execute.php

示例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);
开发者ID:NaszvadiG,项目名称:ImageCMS,代码行数:31,代码来源:execute.php

示例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']) {
开发者ID:ragulka,项目名称:Saurus-CMS-Community-Edition,代码行数:31,代码来源:ajax_response.php

示例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;
开发者ID:hnlam1986,项目名称:TheGioiSanKhau,代码行数:31,代码来源:execute.php

示例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>
开发者ID:nvminhtu,项目名称:PHP_Tools,代码行数:31,代码来源:rename-folder.php

示例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 != '..') {
开发者ID:heruprasetya,项目名称:Codeigniter-SMS-Gateway-Gammu,代码行数:31,代码来源:dialog.php

示例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'];
开发者ID:Ereaey,项目名称:Cloud,代码行数:31,代码来源:index.php


注:本文中的rename_folder函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。