當前位置: 首頁>>代碼示例>>PHP>>正文


PHP dir::remove方法代碼示例

本文整理匯總了PHP中dir::remove方法的典型用法代碼示例。如果您正苦於以下問題:PHP dir::remove方法的具體用法?PHP dir::remove怎麽用?PHP dir::remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在dir的用法示例。


在下文中一共展示了dir::remove方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: uninstall

 protected function uninstall($plugin, $output)
 {
     $root = $this->kirby()->roots()->plugins() . DS . $plugin;
     dir::remove($root);
     $output->writeln('<comment>The "' . $plugin . '" plugin has been removed!</comment>');
     $output->writeln('');
 }
開發者ID:getkirby,項目名稱:cli,代碼行數:7,代碼來源:Uninstall.php

示例2: testSize

 public function testSize()
 {
     dir::make($this->tmpDir);
     f::write($this->tmpDir . DS . 'testfile-1.txt', str::random(5));
     f::write($this->tmpDir . DS . 'testfile-2.txt', str::random(5));
     f::write($this->tmpDir . DS . 'testfile-3.txt', str::random(5));
     $this->assertEquals(15, dir::size($this->tmpDir));
     $this->assertEquals('15 b', dir::niceSize($this->tmpDir));
     dir::remove($this->tmpDir);
 }
開發者ID:LucasFyl,項目名稱:korakia,代碼行數:10,代碼來源:DirTest.php

示例3: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     if ($this->isInstalled() === false) {
         throw new RuntimeException('Invalid Kirby installation');
     }
     $helper = $this->getHelper('question');
     $question = new ConfirmationQuestion('<info>Do you really want to uninstall the Panel? (y/n)</info>' . PHP_EOL . 'leave blank to cancel: ', false);
     if ($helper->ask($input, $output, $question)) {
         // load kirby
         $this->bootstrap();
         // remove the panel folder
         dir::remove($this->dir() . DS . 'panel');
         $output->writeln('<comment>The panel has been uninstalled!</comment>');
         $output->writeln('');
     }
 }
開發者ID:getkirby,項目名稱:cli,代碼行數:16,代碼來源:Panel.php

示例4: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     if ($this->isInstalled() === false) {
         throw new RuntimeException('Invalid Kirby installation');
     }
     $helper = $this->getHelper('question');
     $question = new ConfirmationQuestion('<info>Do you really want to uninstall Kirby? (y/n)</info>' . PHP_EOL . 'leave blank to cancel: ', false);
     if ($helper->ask($input, $output, $question)) {
         // load kirby
         $this->bootstrap();
         f::remove($this->dir() . DS . 'index.php');
         f::remove($this->dir() . DS . '.htaccess');
         f::remove($this->dir() . DS . '.gitignore');
         f::remove($this->dir() . DS . 'license.md');
         f::remove($this->dir() . DS . 'readme.md');
         dir::remove($this->dir() . DS . 'kirby');
         dir::remove($this->dir() . DS . 'panel');
         dir::remove($this->dir() . DS . 'thumbs');
         $output->writeln('<comment>Kirby has been uninstalled!</comment>');
         $output->writeln('');
     }
 }
開發者ID:getkirby,項目名稱:cli,代碼行數:22,代碼來源:Uninstall.php

示例5: delete

 /**
  * Deletes the page
  *
  * @param boolean $force Forces the page to be deleted even if there are subpages
  */
 public function delete($force = false)
 {
     if (!$this->isDeletable()) {
         throw new Exception('The page cannot be deleted');
     }
     if ($force === false and $this->children()->count()) {
         throw new Exception('This page has subpages');
     }
     $parent = $this->parent();
     if (!dir::remove($this->root())) {
         throw new Exception('The page could not be deleted');
     }
     $this->kirby->cache()->flush();
     $parent->reset();
     return true;
 }
開發者ID:LucasFyl,項目名稱:korakia,代碼行數:21,代碼來源:page.php

示例6: resizeOnDemandDeleteDir

function resizeOnDemandDeleteDir($pageId)
{
    $path = str_replace('/', DS, $pageId);
    $root = kirby()->roots()->index() . DS . 'thumbs' . DS . $path;
    // delete directory with resized images
    if (f::exists($root)) {
        dir::remove($root, false);
    }
}
開發者ID:aoimedia,項目名稱:kirby-resize-on-demand-plugin,代碼行數:9,代碼來源:resizeOnDemand.php

示例7: tearDown

 protected function tearDown()
 {
     dir::remove($this->root);
 }
開發者ID:Zegnat,項目名稱:library,代碼行數:4,代碼來源:testcase.php

示例8: removeThumbs

 /**
  * Clean the thumbs folder for the page
  * 
  */
 public function removeThumbs()
 {
     return dir::remove($this->kirby()->roots()->thumbs() . DS . $this->id());
 }
開發者ID:nsteiner,項目名稱:kdoc,代碼行數:8,代碼來源:page.php

示例9: deleteDir

 static function deleteDir()
 {
     $delete = self::childByUID(get('uid'));
     if (!$delete) {
         return array('status' => 'error', 'msg' => l::get('pages.errors.notfound'));
     }
     if ($delete->isHomePage()) {
         return array('status' => 'error', 'msg' => l::get('pages.delete.errors.homepage'));
     }
     if ($delete->isErrorPage()) {
         return array('status' => 'error', 'msg' => l::get('pages.delete.errors.errorpage'));
     }
     if ($delete->hasChildren()) {
         return array('status' => 'error', 'msg' => l::get('pages.delete.errors.subpages'));
     }
     if (!dir::remove($delete->root())) {
         return array('status' => 'error', 'msg' => l::get('pages.delete.errors.permissions'));
     }
     self::killCache();
     return array('status' => 'success', 'msg' => l::get('pages.delete.success'));
 }
開發者ID:nilshendriks,項目名稱:kirbycms-panel,代碼行數:21,代碼來源:data.php

示例10: delete

 public function delete()
 {
     // get this before the item is killed
     $dayroot = $this->root('day');
     if (!dir::remove($this->root())) {
         throw new Exception('The item directory could not be removed');
     }
     if (!$this->library->database->query('delete from items where id = :id', array('id' => $this->id))) {
         throw new Exception('The delete query failed');
     }
     // make sure to clean up the directory attic
     $this->library->clean($dayroot);
 }
開發者ID:Zegnat,項目名稱:library,代碼行數:13,代碼來源:item.php

示例11: delete

 /**
  * Overload delete to include assets
  * when the object is deleted.
  */
 public function delete($id = NULL)
 {
     if ($id === NULL and $this->loaded) {
         # delete testimonial survey questions
         ORM::factory('question')->where(array('owner_id' => $id))->delete_all();
         echo 'survey questions deleted<br/>';
         # delete testimonial tags/categories
         ORM::factory('tag')->where(array('owner_id' => $id))->delete_all();
         echo 'testimonial tags deleted<br/>';
         # delete tconfigs
         ORM::factory('tconfig')->where(array('owner_id' => $id))->delete_all();
         echo 'tconfig settings deleted<br/>';
         # delete all testimonials
         ORM::factory('testimonial')->where(array('owner_id' => $id))->delete_all();
         echo 'testimonials deleted<br/>';
         # delete owner data folder.
         $folder = t_paths::data($this->apikey);
         if (dir::remove($folder)) {
             echo "data directory {$folder} deleted<br/>";
         }
     }
     return parent::delete($id);
 }
開發者ID:plusjade,項目名稱:pluspanda-php,代碼行數:27,代碼來源:owner.php

示例12: 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

示例13: clean

 public function clean($root)
 {
     if (!is_dir($root)) {
         throw new Exception('The given directory does not exist');
     }
     if (!str::startsWith($root, $this->root)) {
         throw new Exception('Invalid directory. Must be within the library');
     }
     while ($root != $this->root) {
         $files = dir::read($root);
         if (count($files) === 0) {
             dir::remove($root);
         } else {
             break;
         }
         $root = dirname($root);
     }
 }
開發者ID:Zegnat,項目名稱:library,代碼行數:18,代碼來源:library.php

示例14: delete

 protected function delete($name, $output)
 {
     dir::remove($this->root() . DS . $name);
     $output->writeln('<comment>The "' . $name . '" plugin has been deleted!</comment>');
     $output->writeln('');
 }
開發者ID:getkirby,項目名稱:cli,代碼行數:6,代碼來源:Plugin.php


注:本文中的dir::remove方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。