When I run drush on my shared hosting account at 1and1, drush_verify_cli() always fails. I did some testing and noticed that php_sapi_name() is returning 'cgi', even when run from the command line.
I've instead tried testing the value of $_SERVER['argc'], which returns 0 when run in the browser and at least 1 when run from the command line.
Is this a safe way to test for whether or not drush is being run from the command line? (If so, I could add in the check against $_SERVER['argc'] if and only if php_sapi_name() comes back as 'cgi'.)
Let me know what you think.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | drush_cli_fix.patch | 596 bytes | steven merrill |
Comments
Comment #1
steven merrill commentedHere's my patch anyway. I would still like the community's feedback on if this is a safe approach for drush_verify_cli() on shared hosting that returns 'cgi' for php_sapi_name().
Thanks!
Comment #2
steven merrill commentedStatus change.
Comment #3
moshe weitzman commentedComment #4
moshe weitzman commentedI came across this on a web host and this fixed the the problem with no ill effects. committed. thanks.
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #6
adrian commentedThis isn't in the DRUPAL-6--1-0-RC2 release, perhaps we need a new rc ?
Comment #7
moshe weitzman commented6.x-1.0 is released and should have this.