Breaks Drush
smk-ka - October 2, 2009 - 16:11
| Project: | Global Redirect |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | reviewed & tested by the community |
Description
Much like the existing exception in hook_init(), globalredirect should not "process" a request when it is invoked from the command line via Drush (or even always when invoked from the command line), since redirecting simply terminates script execution. WIll try to come up with a solution to this issue.

#1
Patch. Note that php_get_sapi() is not reliable enough to determine whether or not PHP was executed from the command line. $_SERVER['SERVER_ADDR'], on the other hand, will always be set if executed by a webserver.
#2
Works well, thanks.
Same is true for the path_redirect Modul. See the issue there: #616772: hook_init() breaks drush
#3
I don't get why this applies to path_redirect as well. It should only redirect on certain conditions, whereas global_redirect in most cases is 'always' redirecting by design.