本文整理汇总了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));
}
示例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;
}
示例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;
}