$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]);
}
* {@inheritdoc}
*/
public function getAllCollectionNames() {
+ if (!is_dir($this->directory)) {
+ return [];
+ }
$collections = $this->getAllCollectionNamesHelper($this->directory);
sort($collections);
return $collections;
* @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.