From 062f81f5bc7097047dadf6f597564533e1538bfe Mon Sep 17 00:00:00 2001 From: Jack Phoenix Date: Sun, 29 Mar 2009 12:27:59 +0000 Subject: [PATCH] renameDbPrefix.php tweaks: corrected script name in help message (this is not updateSpecialPages.php ;) + added spacing --- maintenance/renameDbPrefix.php | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/maintenance/renameDbPrefix.php b/maintenance/renameDbPrefix.php index 17568b4a04..277f3b95cb 100644 --- a/maintenance/renameDbPrefix.php +++ b/maintenance/renameDbPrefix.php @@ -1,17 +1,17 @@ query( "SHOW TABLES LIKE '".$dbw->escapeLike($old)."%'" ); +$res = $dbw->query( "SHOW TABLES LIKE '".$dbw->escapeLike( $old )."%'" ); foreach( $res as $row ) { // XXX: odd syntax. MySQL outputs an oddly cased "Tables of X" // sort of message. Best not to try $row->x stuff... @@ -58,11 +58,10 @@ foreach( $res as $row ) { // Silly for loop over one field... foreach( $fields as $resName => $table ) { // $old should be regexp safe ([a-zA-Z_]) - $newTable = preg_replace( '/^'.$old.'/',$new,$table); + $newTable = preg_replace( '/^'.$old.'/', $new, $table ); print "Renaming table $table to $newTable\n"; $dbw->query( "RENAME TABLE $table TO $newTable" ); } $count++; } -print "Done! [$count tables]\n"; - +print "Done! [$count tables]\n"; \ No newline at end of file -- 2.20.1