Declare globals. Move this all inside the $method = pipe stuff anyway.
authorChad Horohoe <demon@users.mediawiki.org>
Tue, 4 Aug 2009 23:09:43 +0000 (23:09 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Tue, 4 Aug 2009 23:09:43 +0000 (23:09 +0000)
maintenance/populateSha1.php

index cc06a2a..4233cb2 100644 (file)
@@ -55,10 +55,11 @@ class PopulateSha1 extends Maintenance {
                $oldimageTable = $dbw->tableName( 'oldimage' );
                $batch = array();
        
-               $cmd = 'mysql -u' . wfEscapeShellArg( $wgDBuser ) . 
-                       ' -h' . wfEscapeShellArg( $wgDBserver ) .
-                       ' -p' . wfEscapeShellArg( $wgDBpassword, $wgDBname );
                if ( $method == 'pipe' ) {
+                       global $wgDBuser, $wgDBserver, $wgDBpassword, $wgDBname;
+                       $cmd = 'mysql -u' . wfEscapeShellArg( $wgDBuser ) . 
+                               ' -h' . wfEscapeShellArg( $wgDBserver ) .
+                               ' -p' . wfEscapeShellArg( $wgDBpassword, $wgDBname );
                        $this->output( "Using pipe method\n" );
                        $pipe = popen( $cmd, 'w' );
                }