/home/techb158/ileadtechnology.com/vendor/ankitpokhrel/tus-php/src/Cache
NameSizeModeActions
AbstractCache.php13210644editdlrm
ApcuStore.php16940644editdlrm
Cacheable.php14010644editdlrm
CacheFactory.php4550644editdlrm
FileStore.php66920644editdlrm
RedisStore.php21060644editdlrm
Edit: /home/techb158/ileadtechnology.com/vendor/ankitpokhrel/tus-php/src/Cache/RedisStore.php (2106B)
redis = new RedisClient($options); } /** * Get redis. * * @return RedisClient */ public function getRedis(): RedisClient { return $this->redis; } /** * {@inheritDoc} */ public function get(string $key, bool $withExpired = false) { $prefix = $this->getPrefix(); if (false === strpos($key, $prefix)) { $key = $prefix . $key; } $contents = $this->redis->get($key); if (null !== $contents) { $contents = json_decode($contents, true); } if ($withExpired) { return $contents; } if ( ! $contents) { return 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; } $status = $this->redis->set($this->getPrefix() . $key, json_encode($contents)); return 'OK' === $status->getPayload(); } /** * {@inheritDoc} */ public function delete(string $key): bool { $prefix = $this->getPrefix(); if (false === strpos($key, $prefix)) { $key = $prefix . $key; } return $this->redis->del([$key]) > 0; } /** * {@inheritDoc} */ public function keys(): array { return $this->redis->keys($this->getPrefix() . '*'); } }