From: MaxSem Date: Wed, 18 Feb 2015 22:21:56 +0000 (+0000) Subject: Revert "Make eval.php try to handle newlines in code" X-Git-Tag: 1.31.0-rc.0~12305 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=e97180e5f63ff96c4a75784729fbaf1af13877d0;p=lhc%2Fweb%2Fwiklou.git Revert "Make eval.php try to handle newlines in code" Completely broke the script for me. MaxSem: that was a pretty crazy change fancy trying to detect the end of a statement by shelling out to detect parse errors maybe just revert that? we can probably do a better job with a few regexes I wonder how php -a does it This reverts commit f0ae292da7ef0673b30c68b4a6f3789b2eea8464. Change-Id: I16c9c200dc3f4db55cecc23aaa0d9ff55504c19d --- diff --git a/maintenance/eval.php b/maintenance/eval.php index 3f10a33b51..e20c477af0 100644 --- a/maintenance/eval.php +++ b/maintenance/eval.php @@ -60,11 +60,6 @@ if ( $__useReadline ) { readline_read_history( $__historyFile ); } -$__phpPath = preg_match( '/Zend Engine|HipHop VM/', wfShellExecWithStderr( 'php --version' ) ) - ? 'php' //standard system path name - : ''; // not accessible somehow - -$__multiLine = ''; $__e = null; // PHP exception while ( ( $__line = Maintenance::readconsole() ) !== false ) { if ( $__e && !preg_match( '/^(exit|die);?$/', $__line ) ) { @@ -79,18 +74,8 @@ while ( ( $__line = Maintenance::readconsole() ) !== false ) { readline_add_history( $__line ); readline_write_history( $__historyFile ); } - // Try to only run PHP once a valid chunk is formed (deals with newlines) - if ( $__phpPath ) { - $res = wfShellExecWithStderr( - "echo " . wfEscapeShellArg( "getMessage()}\n" . $__e->getTraceAsString() . "\n";