dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed some spacing in maintenance folder
[lhc/web/wiklou.git]
/
maintenance
/
mcc.php
diff --git
a/maintenance/mcc.php
b/maintenance/mcc.php
index
4e0f291
..
4bed0d4
100644
(file)
--- a/
maintenance/mcc.php
+++ b/
maintenance/mcc.php
@@
-25,10
+25,13
@@
/** */
require_once( __DIR__ . '/commandLine.inc' );
/** */
require_once( __DIR__ . '/commandLine.inc' );
-$debug = in_array( '--debug', $argv );
-$help = in_array( '--help', $argv );
+$options = getopt( '', array( 'debug', 'help', 'cache:' ) );
-if( $help ) {
+$debug = isset( $options['debug'] );
+$help = isset( $options['help'] );
+$cache = isset( $options['cache'] ) ? $options['cache'] : null;
+
+if ( $help ) {
mccShowUsage();
exit( 0 );
}
mccShowUsage();
exit( 0 );
}
@@
-37,9
+40,15
@@
$mcc = new MWMemcached( array(
'debug' => $debug,
) );
'debug' => $debug,
) );
-if ( $wgMainCacheType === CACHE_MEMCACHED ) {
+if ( $cache ) {
+ if ( !isset( $wgObjectCaches[$cache] ) ) {
+ print "MediaWiki isn't configured with a cache named '$cache'";
+ exit( 1 );
+ }
+ $servers = $wgObjectCaches[$cache]['servers'];
+} elseif ( $wgMainCacheType === CACHE_MEMCACHED ) {
$mcc->set_servers( $wgMemCachedServers );
$mcc->set_servers( $wgMemCachedServers );
-} elseif
( isset( $wgObjectCaches[$wgMainCacheType
] ) ) {
+} elseif
( isset( $wgObjectCaches[$wgMainCacheType]['servers'
] ) ) {
$mcc->set_servers( $wgObjectCaches[$wgMainCacheType]['servers'] );
} else {
print "MediaWiki isn't configured for Memcached usage\n";
$mcc->set_servers( $wgObjectCaches[$wgMainCacheType]['servers'] );
} else {
print "MediaWiki isn't configured for Memcached usage\n";
@@
-107,7
+116,9
@@
do {
$quit = false;
$line = Maintenance::readconsole();
$quit = false;
$line = Maintenance::readconsole();
- if ( $line === false ) exit;
+ if ( $line === false ) {
+ exit;
+ }
$args = explode( ' ', $line );
$command = array_shift( $args );
$args = explode( ' ', $line );
$command = array_shift( $args );