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


PHP View::rmdir方法代碼示例

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


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

示例1: run

 public function run()
 {
     $view = new View('/');
     $children = $view->getDirectoryContent('/');
     foreach ($children as $child) {
         if ($view->is_dir($child->getPath())) {
             $thumbnailsFolder = $child->getPath() . '/thumbnails';
             if ($view->is_dir($thumbnailsFolder)) {
                 $view->rmdir($thumbnailsFolder);
             }
         }
     }
 }
開發者ID:evanjt,項目名稱:core,代碼行數:13,代碼來源:preview.php

示例2: testSingleStorageDeleteFolderFail

 /**
  * Delete should fail is the source folder cant be deleted
  */
 public function testSingleStorageDeleteFolderFail()
 {
     /**
      * @var \OC\Files\Storage\Temporary | \PHPUnit_Framework_MockObject_MockObject $storage
      */
     $storage = $this->getMockBuilder('\\OC\\Files\\Storage\\Temporary')->setConstructorArgs([[]])->setMethods(['rename', 'unlink', 'rmdir'])->getMock();
     $storage->expects($this->any())->method('rmdir')->will($this->returnValue(false));
     $cache = $storage->getCache();
     Filesystem::mount($storage, [], '/' . $this->user . '/files');
     $this->userView->mkdir('folder');
     $this->userView->file_put_contents('folder/test.txt', 'foo');
     $this->assertTrue($storage->file_exists('folder/test.txt'));
     $this->assertFalse($this->userView->rmdir('folder'));
     $this->assertTrue($storage->file_exists('folder'));
     $this->assertTrue($storage->file_exists('folder/test.txt'));
     $this->assertTrue($cache->inCache('folder'));
     $this->assertTrue($cache->inCache('folder/test.txt'));
     // file should not be in the trashbin
     $results = $this->rootView->getDirectoryContent($this->user . '/files_trashbin/files/');
     $this->assertEquals(0, count($results));
 }
開發者ID:kebenxiaoming,項目名稱:owncloudRedis,代碼行數:24,代碼來源:storage.php

示例3: rmdir

 public static function rmdir($path)
 {
     return self::$defaultInstance->rmdir($path);
 }
開發者ID:stweil,項目名稱:owncloud-core,代碼行數:4,代碼來源:Filesystem.php


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