From: Jack Phoenix Date: Sun, 29 Mar 2009 12:27:59 +0000 (+0000) Subject: renameDbPrefix.php tweaks: corrected script name in help message (this is not updateS... X-Git-Tag: 1.31.0-rc.0~42293 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=062f81f5bc7097047dadf6f597564533e1538bfe;p=lhc%2Fweb%2Fwiklou.git renameDbPrefix.php tweaks: corrected script name in help message (this is not updateSpecialPages.php ;) + added spacing --- 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