* (bug 21403) memcached class renamed to MWMemecached to avoid conflict with PHP...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 20 Nov 2009 15:37:28 +0000 (15:37 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 20 Nov 2009 15:37:28 +0000 (15:37 +0000)
* Put MemCachedClientforWiki in memcached-client.php so that maintenance/mctest.php doesn't crash when $wgMainCacheType is not CACHE_MEMCACHED
Based on a patch by Kim Hyun-Joon

CREDITS
RELEASE-NOTES
includes/AutoLoader.php
includes/ObjectCache.php
includes/memcached-client.php
maintenance/mcc.php

diff --git a/CREDITS b/CREDITS
index b7e6fd6..0a25df2 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -81,6 +81,7 @@ following names for their contribution to the product.
 * Jidanni
 * Jimmy Xu
 * Karun Dambietz
+* Kim Hyun-Joon
 * liangent
 * Lucas Garczewski
 * Louperivois
index 7b04ea0..fc6ddab 100644 (file)
@@ -642,6 +642,8 @@ Hopefully we will remove this configuration var soon)
   instead of fsockopen() with fwrite().
 * (bug 16884) Fixed feed links in sidebar not complying with URL parameters
   of the displayed page
+* (bug 21403) memcached class renamed to MWMemecached to avoid conflict with
+  PHP's memcached extension
 
 == API changes in 1.16 ==
 
index a28ffd6..92c1f2a 100644 (file)
@@ -162,10 +162,11 @@ $wgAutoloadLocalClasses = array(
        'MediaWikiBagOStuff' => 'includes/BagOStuff.php',
        'MediaWiki_I18N' => 'includes/SkinTemplate.php',
        'MediaWiki' => 'includes/Wiki.php',
-       'memcached' => 'includes/memcached-client.php',
+       'MemCachedClientforWiki' => 'includes/memcached-client.php',
        'MessageCache' => 'includes/MessageCache.php',
        'MimeMagic' => 'includes/MimeMagic.php',
        'MWException' => 'includes/Exception.php',
+       'MWMemcached' => 'includes/memcached-client.php',
        'MWNamespace' => 'includes/Namespace.php',
        'Namespace' => 'includes/NamespaceCompat.php', // Compat
        'OldChangesList' => 'includes/ChangesList.php',
index d4f5084..9b2835f 100644 (file)
@@ -52,13 +52,6 @@ function &wfGetCache( $inputType ) {
 
        if ( $type == CACHE_MEMCACHED ) {
                if ( !array_key_exists( CACHE_MEMCACHED, $wgCaches ) ) {
-                       if ( !class_exists( 'MemCachedClientforWiki' ) ) {
-                               class MemCachedClientforWiki extends memcached {
-                                       function _debugprint( $text ) {
-                                               wfDebug( "memcached: $text" );
-                                       }
-                               }
-                       }
                        $wgCaches[CACHE_MEMCACHED] = new MemCachedClientforWiki(
                                array('persistant' => $wgMemCachedPersistent, 'compress_threshold' => 1500 ) );
                        $wgCaches[CACHE_MEMCACHED]->set_servers( $wgMemCachedServers );
index 76bcb51..5e9d6cb 100644 (file)
@@ -44,7 +44,7 @@
  *
  * require_once 'memcached.php';
  *
- * $mc = new memcached(array(
+ * $mc = new MWMemcached(array(
  *              'servers' => array('127.0.0.1:10000',
  *                                 array('192.0.0.1:10010', 2),
  *                                 '127.0.0.1:10020'),
 // {{{ requirements
 // }}}
 
-// {{{ class memcached
+// {{{ class MWMemcached
 /**
  * memcached client class implemented using (p)fsockopen()
  *
  * @author  Ryan T. Dean <rtdean@cytherianage.net>
  * @ingroup Cache
  */
-class memcached
+class MWMemcached
 {
    // {{{ properties
    // {{{ public
@@ -1082,3 +1082,9 @@ class memcached
 // vim: sts=3 sw=3 et
 
 // }}}
+
+class MemCachedClientforWiki extends MWMemcached {
+       function _debugprint( $text ) {
+               wfDebug( "memcached: $text" );
+       }
+}
index 3fa7d77..909d7ca 100644 (file)
@@ -10,7 +10,7 @@
 /** */
 require_once( dirname(__FILE__) . '/commandLine.inc' );
 
-$mcc = new memcached( array('persistant' => true/*, 'debug' => true*/) );
+$mcc = new MWMemcached( array('persistant' => true/*, 'debug' => true*/) );
 $mcc->set_servers( $wgMemCachedServers );
 #$mcc->set_debug( true );