FileStorage::listAll

public FileStorage::listAll()

Lists all the files in the storage.

Return value

array Array of filenames.

Overrides PhpStorageInterface::listAll

File

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

Class

FileStorage
Stores the code as regular PHP files.

Namespace

Drupal\Component\PhpStorage

Code

public function listAll() {
  $names = array();
  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;
}
doc_Drupal
2016-10-29 09:13:42
Comments
Leave a Comment

Please login to continue.