![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mcoil.corals.io/vendor/binarytorch/larecipe/src/ |
<?php namespace BinaryTorch\LaRecipe; use Illuminate\Contracts\Cache\Repository; class Cache { /** * The cache implementation. * * @var Cache */ protected $cache; /** * Create a new documentation instance. * * @param Repository $cache * @return void */ public function __construct(Repository $cache) { $this->cache = $cache; } /** * Wrapper. * * @param \Closure $callback * @param string $key * @return mixed */ public function remember(\Closure $callback, $key) { if (! config('larecipe.cache.enabled')) { return $callback(); } $cachePeriod = $this->checkTtlNeedsChanged(config('larecipe.cache.period')); return $this->cache->remember($key, $cachePeriod, $callback); } /** * Checks if minutes need to be changed to seconds * * @param $ttl * @return float|int */ public function checkTtlNeedsChanged($ttl) { $app_version = explode('.', app()->version()); if (((int) $app_version[0] == 5 && (int) $app_version[1] >= 8) || $app_version[0] > 5) { return config('larecipe.cache.period') * 60; } return $ttl; } }