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


PHP dir::move方法代码示例

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


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

示例1: changeNum

 static function changeNum($uid, $num)
 {
     $p = self::childByUID($uid);
     if (!$p) {
         return array('status' => 'error', 'msg' => l::get('pages.errors.notfound'));
     }
     if ($num == $p->num()) {
         return array('status' => 'success', 'msg' => l::get('nochanges'));
     }
     $dirname = dirname($p->root()) . '/' . $num . '-' . $p->uid();
     if (!dir::move($p->root(), $dirname)) {
         return array('status' => 'error', 'msg' => l::get('pages.errors.move'));
     }
     return array('status' => 'success', 'msg' => l::get('pages.moved'));
 }
开发者ID:nilshendriks,项目名称:kirbycms-panel,代码行数:15,代码来源:data.php

示例2: move

 /**
  * Moves the directory to a new location
  * 
  * @param string $to
  * @return boolean
  */
 public function move($to)
 {
     if (!dir::move($this->root, $to)) {
         return false;
     } else {
         $this->root = true;
         return true;
     }
 }
开发者ID:LucasFyl,项目名称:korakia,代码行数:15,代码来源:folder.php

示例3: hide

 /**
  * Make the page invisible by removing the prepended number
  */
 public function hide()
 {
     if ($this->isInvisible()) {
         return true;
     }
     $root = dirname($this->root()) . DS . $this->uid();
     if (!dir::move($this->root(), $root)) {
         throw new Exception('The directory could not be moved');
     }
     $this->dirname = $this->uid();
     $this->num = null;
     $this->root = $root;
     $this->kirby->cache()->flush();
     $this->reset();
     return true;
 }
开发者ID:LucasFyl,项目名称:korakia,代码行数:19,代码来源:page.php

示例4: testMove

 public function testMove()
 {
     $this->assertTrue(dir::move($this->tmpDir, $this->movedDir));
 }
开发者ID:LucasFyl,项目名称:korakia,代码行数:4,代码来源:DirTest.php

示例5: relocate

 protected function relocate()
 {
     if ($this->old['created'] == $this->data['created']) {
         return;
     }
     $old = clone $this;
     $old->created = $this->old['created'];
     if (!$old->exists()) {
         return;
     }
     if (!dir::make($this->root())) {
         throw new Exception('The new directory could not be created');
     }
     if (!dir::move($old->root(), $this->root())) {
         throw new Exception('The directory could not be moved');
     }
     $this->library->clean($old->root('day'));
 }
开发者ID:Zegnat,项目名称:library,代码行数:18,代码来源:item.php

示例6: move

 /**
  * Move the source to the final destination
  */
 protected function move()
 {
     $exists = $this->pluginExists();
     $error = $exists ? 'The plugin could not be updated' : 'The plugin could not be installed';
     $success = $exists ? 'The plugin has been updated to version:' : 'The plugin has been installed at version:';
     if ($exists) {
         $this->output->writeln('<info>Updating plugin...</info>');
     } else {
         $this->output->writeln('<info>Installing plugin...</info>');
     }
     $this->output->writeln('<info></info>');
     $this->prepare();
     $src = $this->source();
     $dest = $this->destination();
     // overwriting means having to clean the plugin first
     if (is_dir($dest)) {
         if (!dir::remove($dest)) {
             throw new RuntimeException('The old plugin could not be removed before the update');
         }
     }
     if (is_file($src)) {
         if (!f::move($src, $dest)) {
             throw new RuntimeException($error);
         }
     } else {
         if (is_dir($src)) {
             if (!dir::move($src, $dest)) {
                 throw new RuntimeException($error);
             }
         } else {
             throw new RuntimeException('Invalid source');
         }
     }
     $this->output->writeln('<comment>' . $success . ' "' . $this->version() . '"</comment>');
 }
开发者ID:getkirby,项目名称:cli,代码行数:38,代码来源:Plugin.php


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