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


PHP ResourceStorage::getFolderList方法代碼示例

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


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

示例1: folderListingsDoNotContainHiddenFoldersByDefault

 /**
  * Test if the default filters filter out hidden folders (like .htaccess)
  *
  * @test
  */
 public function folderListingsDoNotContainHiddenFoldersByDefault()
 {
     $this->addToMount(array('someFolder' => array(), '.someHiddenFolder' => array()));
     $this->prepareFixture();
     $this->fixture->resetFileAndFolderNameFiltersToDefault();
     $folderList = $this->fixture->getFolderList('/');
     $this->assertContains('someFolder', array_keys($folderList));
     $this->assertNotContains('.someHiddenFolder', array_keys($folderList));
 }
開發者ID:noxludo,項目名稱:TYPO3v4-Core,代碼行數:14,代碼來源:StorageTest.php

示例2: getSubfolders

 /**
  * Returns a list of all subfolders
  *
  * @return \TYPO3\CMS\Core\Resource\Folder[]
  */
 public function getSubfolders()
 {
     $folderObjects = array();
     $folderArray = $this->storage->getFolderList($this->identifier);
     if (count($folderArray) > 0) {
         /** @var $factory \TYPO3\CMS\Core\Resource\ResourceFactory */
         $factory = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\ResourceFactory');
         // TODO this will not work with non-hierarchical storages
         // -> the identifier for subfolders is not composed of the
         // current item's identifier for these
         foreach ($folderArray as $folder) {
             $folderObjects[] = $factory->createFolderObject($this->storage, $this->identifier . $folder['name'] . '/', $folder['name']);
         }
     }
     return $folderObjects;
 }
開發者ID:noxludo,項目名稱:TYPO3v4-Core,代碼行數:21,代碼來源:Folder.php

示例3: getSubfolders

 /**
  * Returns a list of subfolders
  *
  * @param integer $start The item to start at
  * @param integer $numberOfItems The number of items to return
  * @param integer $filterMode The filter mode to use for the file list.
  * @return \TYPO3\CMS\Core\Resource\Folder[]
  */
 public function getSubfolders($start = 0, $numberOfItems = 0, $filterMode = self::FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS)
 {
     list($backedUpFilters, $useFilters) = $this->prepareFiltersInStorage($filterMode);
     $folderObjects = array();
     $folderArray = $this->storage->getFolderList($this->identifier, $start, $numberOfItems, $useFilters);
     if (count($folderArray) > 0) {
         /** @var $factory \TYPO3\CMS\Core\Resource\ResourceFactory */
         $factory = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\ResourceFactory');
         // TODO this will not work with non-hierarchical storages
         // -> the identifier for subfolders is not composed of the
         // current item's identifier for these
         foreach ($folderArray as $folder) {
             $folderObjects[$folder['name']] = $factory->createFolderObject($this->storage, $this->identifier . $folder['name'] . '/', $folder['name']);
         }
     }
     $this->restoreBackedUpFiltersInStorage($backedUpFilters);
     return $folderObjects;
 }
開發者ID:nicksergio,項目名稱:TYPO3v4-Core,代碼行數:26,代碼來源:Folder.php


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