You are here

protected function ConfigForm::getFileList in Flysystem 8

Same name and namespace in other branches
  1. 3.x src/Form/ConfigForm.php \Drupal\flysystem\Form\ConfigForm::getFileList()
  2. 2.0.x src/Form/ConfigForm.php \Drupal\flysystem\Form\ConfigForm::getFileList()
  3. 3.0.x src/Form/ConfigForm.php \Drupal\flysystem\Form\ConfigForm::getFileList()

Returns the file list for a scheme.

Parameters

string $scheme: The scheme.

Return value

string[] A list of files.

1 call to ConfigForm::getFileList()
ConfigForm::submitForm in src/Form/ConfigForm.php
Form submission handler.

File

src/Form/ConfigForm.php, line 217

Class

ConfigForm
Configure file system settings for this site.

Namespace

Drupal\flysystem\Form

Code

protected function getFileList($scheme) {
  $filesystem = $this->factory
    ->getFilesystem($scheme);
  $files = array_filter($filesystem
    ->listContents('', TRUE), function ($meta) {
    return $meta['type'] === 'file';
  });
  return array_map(function (array $meta) {
    return $meta['path'];
  }, $files);
}