Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Cache.php

function Cache::__construct

Same name in this branch
  1. 11.1.x vendor/symfony/http-kernel/Attribute/Cache.php \Symfony\Component\HttpKernel\Attribute\Cache::__construct()

Parameters

string $cacheDir location of the cache:

string $allowlist List of characters that are allowed in path names (used in a regex character class):

Filesystem $filesystem optional filesystem instance:

bool $readOnly whether the cache is in readOnly mode:

File

vendor/composer/composer/src/Composer/Cache.php, line 50

Class

Cache
Reads/writes to a filesystem cache

Namespace

Composer

Code

public function __construct(IOInterface $io, string $cacheDir, string $allowlist = 'a-z0-9._', ?Filesystem $filesystem = null, bool $readOnly = false) {
    $this->io = $io;
    $this->root = rtrim($cacheDir, '/\\') . '/';
    $this->allowlist = $allowlist;
    $this->filesystem = $filesystem ?: new Filesystem();
    $this->readOnly = $readOnly;
    if (!self::isUsable($cacheDir)) {
        $this->enabled = false;
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal