MediaWiki  REL1_19
APCBagOStuff.php
Go to the documentation of this file.
00001 <?php
00002 
00008 class APCBagOStuff extends BagOStuff {
00009         public function get( $key ) {
00010                 $val = apc_fetch( $key );
00011 
00012                 if ( is_string( $val ) ) {
00013                         $val = unserialize( $val );
00014                 }
00015 
00016                 return $val;
00017         }
00018 
00019         public function set( $key, $value, $exptime = 0 ) {
00020                 apc_store( $key, serialize( $value ), $exptime );
00021 
00022                 return true;
00023         }
00024 
00025         public function delete( $key, $time = 0 ) {
00026                 apc_delete( $key );
00027 
00028                 return true;
00029         }
00030 
00031         public function keys() {
00032                 $info = apc_cache_info( 'user' );
00033                 $list = $info['cache_list'];
00034                 $keys = array();
00035 
00036                 foreach ( $list as $entry ) {
00037                         $keys[] = $entry['info'];
00038                 }
00039 
00040                 return $keys;
00041         }
00042 }
00043