public function FileStorage::listAll

Implements Drupal\Core\Config\StorageInterface::listAll().

Overrides StorageInterface::listAll

1 method overrides FileStorage::listAll()

File

drupal/core/lib/Drupal/Core/Config/FileStorage.php, line 186
Definition of Drupal\Core\Config\FileStorage.

Class

FileStorage
Defines the file storage controller.

Namespace

Drupal\Core\Config

Code

public function listAll($prefix = '') {

  // glob() silently ignores the error of a non-existing search directory,
  // even with the GLOB_ERR flag.
  if (!file_exists($this->directory)) {
    throw new StorageException($this->directory . '/ not found.');
  }
  $extension = '.' . static::getFileExtension();
  $files = glob($this->directory . '/' . $prefix . '*' . $extension);
  $clean_name = function ($value) use ($extension) {
    return basename($value, $extension);
  };
  return array_map($clean_name, $files);
}