MediaWiki REL1_30
APCUBagOStuff.php
Go to the documentation of this file.
1<?php
38 public function __construct( array $params = [] ) {
39 parent::__construct( $params );
40 }
41
42 protected function doGet( $key, $flags = 0 ) {
43 return $this->getUnserialize(
44 apcu_fetch( $key . self::KEY_SUFFIX )
45 );
46 }
47
48 public function set( $key, $value, $exptime = 0, $flags = 0 ) {
49 apcu_store(
50 $key . self::KEY_SUFFIX,
51 $this->setSerialize( $value ),
52 $exptime
53 );
54
55 return true;
56 }
57
58 public function delete( $key ) {
59 apcu_delete( $key . self::KEY_SUFFIX );
60
61 return true;
62 }
63
64 public function incr( $key, $value = 1 ) {
70 if ( apcu_exists( $key . self::KEY_SUFFIX ) ) {
71 return apcu_inc( $key . self::KEY_SUFFIX, $value );
72 } else {
73 return false;
74 }
75 }
76
77 public function decr( $key, $value = 1 ) {
83 if ( apcu_exists( $key . self::KEY_SUFFIX ) ) {
84 return apcu_dec( $key . self::KEY_SUFFIX, $value );
85 } else {
86 return false;
87 }
88 }
89}
This is a wrapper for APC's shared memory functions.
getUnserialize( $value)
setSerialize( $value)
This is a wrapper for APCU's shared memory functions.
doGet( $key, $flags=0)
incr( $key, $value=1)
Increase stored value of $key by $value while preserving its TTL.
decr( $key, $value=1)
Decrease stored value of $key by $value while preserving its TTL.
__construct(array $params=[])
Available parameters are:
it s the revision text itself In either if gzip is the revision text is gzipped $flags
Definition hooks.txt:2805
$params