Start of ObjectCache reorganisation. Moved the object cache files to includes/objectc...
[lhc/web/wiklou.git] / includes / objectcache / eAccelBagOStuff.php
1 <?php
2
3 /**
4 * This is a wrapper for eAccelerator's shared memory functions.
5 *
6 * This is basically identical to the deceased Turck MMCache version,
7 * mostly because eAccelerator is based on Turck MMCache.
8 *
9 * @ingroup Cache
10 */
11 class eAccelBagOStuff extends BagOStuff {
12 public function get( $key ) {
13 $val = eaccelerator_get( $key );
14
15 if ( is_string( $val ) ) {
16 $val = unserialize( $val );
17 }
18
19 return $val;
20 }
21
22 public function set( $key, $value, $exptime = 0 ) {
23 eaccelerator_put( $key, serialize( $value ), $exptime );
24
25 return true;
26 }
27
28 public function delete( $key, $time = 0 ) {
29 eaccelerator_rm( $key );
30
31 return true;
32 }
33
34 public function lock( $key, $waitTimeout = 0 ) {
35 eaccelerator_lock( $key );
36
37 return true;
38 }
39
40 public function unlock( $key ) {
41 eaccelerator_unlock( $key );
42
43 return true;
44 }
45 }
46