Posted by cgmonroe on June 15, 2010 at 12:15am
5 followers
Jump to:
| Project: | Drush |
| Version: | All-versions-3.0 |
| Component: | Documentation |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I have a module similar to require_login that causes drush to fail. E.g., the cookies/header can't be written errors occur.
I've tried the tricks listed for the securepages module, but that seems to only change a variable setting and does not really disable the module.
Is there a way to tell Drush to not include a specific module in it's bootstrap process without changing the website/db settings? E.g., ignore login requirement for command line items but still enforce it on the website?
Seems like there should be a way to do this in the drupalrc but I can't find any docs/examples.
TIA
Comments
#1
not possible yet in core drupal. help welcome at #625444: Override enabled module/theme list dynamically using variable override in settings.php
#2
Thanks. I had a suspicion that might be the case.
Just in case anyone else needs a work around. Here's what I did:
I found that the culprit in my mod was a drupal_goto call. So I added a bit of code at the top of the hook using this that looked like:
if ( ! variable_get("my_module_enabled", TRUE)) { // Ignore user security check for drushreturn;
}
Then I created a drupalrc.ini in my sites/default directory that had the lines:
$override = array('my_module_enabled' => FALSE, // Disabling security check for drush.
);
Now drush runs and the site's still secure. Well.. not if someone can set this variable via the web... but if they can do that my security's compromised anyway....
#3
Automatically closed -- issue fixed for 2 weeks with no activity.
#4
For securepages/drush compatibility, see also #599948: conflict with drush (headers already sent).
#5
It might be better to check for drush via
function_exists('drush_main'); then you would not need the override.