function Cache::__construct
Same name in this branch
- 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
ComposerCode
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;
}
}