nativeSerialize = $params['nativeSerialize']; } elseif ( extension_loaded( 'apcu' ) && ini_get( 'apc.serializer' ) === 'default' ) { // APCu has a memory corruption bug when the serializer is set to 'default'. // See T120267, and upstream bug reports: // - https://github.com/krakjoe/apcu/issues/38 // - https://github.com/krakjoe/apcu/issues/35 // - https://github.com/krakjoe/apcu/issues/111 $this->logger->warning( 'The APCu extension is loaded and the apc.serializer INI setting ' . 'is set to "default". This can cause memory corruption! ' . 'You should change apc.serializer to "php" instead. ' . 'See .' ); $this->nativeSerialize = false; } else { $this->nativeSerialize = true; } } public function get( $key, &$casToken = null, $flags = 0 ) { $val = apc_fetch( $key . self::KEY_SUFFIX ); $casToken = $val; if ( is_string( $val ) && !$this->nativeSerialize ) { $val = $this->isInteger( $val ) ? intval( $val ) : unserialize( $val ); } return $val; } public function set( $key, $value, $exptime = 0 ) { if ( !$this->nativeSerialize && !$this->isInteger( $value ) ) { $value = serialize( $value ); } apc_store( $key . self::KEY_SUFFIX, $value, $exptime ); return true; } public function delete( $key ) { apc_delete( $key . self::KEY_SUFFIX ); return true; } public function incr( $key, $value = 1 ) { return apc_inc( $key . self::KEY_SUFFIX, $value ); } public function decr( $key, $value = 1 ) { return apc_dec( $key . self::KEY_SUFFIX, $value ); } }