Skip to content

Commit

Permalink
Bug 43688 - mcc.php doesn't work with new WMF memcached config
Browse files Browse the repository at this point in the history
Change-Id: Ic0d87d27e6db78314d92968d7c6d265cf6d24013
  • Loading branch information
reedy authored and Gerrit Code Review committed Jan 16, 2013
1 parent 852c947 commit 5db75ef
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions maintenance/mcc.php
Expand Up @@ -25,9 +25,16 @@
/** */
require_once( __DIR__ . '/commandLine.inc' );

$mcc = new MWMemcached( array( 'persistent' => true/*, 'debug' => true*/ ) );
$mcc->set_servers( $wgMemCachedServers );
# $mcc->set_debug( true );
$mcc = new MWMemcached( array( 'persistent' => true ) );

if ( $wgMainCacheType === CACHE_MEMCACHED ) {
$mcc->set_servers( $wgMemCachedServers );
} elseif( isset( $wgObjectCaches[$wgMainCacheType] ) ) {
$mcc->set_servers( $wgObjectCaches[$wgMainCacheType]['servers'] );
} else {
print "MediaWiki isn't configured for Memcached usage\n";
exit( 1 );
}

function mccShowHelp( $command ) {
$commandList = array(
Expand Down Expand Up @@ -73,7 +80,7 @@ function mccShowHelp( $command ) {
case 'help':
// show an help message
mccShowHelp( array_shift( $args ) );
break;
break;

case 'get':
$sub = '';
Expand All @@ -93,7 +100,7 @@ function mccShowHelp( $command ) {
} else {
var_dump( $res );
}
break;
break;

case 'getsock':
$res = $mcc->get( $args[0] );
Expand Down

0 comments on commit 5db75ef

Please sign in to comment.