HTCPPurge() early exit on socket error
[lhc/web/wiklou.git] / maintenance / eval.php
index 9ad51bb..abedc61 100644 (file)
@@ -34,7 +34,7 @@
 $optionsWithArgs = array( 'd' );
 
 /** */
-require_once( "commandLine.inc" );
+require_once __DIR__ . "/commandLine.inc";
 
 if ( isset( $options['d'] ) ) {
        $d = $options['d'];
@@ -43,7 +43,7 @@ if ( isset( $options['d'] ) ) {
        }
        if ( $d > 1 ) {
                $lb = wfGetLB();
-               $serverCount = $lb->getServerCount(); 
+               $serverCount = $lb->getServerCount();
                for ( $i = 0; $i < $serverCount; $i++ ) {
                        $server = $lb->getServerInfo( $i );
                        $server['flags'] |= DBO_DEBUG;
@@ -55,13 +55,8 @@ if ( isset( $options['d'] ) ) {
        }
 }
 
-if ( function_exists( 'readline_add_history' )
-       && Maintenance::posix_isatty( 0 /*STDIN*/ ) )
-{
-       $useReadline = true;
-} else {
-       $useReadline = false;
-}
+$useReadline = function_exists( 'readline_add_history' )
+                       && Maintenance::posix_isatty( 0 /*STDIN*/ );
 
 if ( $useReadline ) {
        $historyFile = isset( $_ENV['HOME'] ) ?
@@ -85,5 +80,3 @@ while ( ( $line = Maintenance::readconsole() ) !== false ) {
 }
 
 print "\n";
-
-