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


PHP fs::rename方法代码示例

本文整理汇总了PHP中fs::rename方法的典型用法代码示例。如果您正苦于以下问题:PHP fs::rename方法的具体用法?PHP fs::rename怎么用?PHP fs::rename使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在fs的用法示例。


在下文中一共展示了fs::rename方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionOperation

 public function actionOperation()
 {
     Yii::import('mod.core.components.fs');
     if (isset($_GET['operation'])) {
         //$fs = new fs(dirname(__FILE__) . DS . 'data' . DS . 'root' . DS);
         $fs = new fs(Yii::getPathOfAlias('webroot.themes'));
         try {
             $rslt = null;
             switch ($_GET['operation']) {
                 case 'get_node':
                     $node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
                     $rslt = $fs->lst($node, isset($_GET['id']) && $_GET['id'] === '#');
                     break;
                 case "get_content":
                     $node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
                     $rslt = $fs->data($node);
                     break;
                 case 'create_node':
                     $node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
                     $rslt = $fs->create($node, isset($_GET['text']) ? $_GET['text'] : '', !isset($_GET['type']) || $_GET['type'] !== 'file');
                     break;
                 case 'rename_node':
                     $node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
                     $rslt = $fs->rename($node, isset($_GET['text']) ? $_GET['text'] : '');
                     break;
                 case 'delete_node':
                     $node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
                     $rslt = $fs->remove($node);
                     break;
                 case 'move_node':
                     $node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
                     $parn = isset($_GET['parent']) && $_GET['parent'] !== '#' ? $_GET['parent'] : '/';
                     $rslt = $fs->move($node, $parn);
                     break;
                 case 'copy_node':
                     $node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
                     $parn = isset($_GET['parent']) && $_GET['parent'] !== '#' ? $_GET['parent'] : '/';
                     $rslt = $fs->copy($node, $parn);
                     break;
                 default:
                     throw new Exception('Unsupported operation: ' . $_GET['operation']);
                     break;
             }
             header('Content-Type: application/json; charset=utf-8');
             echo json_encode($rslt);
         } catch (Exception $e) {
             header($_SERVER["SERVER_PROTOCOL"] . ' 500 Server Error');
             header('Status:  500 Server Error');
             echo $e->getMessage();
         }
         die;
     }
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:53,代码来源:TemplateController.php

示例2: switch

 switch ($_GET['operation']) {
     case 'get_node':
         $node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
         $rslt = $fs->lst($node, isset($_GET['id']) && $_GET['id'] === '#');
         break;
     case "get_content":
         $node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
         $rslt = $fs->data($node);
         break;
     case 'create_node':
         $node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
         $rslt = $fs->create($node, isset($_GET['text']) ? $_GET['text'] : '', !isset($_GET['type']) || $_GET['type'] !== 'file');
         break;
     case 'rename_node':
         $node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
         $rslt = $fs->rename($node, isset($_GET['text']) ? $_GET['text'] : '');
         break;
     case 'delete_node':
         $node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
         $rslt = $fs->remove($node);
         break;
     case 'move_node':
         $node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
         $parn = isset($_GET['parent']) && $_GET['parent'] !== '#' ? $_GET['parent'] : '/';
         $rslt = $fs->move($node, $parn);
         break;
     case 'copy_node':
         $node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
         $parn = isset($_GET['parent']) && $_GET['parent'] !== '#' ? $_GET['parent'] : '/';
         $rslt = $fs->copy($node, $parn);
         break;
开发者ID:cheese1,项目名称:ampache,代码行数:31,代码来源:fs.ajax.php

示例3: fs

$rslt = null;
$fs = new fs($url);
try {
    $node = getIdNode($id);
    switch ($operation) {
        case 'get_node':
            $rslt = $fs->lst($node, isset($id) && $id === '#');
            break;
        case "get_content":
            $rslt = $fs->data($node);
            break;
        case 'create_node':
            $rslt = $fs->create($node, getIdText($text), !isset($type) || $type !== 'file');
            break;
        case 'rename_node':
            $rslt = $fs->rename($node, getIdText($text));
            break;
        case 'delete_node':
            $rslt = $fs->remove($node);
            break;
        case 'move_node':
            $rslt = $fs->move($node, getParent($parent));
            break;
        case 'copy_node':
            $rslt = $fs->copy($node, getParent($parent));
            break;
        default:
            throw new Exception(_('Unsupported operation: ') . $operation);
            break;
    }
} catch (Exception $e) {
开发者ID:ThreeScript,项目名称:ThreeScriptTools,代码行数:31,代码来源:ts-editor-server.php

示例4: fs

 $fs = new fs($url);
 try {
     $rslt = null;
     $node = getIdNode($id);
     switch ($operation) {
         case 'get_node':
             $rslt = $fs->lst($node, isset($id) && $id === '#');
             break;
         case "get_content":
             $rslt = $fs->data($node);
             break;
         case 'create_node':
             $rslt = $fs->create($node, isset($text) ? $text : '', !isset($type) || $type !== 'file');
             break;
         case 'rename_node':
             $rslt = $fs->rename($node, isset($text) ? $text : '');
             break;
         case 'delete_node':
             $rslt = $fs->remove($node);
             break;
         case 'move_node':
             $rslt = $fs->move($node, getParent($parent));
             break;
         case 'copy_node':
             $rslt = $fs->copy($node, getParent($parent));
             break;
         default:
             throw new Exception(_('Unsupported operation: ') . $operation);
             break;
     }
     header('Content-Type: application/json; charset=utf-8');
开发者ID:ThreeScript,项目名称:ThreeScriptTools,代码行数:31,代码来源:operation.01a.php


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