Merge "Title: Title::getSubpage should not lose the interwiki prefix"
[lhc/web/wiklou.git] / maintenance / mctest.php
index c976bd7..513edf3 100644 (file)
@@ -43,6 +43,8 @@ class McTest extends Maintenance {
        public function execute() {
                global $wgMainCacheType, $wgMemCachedTimeout, $wgObjectCaches;
 
+               $memcachedTypes = [ CACHE_MEMCACHED, 'memcached-php', 'memcached-pecl' ];
+
                $cache = $this->getOption( 'cache' );
                $iterations = $this->getOption( 'i', 100 );
                if ( $cache ) {
@@ -50,9 +52,9 @@ class McTest extends Maintenance {
                                $this->fatalError( "MediaWiki isn't configured with a cache named '$cache'" );
                        }
                        $servers = $wgObjectCaches[$cache]['servers'];
-               } elseif ( $this->hasArg() ) {
-                       $servers = [ $this->getArg() ];
-               } elseif ( $wgMainCacheType === CACHE_MEMCACHED ) {
+               } elseif ( $this->hasArg( 0 ) ) {
+                       $servers = [ $this->getArg( 0 ) ];
+               } elseif ( in_array( $wgMainCacheType, $memcachedTypes, true ) ) {
                        global $wgMemCachedServers;
                        $servers = $wgMemCachedServers;
                } elseif ( isset( $wgObjectCaches[$wgMainCacheType]['servers'] ) ) {