����JFIF��x�x����'
Server IP : 66.29.137.217 / Your IP : 3.16.130.16 Web Server : LiteSpeed System : Linux premium294.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : gltevjme ( 1095) PHP Version : 7.0.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/gltevjme/bofirmacademy.com/vendor/ankitpokhrel/tus-php/src/Cache/ |
Upload File : |
<?php namespace TusPhp\Cache; use APCUIterator; use Carbon\Carbon; class ApcuStore extends AbstractCache { /** * {@inheritDoc} */ public function get(string $key, bool $withExpired = false) { $contents = apcu_fetch($this->getActualCacheKey($key)); if ( ! $contents) { return null; } if ($withExpired) { return $contents ?: null; } $isExpired = Carbon::parse($contents['expires_at'])->lt(Carbon::now()); return $isExpired ? null : $contents; } /** * {@inheritDoc} */ public function set(string $key, $value) { $contents = $this->get($key) ?? []; if (\is_array($value)) { $contents = $value + $contents; } else { $contents[] = $value; } return apcu_store($this->getActualCacheKey($key), $contents, $this->getTtl()); } /** * {@inheritDoc} */ public function delete(string $key): bool { return true === apcu_delete($this->getActualCacheKey($key)); } /** * {@inheritDoc} */ public function keys(): array { $iterator = new APCUIterator('/^' . preg_quote($this->getPrefix()) . '.*$/', APC_ITER_KEY); return array_column(iterator_to_array($iterator, false), 'key'); } /** * Get actual cache key with prefix. * * @param string $key * * @return string */ protected function getActualCacheKey(string $key): string { $prefix = $this->getPrefix(); if (false === strpos($key, $prefix)) { $key = $prefix . $key; } return $key; } }