cache delete
This commit is contained in:
@@ -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, "'\\").'\'';
|
||||
|
||||
@@ -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"]);
|
||||
|
||||
Reference in New Issue
Block a user