4 * Wrapper for WinCache object caching functions; identical interface
9 class WinCacheBagOStuff
extends BagOStuff
{
12 * Get a value from the WinCache object cache
14 * @param $key String: cache key
17 public function get( $key ) {
18 $val = wincache_ucache_get( $key );
20 if ( is_string( $val ) ) {
21 $val = unserialize( $val );
28 * Store a value in the WinCache object cache
30 * @param $key String: cache key
31 * @param $value Mixed: object to store
32 * @param $expire Int: expiration time
35 public function set( $key, $value, $expire = 0 ) {
36 $result = wincache_ucache_set( $key, serialize( $value ), $expire );
38 /* wincache_ucache_set returns an empty array on success if $value
39 was an array, bool otherwise */
40 return ( is_array( $result ) && $result === array() ) ||
$result;
44 * Remove a value from the WinCache object cache
46 * @param $key String: cache key
47 * @param $time Int: not used in this implementation
50 public function delete( $key, $time = 0 ) {
51 wincache_ucache_delete( $key );
56 public function keys() {
57 $info = wincache_ucache_info();
58 $list = $info['ucache_entries'];
61 if ( is_null( $list ) ) {
65 foreach ( $list as $entry ) {
66 $keys[] = $entry['key_name'];