Merge "Added SpecialPageAfterExecute and SpecialPageBeforeExecute hooks"
[lhc/web/wiklou.git] / maintenance / eval.php
index 8c3bf86..3bd164f 100644 (file)
@@ -34,7 +34,7 @@
 $optionsWithArgs = array( 'd' );
 
 /** */
-require_once( "commandLine.inc" );
+require_once( dirname( __FILE__ ) . "/commandLine.inc" );
 
 if ( isset( $options['d'] ) ) {
        $d = $options['d'];
@@ -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'] ) ?
@@ -74,11 +69,6 @@ while ( ( $line = Maintenance::readconsole() ) !== false ) {
                readline_add_history( $line );
                readline_write_history( $historyFile );
        }
-       if( false !== strpos($line, "<?php") ) {
-               # Someone send a .php file to STDIN so we do not want
-               # to interprate the special '<?php'.
-               continue;
-       }
        $val = eval( $line . ";" );
        if ( wfIsHipHop() || is_null( $val ) ) {
                echo "\n";