45 const KEY_SUFFIX =
':4';
48 $params[
'segmentationSize'] = $params[
'segmentationSize'] ?? INF;
49 parent::__construct( $params );
51 $this->nativeSerialize = ( ini_get(
'apc.serializer' ) !==
'default' );
54 protected function doGet( $key, $flags = 0, &$casToken =
null ) {
57 $blob = apc_fetch( $key . self::KEY_SUFFIX );
59 if ( $value !==
false ) {
66 protected function doSet( $key, $value, $exptime = 0, $flags = 0 ) {
68 $key . self::KEY_SUFFIX,
69 $this->nativeSerialize ? $value : $this->
serialize( $value ),
76 protected function doAdd( $key, $value, $exptime = 0, $flags = 0 ) {
78 $key . self::KEY_SUFFIX,
79 $this->nativeSerialize ? $value : $this->
serialize( $value ),
84 protected function doDelete( $key, $flags = 0 ) {
85 apc_delete( $key . self::KEY_SUFFIX );
90 public function incr( $key, $value = 1, $flags = 0 ) {
91 return apc_inc( $key . self::KEY_SUFFIX, $value );
94 public function decr( $key, $value = 1, $flags = 0 ) {
95 return apc_dec( $key . self::KEY_SUFFIX, $value );