| Name | Size | Mode | Actions |
|---|---|---|---|
| AbstractAdapter.php | 8165 | 0644 | editdlrm |
| AbstractTagAwareAdapter.php | 12640 | 0644 | editdlrm |
| AdapterInterface.php | 986 | 0644 | editdlrm |
| ApcuAdapter.php | 3692 | 0644 | editdlrm |
| ArrayAdapter.php | 11269 | 0644 | editdlrm |
| ChainAdapter.php | 9063 | 0644 | editdlrm |
| CouchbaseBucketAdapter.php | 7729 | 0644 | editdlrm |
| DoctrineAdapter.php | 2584 | 0644 | editdlrm |
| FilesystemAdapter.php | 933 | 0644 | editdlrm |
| FilesystemTagAwareAdapter.php | 7584 | 0644 | editdlrm |
| MemcachedAdapter.php | 13752 | 0644 | editdlrm |
| NullAdapter.php | 2770 | 0644 | editdlrm |
| ParameterNormalizer.php | 898 | 0644 | editdlrm |
| PdoAdapter.php | 22571 | 0644 | editdlrm |
| PhpArrayAdapter.php | 12607 | 0644 | editdlrm |
| PhpFilesAdapter.php | 10260 | 0644 | editdlrm |
| ProxyAdapter.php | 8494 | 0644 | editdlrm |
| Psr16Adapter.php | 1901 | 0644 | editdlrm |
| RedisAdapter.php | 1200 | 0644 | editdlrm |
| RedisTagAwareAdapter.php | 11452 | 0644 | editdlrm |
| TagAwareAdapter.php | 11850 | 0644 | editdlrm |
| TagAwareAdapterInterface.php | 785 | 0644 | editdlrm |
| TraceableAdapter.php | 6926 | 0644 | editdlrm |
| TraceableTagAwareAdapter.php | 926 | 0644 | editdlrm |
/home/techb158/immovalet.com/vendor/symfony/cache/Adapter/ApcuAdapter.php (3692B)
*/ class ApcuAdapter extends AbstractAdapter { private $marshaller; /** * @throws CacheException if APCu is not enabled */ public function __construct(string $namespace = '', int $defaultLifetime = 0, string $version = null, MarshallerInterface $marshaller = null) { if (!static::isSupported()) { throw new CacheException('APCu is not enabled.'); } if ('cli' === \PHP_SAPI) { ini_set('apc.use_request_time', 0); } parent::__construct($namespace, $defaultLifetime); if (null !== $version) { CacheItem::validateKey($version); if (!apcu_exists($version.'@'.$namespace)) { $this->doClear($namespace); apcu_add($version.'@'.$namespace, null); } } $this->marshaller = $marshaller; } public static function isSupported() { return \function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), \FILTER_VALIDATE_BOOLEAN); } /** * {@inheritdoc} */ protected function doFetch(array $ids) { $unserializeCallbackHandler = ini_set('unserialize_callback_func', __CLASS__.'::handleUnserializeCallback'); try { $values = []; foreach (apcu_fetch($ids, $ok) ?: [] as $k => $v) { if (null !== $v || $ok) { $values[$k] = null !== $this->marshaller ? $this->marshaller->unmarshall($v) : $v; } } return $values; } catch (\Error $e) { throw new \ErrorException($e->getMessage(), $e->getCode(), \E_ERROR, $e->getFile(), $e->getLine()); } finally { ini_set('unserialize_callback_func', $unserializeCallbackHandler); } } /** * {@inheritdoc} */ protected function doHave(string $id) { return apcu_exists($id); } /** * {@inheritdoc} */ protected function doClear(string $namespace) { return isset($namespace[0]) && class_exists(\APCuIterator::class, false) && ('cli' !== \PHP_SAPI || filter_var(ini_get('apc.enable_cli'), \FILTER_VALIDATE_BOOLEAN)) ? apcu_delete(new \APCuIterator(sprintf('/^%s/', preg_quote($namespace, '/')), \APC_ITER_KEY)) : apcu_clear_cache(); } /** * {@inheritdoc} */ protected function doDelete(array $ids) { foreach ($ids as $id) { apcu_delete($id); } return true; } /** * {@inheritdoc} */ protected function doSave(array $values, int $lifetime) { if (null !== $this->marshaller && (!$values = $this->marshaller->marshall($values, $failed))) { return $failed; } try { if (false === $failures = apcu_store($values, null, $lifetime)) { $failures = $values; } return array_keys($failures); } catch (\Throwable $e) { if (1 === \count($values)) { // Workaround https://github.com/krakjoe/apcu/issues/170 apcu_delete(key($values)); } throw $e; } } }