4 * Wrapper for XCache object caching functions; identical interface
9 class XCacheBagOStuff
extends BagOStuff
{
11 * Are we operating in CLI mode? Since xcache doesn't work then and they
12 * don't want to change that
16 private $isCli = false;
18 public function __construct() {
19 $this->isCli
= php_sapi_name() == 'cli';
23 * Get a value from the XCache object cache
25 * @param $key String: cache key
28 public function get( $key ) {
32 $val = xcache_get( $key );
34 if ( is_string( $val ) ) {
35 $val = unserialize( $val );
42 * Store a value in the XCache object cache
44 * @param $key String: cache key
45 * @param $value Mixed: object to store
46 * @param $expire Int: expiration time
49 public function set( $key, $value, $expire = 0 ) {
51 xcache_set( $key, serialize( $value ), $expire );
57 * Remove a value from the XCache object cache
59 * @param $key String: cache key
60 * @param $time Int: not used in this implementation
63 public function delete( $key, $time = 0 ) {