- /**
- * Read an object from the cache
- * @param $key string
- * @return mixed
- */
- protected function cacheFetch( $key ) {
- global $wgLanguageConverterCacheType, $wgMemc;
-
- if ( $wgLanguageConverterCacheType === 'apc' ) {
- return apc_fetch( $key );
- } elseif ( $wgLanguageConverterCacheType === 'main' ) {
- return $wgMemc->get( $key );
- }
-
- return false; // disabled
- }
-
- /**
- * Store an object into the cache
- * @param $key string
- * @param $val mixed
- * @param $ttl integer Seconds to live
- * @return bool Success
- */
- protected function cacheStore( $key, $val, $ttl ) {
- global $wgLanguageConverterCacheType, $wgMemc;
-
- if ( $wgLanguageConverterCacheType === 'apc' ) {
- return apc_store( $key, $val, $ttl );
- } elseif ( $wgLanguageConverterCacheType === 'main' ) {
- return $wgMemc->set( $key, $val, $ttl );
- }
-
- return true; // disabled
- }
-