X7ROOT File Manager
Current Path:
/home/gfecatvj/sites/restate/platform/plugins/analytics/src/Cache
home
/
gfecatvj
/
sites
/
restate
/
platform
/
plugins
/
analytics
/
src
/
Cache
/
📁
..
📄
CacheItem.php
(2.15 KB)
📄
CacheItemPool.php
(4.69 KB)
📄
LifetimeHelper.php
(989 B)
Editing: LifetimeHelper.php
<?php namespace Botble\Analytics\Cache; use DateTimeImmutable; use DateTimeInterface; use Exception; use Illuminate\Contracts\Cache\Store; use ReflectionClass; use ReflectionException; class LifetimeHelper { /** * @param DateTimeInterface $expiresAt * @return int * @throws Exception */ public static function computeLifetime(DateTimeInterface $expiresAt) { $now = new DateTimeImmutable('now', $expiresAt->getTimezone()); $seconds = $expiresAt->getTimestamp() - $now->getTimestamp(); return self::isLegacy() ? (int)floor($seconds / 60.0) : $seconds; } /** * @return bool * @throws ReflectionException */ protected static function isLegacy() { static $legacy; if ($legacy === null) { $params = (new ReflectionClass(Store::class))->getMethod('put')->getParameters(); $legacy = $params[2]->getName() === 'minutes'; } return $legacy; } }
Upload File
Create Folder