X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FConfig%2FFileStorage.php;h=60c5fa11d65555a44da5e1817e634277c3b2d1e7;hp=84d23d32745abe6d6d9b6b6ef088a77a33e1c8c4;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/lib/Drupal/Core/Config/FileStorage.php b/web/core/lib/Drupal/Core/Config/FileStorage.php index 84d23d327..60c5fa11d 100644 --- a/web/core/lib/Drupal/Core/Config/FileStorage.php +++ b/web/core/lib/Drupal/Core/Config/FileStorage.php @@ -46,7 +46,7 @@ class FileStorage implements StorageInterface { $this->collection = $collection; // Use a NULL File Cache backend by default. This will ensure only the - // internal statc caching of FileCache is used and thus avoids blowing up + // internal static caching of FileCache is used and thus avoids blowing up // the APCu cache. $this->fileCache = FileCacheFactory::get('config', ['cache_backend_class' => NULL]); } @@ -279,6 +279,9 @@ class FileStorage implements StorageInterface { * {@inheritdoc} */ public function getAllCollectionNames() { + if (!is_dir($this->directory)) { + return []; + } $collections = $this->getAllCollectionNamesHelper($this->directory); sort($collections); return $collections; @@ -305,7 +308,8 @@ class FileStorage implements StorageInterface { * @param string $directory * The directory to check for sub directories. This allows this * function to be used recursively to discover all the collections in the - * storage. + * storage. It is the responsibility of the caller to ensure the directory + * exists. * * @return array * A list of collection names contained within the provided directory.