|
@@ -33,6 +33,10 @@ class cache {
|
|
|
* @var string $value string to be cached
|
|
|
*/
|
|
|
public function set($key, $value) {
|
|
|
+
|
|
|
+ //change the delimiter
|
|
|
+ $key = str_replace(":", ".", $key);
|
|
|
+
|
|
|
//save to memcache
|
|
|
if ($_SESSION['cache']['method']['text'] == "memcache") {
|
|
|
//connect to event socket
|
|
@@ -51,9 +55,7 @@ class cache {
|
|
|
|
|
|
//save to the file cache
|
|
|
if ($_SESSION['cache']['method']['text'] == "file") {
|
|
|
- if (file_exists($_SESSION['cache']['location']['text'] . "/" . $key)) {
|
|
|
- $result = file_put_contents($_SESSION['cache']['location']['text'] . "/" . $key, $value);
|
|
|
- }
|
|
|
+ $result = file_put_contents($_SESSION['cache']['location']['text'] . "/" . $key, $value);
|
|
|
}
|
|
|
|
|
|
//return result
|
|
@@ -66,6 +68,9 @@ class cache {
|
|
|
*/
|
|
|
public function get($key) {
|
|
|
|
|
|
+ //change the delimiter
|
|
|
+ $key = str_replace(":", ".", $key);
|
|
|
+
|
|
|
//cache method memcache
|
|
|
if ($_SESSION['cache']['method']['text'] == "memcache") {
|
|
|
// connect to event socket
|