Update cache.php
This commit is contained in:
parent
00133fb0e3
commit
a6eb416982
|
|
@ -40,13 +40,13 @@ class cache {
|
|||
if ($fp === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//send a custom event
|
||||
|
||||
|
||||
//run the memcache
|
||||
$command = "memcache set ".$key." ".$value;
|
||||
$result = event_socket_request($fp, 'api '.$command);
|
||||
|
||||
|
||||
//close event socket
|
||||
fclose($fp);
|
||||
}
|
||||
|
|
@ -58,7 +58,7 @@ class cache {
|
|||
}
|
||||
}
|
||||
|
||||
// return result
|
||||
//return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
@ -75,26 +75,26 @@ class cache {
|
|||
if ($fp === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//send a custom event
|
||||
|
||||
|
||||
//run the memcache
|
||||
$command = "memcache get ".$key;
|
||||
$result = event_socket_request($fp, 'api '.$command);
|
||||
|
||||
|
||||
//close event socket
|
||||
fclose($fp);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//get the file cache
|
||||
if ($_SESSION['cache']['method']['text'] == "file") {
|
||||
if (file_exists($_SESSION['cache']['location']['text'] . "/" . $key)) {
|
||||
$result = file_get_contents($_SESSION['cache']['location']['text'] . "/" . $key);
|
||||
}
|
||||
}
|
||||
|
||||
// return result
|
||||
|
||||
//return result
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
@ -187,7 +187,6 @@ class cache {
|
|||
|
||||
//close event socket
|
||||
fclose($fp);
|
||||
|
||||
}
|
||||
|
||||
//cache method file
|
||||
|
|
@ -202,10 +201,9 @@ class cache {
|
|||
|
||||
//remove the cache
|
||||
recursive_delete($_SESSION['cache']['location']['text']);
|
||||
|
||||
}
|
||||
|
||||
// return result
|
||||
//return result
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue