Closed (won't fix)
Project:
Drush
Version:
8.x-6.x-dev
Component:
PM (dl, en, up ...)
Priority:
Minor
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
11 Oct 2012 at 16:55 UTC
Updated:
11 Sep 2013 at 11:32 UTC
Certain Drush commands clear caches automatically, particularly project management - en, dis, etc.
I'd like to control that behaviour, per command, e.g.:
drush pm-disable --no-cc toolbar
drush pm-enable admin_menu quickbar admin_select
where the flag --no-cc means "don't clear caches after running this command". So caches would only be cleared after the second command, not the first (thus saving a number of seconds on large sites). You could even use --no-cc on all your commands and run a more selective drush cc registry; drush cc menu (for example) at the end. Obviously the user would have to be aware of the consequences.
I'm happy to start writing patches, but first I wonder if anyone else has thoughts on this?
Comments
Comment #1
moshe weitzman commentedFYI, you can pass in multiple modules to pm-disable and all the rest. When you do that, you only clear cache once. In general, I am not inclined to complicate things like this, but I'd look at a patch if one appears here.
Comment #2
pjcdawkins commentedYes, although you can't disable modules and enable others in one command [edit: I mean, with only one cache clear]. Clearing caches all the time makes me impatient, so I will get a patch out. As for complexity, the defaults wouldn't change, and we already have optional flags like --resolve-dependencies and --skip. Perhaps, for pm-enable, the flags should be --skip-libraries and -skip-cache-clear, or --skip-lib and --skip-cc if you prefer.
Comment #3
jonhattanThere're other expensive operations that need to be done in addition to cache clearing whenever any of both commands is invoked.
As the use case isn't other than enabling and disabling modules at once as in admin/modules, I'd prefer to mimic apt-get, ie:
apt-get install foo bar- baz+foo and baz are to be installed and bar to be removed.
apt-get remove foo bar+ baz-foo and baz are to be removed and bar to be installed.
It needs a code refactoring and some tests but the code complexity doesn't seem to be much more than now (it will be similar to system_modules_submit()), and drush could go a step forward.
Comment #4
moshe weitzman commentedSeems exotic to me but if the code complexity is minimal then sure.
Comment #5
greg.1.anderson commentedThis issue was marked
closed (won't fix)because Drush has moved to Github.If this feature is still desired, you may copy it to our Github project. For best results, create a Pull Request that has been updated for the master branch. Post a link here to the PR, and please also change the status of this issue to
closed (duplicate).Please ask support questions on Drupal Answers.