本文整理汇总了PHP中TYPO3\CMS\Core\Resource\ResourceStorage::getFileList方法的典型用法代码示例。如果您正苦于以下问题:PHP ResourceStorage::getFileList方法的具体用法?PHP ResourceStorage::getFileList怎么用?PHP ResourceStorage::getFileList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Resource\ResourceStorage
的用法示例。
在下文中一共展示了ResourceStorage::getFileList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fileListingsDoNotContainHiddenFilesWithDefaultFilters
/**
* Test if the default filters filter out hidden files (like .htaccess)
*
* @test
*/
public function fileListingsDoNotContainHiddenFilesWithDefaultFilters()
{
// we cannot use fixture->createFile() because touch() does not work with vfsStream
$this->addToMount(array('someFile' => '', '.someHiddenFile' => ''));
$this->prepareFixture();
$this->fixture->resetFileAndFolderNameFiltersToDefault();
$fileList = $this->fixture->getFileList('/');
$this->assertContains('someFile', array_keys($fileList));
$this->assertNotContains('.someHiddenFile', array_keys($fileList));
}
示例2: getFileListHandsOverRecursiveTRUEifSet
/**
* @test
*/
public function getFileListHandsOverRecursiveTRUEifSet()
{
$this->prepareFixture(array());
$driver = $this->createDriverMock(array('basePath' => $this->getMountRootUrl()), $this->fixture, array('getFileList'));
$driver->expects($this->once())->method('getFileList')->with($this->anything(), $this->anything(), $this->anything(), $this->anything(), $this->anything(), TRUE)->will($this->returnValue(array()));
$this->fixture->getFileList('/', 0, 0, TRUE, TRUE, TRUE);
}
示例3: getFileListIgnoresCasingWhenSortingFilenames
/**
* @test
*/
public function getFileListIgnoresCasingWhenSortingFilenames()
{
$fileList = array('aFile' => 'dfsdg', 'zFile' => 'werw', 'BFile' => 'asd', '12345' => 'fdsa', 'IMG_1234.jpg' => 'asdf');
$this->prepareFixture(array());
$driver = $this->createDriverMock(array(), $this->fixture, array('getFileList'));
$driver->expects($this->once())->method('getFileList')->will($this->returnValue($fileList));
$fileList = $this->fixture->getFileList('/');
$this->assertEquals(array('12345', 'aFile', 'BFile', 'IMG_1234.jpg', 'zFile'), array_keys($fileList));
}
示例4: getFileCount
/**
* Returns amount of all files within this folder, optionally filtered by
* the given pattern
*
* @param array $filterMethods
* @return integer
*/
public function getFileCount(array $filterMethods = array())
{
// TODO replace by call to count()
return count($this->storage->getFileList($this->identifier, 0, 0, $filterMethods));
}