cache delete

This commit is contained in:
CHIEFSOFT\ameye
2024-09-13 05:59:55 -04:00
parent 9750224b01
commit 0cf684ba2c
2 changed files with 26 additions and 1 deletions
@@ -112,6 +112,16 @@ abstract class BaseController extends Controller
}
return $data;
}
public function deleteCache($cacheKey){
$data = [];
$cacheKey = $this->cache_tag."-".$cacheKey;
if (cache($cacheKey)) {
// echo 'Getting Data From Cache!<br>';
$data = unserialize(cache()->delete($cacheKey));
}
return $data;
}
private function data_stringify($data) {
switch (gettype($data)) {
case 'string' : return '\''.addcslashes($data, "'\\").'\'';
+16 -1
View File
@@ -39,8 +39,23 @@ class WrenchUserContacts extends BaseController
$endpoint = "CONTACTS_IMPORT_ACTION-". $in["uid"];
$outC = $this->getCache($endpoint); // try find in cache
if ( $in["mmode"] == 0 ){
$this->deleteCache($endpoint);
$this->saveCache($endpoint,$in,1300);
}
else
{
$outC = $this->getCache($endpoint); // try find in cache
$in["raw_contacts"] = $in["raw_contacts"].$outC["raw_contacts"];
$this->deleteCache($endpoint);
$this->saveCache($endpoint,$in,1300);
/*
Determine if this is the last
Fire process events
save to the backend database;
*/
}
$this->saveCache($endpoint,$in,300);
///=== cache game gere
$in["raw_contacts"] = serialize($in['raw_contacts'].$in["m2"].$in["m3"]);