summaryrefslogtreecommitdiff
path: root/vendor/symfony/cache/Simple/PhpFilesCache.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/symfony/cache/Simple/PhpFilesCache.php')
-rw-r--r--vendor/symfony/cache/Simple/PhpFilesCache.php13
1 files changed, 5 insertions, 8 deletions
diff --git a/vendor/symfony/cache/Simple/PhpFilesCache.php b/vendor/symfony/cache/Simple/PhpFilesCache.php
index 9231c8cd39..19ac8b4152 100644
--- a/vendor/symfony/cache/Simple/PhpFilesCache.php
+++ b/vendor/symfony/cache/Simple/PhpFilesCache.php
@@ -20,22 +20,19 @@ class PhpFilesCache extends AbstractCache implements PruneableInterface
use PhpFilesTrait;
/**
- * @param string $namespace
- * @param int $defaultLifetime
- * @param string|null $directory
+ * @param $appendOnly Set to `true` to gain extra performance when the items stored in this pool never expire.
+ * Doing so is encouraged because it fits perfectly OPcache's memory model.
*
* @throws CacheException if OPcache is not enabled
*/
- public function __construct($namespace = '', $defaultLifetime = 0, $directory = null)
+ public function __construct(string $namespace = '', int $defaultLifetime = 0, string $directory = null, bool $appendOnly = false)
{
- if (!static::isSupported()) {
- throw new CacheException('OPcache is not enabled');
- }
+ $this->appendOnly = $appendOnly;
+ self::$startTime = self::$startTime ?? $_SERVER['REQUEST_TIME'] ?? time();
parent::__construct('', $defaultLifetime);
$this->init($namespace, $directory);
$e = new \Exception();
$this->includeHandler = function () use ($e) { throw $e; };
- $this->zendDetectUnicode = ini_get('zend.detect_unicode');
}
}