Implements Drupal\Core\Config\StorageInterface::listAll().
Overrides StorageInterface::listAll
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);
}