r11925 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r11924‎ | r11925 | r11926 >
Date:17:02, 3 December 2005
Author:hashar
Status:old
Tags:
Comment:
code formatting
Modified paths:
  • /trunk/phase3/maintenance/mcc.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/mcc.php
@@ -8,8 +8,8 @@
99 */
1010
1111 /** */
12 -require_once( "commandLine.inc" );
13 -require_once("memcached-client.php");
 12+require_once( 'commandLine.inc' );
 13+require_once( 'memcached-client.php' );
1414
1515 $mcc = new memcached( array('persistant' => true, 'debug' => true) );
1616 $mcc->set_servers( $wgMemCachedServers );
@@ -18,12 +18,16 @@
1919 do {
2020 $bad = false;
2121 $quit = false;
22 - $line = readconsole( "> " );
 22+
 23+ $line = readconsole( '> ' );
2324 if ($line === false) exit;
24 - $args = explode( " ", $line );
 25+
 26+ $args = explode( ' ', $line );
2527 $command = array_shift( $args );
 28+
2629 switch ( $command ) {
27 - case "get":
 30+
 31+ case 'get':
2832 print "Getting {$args[0]}[{$args[1]}]\n";
2933 $res = $mcc->get( $args[0] );
3034 if ( array_key_exists( 1, $args ) ) {
@@ -38,37 +42,43 @@
3943 var_dump( $res );
4044 }
4145 break;
42 - case "getsock":
 46+
 47+ case 'getsock':
4348 $res = $mcc->get( $args[0] );
4449 $sock = $mcc->get_sock( $args[0] );
4550 var_dump( $sock );
4651 break;
47 - case "set":
 52+
 53+ case 'set':
4854 $key = array_shift( $args );
4955 if ( $args[0] == "#" && is_numeric( $args[1] ) ) {
50 - $value = str_repeat( "*", $args[1] );
 56+ $value = str_repeat( '*', $args[1] );
5157 } else {
52 - $value = implode( " ", $args );
 58+ $value = implode( ' ', $args );
5359 }
5460 if ( !$mcc->set( $key, $value, 0 ) ) {
5561 #print 'Error: ' . $mcc->error_string() . "\n";
5662 print "MemCached error\n";
5763 }
5864 break;
59 - case "delete":
60 - $key = implode( " ", $args );
 65+
 66+ case 'delete':
 67+ $key = implode( ' ', $args );
6168 if ( !$mcc->delete( $key ) ) {
6269 #print 'Error: ' . $mcc->error_string() . "\n";
6370 print "MemCached error\n";
6471 }
65 - break;
66 - case "dumpmcc":
 72+ break;
 73+
 74+ case 'dumpmcc':
6775 var_dump( $mcc );
6876 break;
69 - case "quit":
70 - case "exit":
 77+
 78+ case 'quit':
 79+ case 'exit':
7180 $quit = true;
7281 break;
 82+
7383 default:
7484 $bad = true;
7585 }
@@ -77,7 +87,7 @@
7888 print "Bad command\n";
7989 }
8090 } else {
81 - if ( function_exists( "readline_add_history" ) ) {
 91+ if ( function_exists( 'readline_add_history' ) ) {
8292 readline_add_history( $line );
8393 }
8494 }

Status & tagging log