function FileStorage::__construct

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

Constructs a new FileStorage.

Parameters

string $directory: A directory path to use for reading and writing of configuration files.

string $collection: (optional) The collection to store configuration in. Defaults to the default collection.

1 call to FileStorage::__construct()
InstallStorage::__construct in core/lib/Drupal/Core/Config/InstallStorage.php
Constructs an InstallStorage object.
1 method overrides FileStorage::__construct()
InstallStorage::__construct in core/lib/Drupal/Core/Config/InstallStorage.php
Constructs an InstallStorage object.

File

core/lib/Drupal/Core/Config/FileStorage.php, line 46

Class

FileStorage
Defines the file storage.

Namespace

Drupal\Core\Config

Code

public function __construct($directory, $collection = StorageInterface::DEFAULT_COLLECTION) {
    $this->directory = $directory;
    $this->collection = $collection;
    // Use a NULL File Cache backend by default. This will ensure only the
    // internal static caching of FileCache is used and thus avoids blowing up
    // the APCu cache.
    $this->fileCache = FileCacheFactory::get('config', [
        'cache_backend_class' => NULL,
    ]);
}

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