Removing leecruft. No, you sure as hell couldn't defer it.
[lhc/web/wiklou.git] / includes / ObjectCache.php
index a1db1c2..336e0e6 100644 (file)
@@ -4,10 +4,6 @@
  * @subpackage Cache
  */
 
-/** */
-if (!defined('MEDIAWIKI')) die( "Not a valid entry point\n");
-
-
 /**
  * FakeMemCachedClient imitates the API of memcached-client v. 0.1.2.
  * It acts as a memcached server with no RAM, that is, all objects are
@@ -53,9 +49,9 @@ function &wfGetCache( $inputType ) {
        }
 
        if ( $type == CACHE_MEMCACHED ) {
-               if ( !array_key_exists( CACHE_MEMCACHED, $wgCaches ) ){ 
+               if ( !array_key_exists( CACHE_MEMCACHED, $wgCaches ) ){
                        require_once( 'memcached-client.php' );
-                       
+
                        if (!class_exists("MemcachedClientforWiki")) {
                                class MemCachedClientforWiki extends memcached {
                                        function _debugprint( $text ) {
@@ -64,8 +60,8 @@ function &wfGetCache( $inputType ) {
                                }
                        }
 
-                       $wgCaches[CACHE_DB] = new MemCachedClientforWiki( 
-                               array('persistant' => true, 'compress_threshold' => 1500 ) );
+                       $wgCaches[CACHE_DB] = new MemCachedClientforWiki(
+                               array('persistant' => false, 'compress_threshold' => 1500 ) );
                        $cache =& $wgCaches[CACHE_DB];
                        $cache->set_servers( $wgMemCachedServers );
                        $cache->set_debug( $wgMemCachedDebug );
@@ -94,7 +90,7 @@ function &wfGetCache( $inputType ) {
                }
                $cache =& $wgCaches[CACHE_DB];
        }
-       
+
        if ( $cache === false ) {
                if ( !array_key_exists( CACHE_NONE, $wgCaches ) ) {
                        $wgCaches[CACHE_NONE] = new FakeMemCachedClient;
@@ -107,17 +103,20 @@ function &wfGetCache( $inputType ) {
 
 function &wfGetMainCache() {
        global $wgMainCacheType;
-       return wfGetCache( $wgMainCacheType );
+       $ret =& wfGetCache( $wgMainCacheType );
+       return $ret;
 }
 
 function &wfGetMessageCacheStorage() {
        global $wgMessageCacheType;
-       return wfGetCache( $wgMessageCacheType );
+       $ret =& wfGetCache( $wgMessageCacheType );
+       return $ret;
 }
 
-function wfGetParserCacheStorage() {
+function &wfGetParserCacheStorage() {
        global $wgParserCacheType;
-       return wfGetCache( $wgParserCacheType );
+       $ret =& wfGetCache( $wgParserCacheType );
+       return $ret;
 }
 
 ?>