server tag
This commit is contained in:
@@ -37,7 +37,7 @@ abstract class BaseController extends Controller
|
||||
* @var array
|
||||
*/
|
||||
protected $helpers = [];
|
||||
|
||||
private $cache_tag='NONE';
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
@@ -49,10 +49,11 @@ abstract class BaseController extends Controller
|
||||
// Preload any models, libraries, etc, here.
|
||||
|
||||
// E.g.: $this->session = \Config\Services::session();
|
||||
$cache_tag = $this->getSiteConfigurations("system.cache_tag");
|
||||
}
|
||||
|
||||
public function saveCache($cacheKey,$data,$timeLine=5000){
|
||||
$cacheKey = CACHE_DOMAIN."-".$cacheKey;
|
||||
$cacheKey = $this.cache_tag."-".$cacheKey;
|
||||
// $cache = \Config\Services::cache();
|
||||
if (! $foo = cache($cacheKey)) {
|
||||
// echo 'Saving to the cache!<br>';
|
||||
@@ -68,7 +69,7 @@ abstract class BaseController extends Controller
|
||||
|
||||
public function getCache($cacheKey){
|
||||
$data = [];
|
||||
$cacheKey = CACHE_DOMAIN."-".$cacheKey;
|
||||
$cacheKey = $this.cache_tag."-".$cacheKey;
|
||||
if (cache($cacheKey)) {
|
||||
// echo 'Getting Data From Cache!<br>';
|
||||
$data = unserialize(cache()->get($cacheKey));
|
||||
|
||||
Reference in New Issue
Block a user