本文整理汇总了PHP中League\Flysystem\FilesystemInterface::listFiles方法的典型用法代码示例。如果您正苦于以下问题:PHP FilesystemInterface::listFiles方法的具体用法?PHP FilesystemInterface::listFiles怎么用?PHP FilesystemInterface::listFiles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类League\Flysystem\FilesystemInterface
的用法示例。
在下文中一共展示了FilesystemInterface::listFiles方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findAllBackupFiles
/**
* @return \Illuminate\Support\Collection
*/
private function findAllBackupFiles()
{
$files = new Collection($this->filesystem->listFiles());
$files = $this->filterOutGitignoreFile($files);
$files = $this->sortFilesByCreationDate($files);
return $files;
}
示例2: getList
/**
* Returns a list of Identifier strings
* Unfortunately the list() method is reserved
*
* @return string[]
*/
public function getList()
{
$identifiers = array();
$fileList = $this->filesystem->listFiles($this->getPath());
foreach ($fileList as $file) {
$identifiers[] = $file['filename'];
}
return $identifiers;
}
示例3:
function it_can_remove_old_backups(FilesystemInterface $filesystem)
{
$files = [['path' => '.gitignore'], ['path' => 'foo.sql'], ['path' => 'foo1.sql'], ['path' => 'foo2.sql'], ['path' => 'foo3.sql'], ['path' => 'foo4.sql'], ['path' => 'foo5.sql'], ['path' => 'foo6.sql']];
$filesystem->listFiles()->willReturn($files);
$filesystem->getTimestamp('foo.sql')->willReturn(10000);
$filesystem->getTimestamp('foo1.sql')->willReturn(500);
$filesystem->getTimestamp('foo2.sql')->willReturn(10000);
$filesystem->getTimestamp('foo3.sql')->willReturn(10000);
$filesystem->getTimestamp('foo4.sql')->willReturn(100);
$filesystem->getTimestamp('.gitignore')->willReturn(50);
$filesystem->getTimestamp('foo5.sql')->willReturn(10000);
$filesystem->getTimestamp('foo6.sql')->willReturn(10000);
$filesystem->delete('foo1.sql')->shouldBeCalled();
$filesystem->delete('foo4.sql')->shouldBeCalled();
$this->removeOldBackups(5)->shouldReturn(['foo4.sql', 'foo1.sql']);
}