summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2007-07-01 17:26:00 +0200
committerPierre Schmitz <pierre@archlinux.de>2007-07-01 17:26:00 +0200
commit1a1c15f5da352895fb32daab8550cb3dca8198ac (patch)
tree8eb33761870540875e10b06886e26ca43c036f35 /includes
parente59767e15f7dd511c341cef3683fe6a83fc7651b (diff)
benutze xcache_isset
Diffstat (limited to 'includes')
-rw-r--r--includes/BagOStuff.php16
1 files changed, 6 insertions, 10 deletions
diff --git a/includes/BagOStuff.php b/includes/BagOStuff.php
index d1c93c2a..e8abb74e 100644
--- a/includes/BagOStuff.php
+++ b/includes/BagOStuff.php
@@ -507,7 +507,7 @@ class APCBagOStuff extends BagOStuff {
return apc_delete( $key );
}
- function add($key, $value, $exptime=0) {
+ public function add($key, $value, $exptime=0) {
return apc_add( $key, $value, $exptime );
}
}
@@ -519,11 +519,7 @@ class APCBagOStuff extends BagOStuff {
*/
class XCacheBagOStuff extends BagOStuff {
public function get( $key ) {
- $val = xcache_get( $key );
- if ( is_string( $val ) ) {
- $val = unserialize( $val );
- }
- return $val;
+ return (xcache_isset($key) ? unserialize(xcache_get($key)) : false);
}
public function set( $key, $value, $exptime = 0 ) {
@@ -534,19 +530,19 @@ class XCacheBagOStuff extends BagOStuff {
return xcache_unset( $key );
}
- function incr($key, $value=1) {
+ public function incr($key, $value=1) {
return (xcache_isset($key) && xcache_inc($key. $value));
}
- function decr($key, $value=1) {
+ public function decr($key, $value=1) {
return (xcache_isset($key) && xcache_dec($key. $value));
}
- function add($key, $value, $exptime=0) {
+ public function add($key, $value, $exptime=0) {
return (!xcache_isset($key) && $this->set( $key, $value, $exptime ));
}
- function replace($key, $value, $exptime=0) {
+ public function replace($key, $value, $exptime=0) {
return (xcache_isset($key) && $this->set( $key, $value, $exptime ));
}
}