function FileStorage::listAll

Same name in this branch
  1. 9 core/lib/Drupal/Core/Config/FileStorage.php \Drupal\Core\Config\FileStorage::listAll()
Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Config/FileStorage.php \Drupal\Core\Config\FileStorage::listAll()
  2. 8.9.x core/lib/Drupal/Component/PhpStorage/FileStorage.php \Drupal\Component\PhpStorage\FileStorage::listAll()
  3. 10 core/lib/Drupal/Core/Config/FileStorage.php \Drupal\Core\Config\FileStorage::listAll()
  4. 10 core/lib/Drupal/Component/PhpStorage/FileStorage.php \Drupal\Component\PhpStorage\FileStorage::listAll()
  5. 11.x core/lib/Drupal/Core/Config/FileStorage.php \Drupal\Core\Config\FileStorage::listAll()
  6. 11.x core/lib/Drupal/Component/PhpStorage/FileStorage.php \Drupal\Component\PhpStorage\FileStorage::listAll()

Overrides PhpStorageInterface::listAll

1 call to FileStorage::listAll()
MTimeProtectedFastFileStorage::garbageCollection in core/lib/Drupal/Component/PhpStorage/MTimeProtectedFastFileStorage.php
Performs garbage collection on the storage.

File

core/lib/Drupal/Component/PhpStorage/FileStorage.php, line 198

Class

FileStorage
Stores the code as regular PHP files.

Namespace

Drupal\Component\PhpStorage

Code

public function listAll() {
    $names = [];
    if (file_exists($this->directory)) {
        foreach (new \DirectoryIterator($this->directory) as $fileinfo) {
            if (!$fileinfo->isDot()) {
                $name = $fileinfo->getFilename();
                if ($name != '.htaccess') {
                    $names[] = $name;
                }
            }
        }
    }
    return $names;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.