jenkins-bot has submitted this change and it was merged.
Change subject: Revert "Make eval.php try to handle newlines in code"
......................................................................
Revert "Make eval.php try to handle newlines in code"
Completely broke the script for me.
<TimStarling> MaxSem: that was a pretty crazy change
<TimStarling> fancy trying to detect the end of a statement by shelling out to
detect parse errors
<TimStarling> maybe just revert that?
<TimStarling> we can probably do a better job with a few regexes
<TimStarling> I wonder how php -a does it
This reverts commit f0ae292da7ef0673b30c68b4a6f3789b2eea8464.
Change-Id: I16c9c200dc3f4db55cecc23aaa0d9ff55504c19d
---
M maintenance/eval.php
1 file changed, 1 insertion(+), 16 deletions(-)
Approvals:
Tim Starling: Looks good to me, approved
jenkins-bot: Verified
diff --git a/maintenance/eval.php b/maintenance/eval.php
index 3f10a33..e20c477 100644
--- a/maintenance/eval.php
+++ b/maintenance/eval.php
@@ -60,11 +60,6 @@
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 @@
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(
"<?php\n{$__multiLine}{$__line}" ) . " | php -l" );
- if ( strpos( $res, 'No syntax errors' ) !== 0 && substr(
$__multiLine, -2 ) !== "\n\n" ) {
- $__multiLine .= "$__line\n";
- continue;
- }
- }
try {
- $__val = eval( $__multiLine . $__line . ";" );
- $__multiLine = '';
+ $__val = eval( $__line . ";" );
} catch ( Exception $__e ) {
echo "Caught exception " . get_class( $__e ) .
": {$__e->getMessage()}\n" . $__e->getTraceAsString() .
"\n";
--
To view, visit https://gerrit.wikimedia.org/r/191486
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I16c9c200dc3f4db55cecc23aaa0d9ff55504c19d
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: Tim Starling <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits