當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。