From 64631fe13fedf24a880d8b86f87f17c0906692ad Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Fri, 10 Nov 2023 09:19:29 -0500 Subject: [PATCH] server tag --- www-api/app/Controllers/BaseController.php | 7 ++++--- www-api/app/Controllers/WrenchApi.php | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/www-api/app/Controllers/BaseController.php b/www-api/app/Controllers/BaseController.php index b5aff432..d988622b 100644 --- a/www-api/app/Controllers/BaseController.php +++ b/www-api/app/Controllers/BaseController.php @@ -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!
'; @@ -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!
'; $data = unserialize(cache()->get($cacheKey)); diff --git a/www-api/app/Controllers/WrenchApi.php b/www-api/app/Controllers/WrenchApi.php index 7d0571fa..a4009a21 100644 --- a/www-api/app/Controllers/WrenchApi.php +++ b/www-api/app/Controllers/WrenchApi.php @@ -497,6 +497,7 @@ class WrenchApi extends BaseController $current_env = $this->getSiteConfigurations("system.live"); $primary_image_sever = $this->getSiteConfigurations("system.primary_image_sever"); + $server_tag = $this->getSiteConfigurations("system.server_tag"); // echo "EXYTACT INPUT DATA HERE"; $raw_json = file_get_contents('php://input'); @@ -566,6 +567,7 @@ class WrenchApi extends BaseController $final_out["environment"] = $current_env + 0; // force convert to interger = $this->getSiteConfigurations("system.live"); $final_out["session_image_server"] = $primary_image_sever; // ( $final_out["environment"] > 0 )? 'https://apigate.nebula.g1.wrenchboard.com/en/wrench/api/v1/getmedia/' : "https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1/getmedia/"; //$final_out["session_image_server"] = "https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1/getmedia/"; + $final_out["server_tag"] = $server_tag; $final_out["language"] = "en"; $final_out["ip_loc"] = $ip_loc; //return json_encode( ( new \App\Models\ResultFormatter() )->processOutJson($in, $out));