50c19034a86df7275b5722a2c36be687ae55b57f
[friendica-addons.git/.git] / advancedcontentfilter / vendor / symfony / cache / Simple / PhpFilesCache.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\Cache\Simple;
13
14 use Symfony\Component\Cache\Exception\CacheException;
15 use Symfony\Component\Cache\PruneableInterface;
16 use Symfony\Component\Cache\Traits\PhpFilesTrait;
17
18 class PhpFilesCache extends AbstractCache implements PruneableInterface
19 {
20     use PhpFilesTrait;
21
22     /**
23      * @param string      $namespace
24      * @param int         $defaultLifetime
25      * @param string|null $directory
26      *
27      * @throws CacheException if OPcache is not enabled
28      */
29     public function __construct($namespace = '', $defaultLifetime = 0, $directory = null)
30     {
31         if (!static::isSupported()) {
32             throw new CacheException('OPcache is not enabled.');
33         }
34         parent::__construct('', $defaultLifetime);
35         $this->init($namespace, $directory);
36
37         $e = new \Exception();
38         $this->includeHandler = function () use ($e) { throw $e; };
39         $this->zendDetectUnicode = filter_var(ini_get('zend.detect_unicode'), \FILTER_VALIDATE_BOOLEAN);
40     }
41 }