Fix typo in r97044 reported in twn
[lhc/web/wiklou.git] / maintenance / eval.php
index 9229ae2..1502ad3 100644 (file)
@@ -45,8 +45,11 @@ if ( isset( $options['d'] ) ) {
        }
        if ( $d > 1 ) {
                $lb = wfGetLB();
-               foreach ( $lb->mServers as $i => $server ) {
-                       $lb->mServers[$i]['flags'] |= DBO_DEBUG;
+               $serverCount = $lb->getServerCount(); 
+               for ( $i = 0; $i < $serverCount; $i++ ) {
+                       $server = $lb->getServerInfo( $i );
+                       $server['flags'] |= DBO_DEBUG;
+                       $lb->setServerInfo( $i, $server );
                }
        }
        if ( $d > 2 ) {
@@ -55,7 +58,7 @@ if ( isset( $options['d'] ) ) {
 }
 
 if ( function_exists( 'readline_add_history' )
-       && posix_isatty( 0 /*STDIN*/ ) )
+       && Maintenance::posix_isatty( 0 /*STDIN*/ ) )
 {
        $useReadline = true;
 } else {
@@ -74,7 +77,7 @@ while ( ( $line = Maintenance::readconsole() ) !== false ) {
                readline_write_history( $historyFile );
        }
        $val = eval( $line . ";" );
-       if ( is_null( $val ) ) {
+       if ( wfIsHipHop() || is_null( $val ) ) {
                echo "\n";
        } elseif ( is_string( $val ) || is_numeric( $val ) ) {
                echo "$val\n";