This is a followup to the issue #586466: Drush.php is no longer directly executable (can interfere with backend invoke). It's a different problem that affects both 2.1 and HEAD. It is because we assume that $_ is a PHP variable that means "the php executable". That is wrong: it's a bash-specific variable that is quite unreliable that generally means "the last command executed".
I suggest we completely drop the $_ parsing, I have started working on a patch to do just that. We should assume that in the general case, "php" is in the path and will just work (which means that we can invoke $argv0 directly, in most cases).
Comment | File | Size | Author |
---|---|---|---|
#7 | 637574_dash.patch | 5.68 KB | anarcat |
#5 | 637574_dash.patch | 5.92 KB | anarcat |
#4 | 637574_dash.patch | 5.3 KB | anarcat |
#1 | 637574_dash.patch | 5.3 KB | anarcat |
Comments
Comment #1
anarcat CreditAttribution: anarcat commentedHere's a patch that brings back --php to deal with particular cases. In general, we assume php is in the path and executable.
Comment #2
moshe weitzman CreditAttribution: moshe weitzman commentedI am getting an immediate error:
Fatal error: Call to undefined function drush_get_option() in /Users/mw/contributions/modules/drush/includes/environment.inc on line 953
Comment #3
anarcat CreditAttribution: anarcat commentedHum, you're right, the patch is missing a chunk where the include order is modified in drush.php. I'll send this in on monday, sorry!
Comment #4
anarcat CreditAttribution: anarcat commentedHere's a more adequate patch.
Comment #5
anarcat CreditAttribution: anarcat commentedGeez, I uploaded the exact same patch... Here's a proper one, *again*. Sorry for the trouble.
Comment #6
moshe weitzman CreditAttribution: moshe weitzman commenteddefine('DRUSH_COMMAND', drush_find_drush()) now appears twice in environment.inc. The one in global scope is not needed, right?
Comment #7
anarcat CreditAttribution: anarcat commentedsorry about this again, I think that was the original idea: that the bootstrap code initialise the variable, so we don't need to reorder the includes.
Here's a new patch, again. I can't believe I fail at providing a so simple thing. :)
Comment #8
moshe weitzman CreditAttribution: moshe weitzman commentedCommitted. Thanks much.
Comment #10
MacMladen CreditAttribution: MacMladen commentedIt is still not working, please look at this thred #662926: --php path argument required on Dreamhost and maybe unite threads as they talk about same thing. (I think).
Comment #11
anarcat CreditAttribution: anarcat commentedPlease do not reopen old issues especially when there's a new one that's been opened, unless the other one is marked as duplicate.
We have enough issues in the queue without reopening fixed ones. :P