Wrench Jobs
This commit is contained in:
@@ -52,6 +52,17 @@ abstract class BaseController extends Controller
|
||||
$this->cache_tag = $this->getSiteConfigurations("system.cache_tag");
|
||||
}
|
||||
|
||||
public function getIpData(){
|
||||
//$ip_loc="0.0.0.0";
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
|
||||
$ip_loc = $_SERVER['HTTP_CLIENT_IP'];
|
||||
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
||||
$ip_loc = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
} else {
|
||||
$ip_loc = $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
return $ip_loc;
|
||||
}
|
||||
public function saveCache($cacheKey,$data,$timeLine=5000){
|
||||
$cacheKey = $this->cache_tag."-".$cacheKey;
|
||||
// $cache = \Config\Services::cache();
|
||||
|
||||
Reference in New Issue
Block a user