Closed (outdated)
Project:
Domain
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 Nov 2011 at 13:23 UTC
Updated:
2 May 2025 at 12:18 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
kasperg commentedAnd here's the patch.
Comment #2
kasperg commentedOops. #1 had paths relative to the Drupal root. This one should apply.
Comment #3
agentrickardAwesome. Check for typos in the comments though. I saw at least one.
Comment #4
kasperg commentedHere's a updated patch.
Changes:
- Typos should be fixed
- Renamed command to domain-cache-clear for consistecy
- Switched to interactive shell to let the user respond to prompts (e.g. missing type)
- Escaped arguments passed from domain-cache-clear to cache-clear to support "theme registry"
Comment #5
kasperg commentedLast minute consistency caused domain-cache-clear callback to override cache-clear resulting in cache clearing loops :).
Here's another patch.
Comment #6
agentrickardI thought about this a little more. This is only useful if you are using different cache tables per domain, correct?
Comment #7
kasperg commentedCorrect.
Comment #8
agentrickardThen it should be a drush command for domain_prefix.
Comment #9
kasperg commentedNoted.
As domain_prefix is not limited to cache tables I thought it might be useful to support executing any drush command across all domains á la
drush domain-prefix-command cc allThe change to the current patch enabling this should be straightforward.
Comment #10
agentrickardAbstracting that to
drush domain-command FOOis very desirable. If it works reliably.Comment #11
kasperg commentedIt should work just as well as clear cache. All options passed to the overall command are passed along to the individual domains and prompts etc. for the individual domains are handled through interactive mode.
For clarification what would you prefer:
- Regarding drush command:
domain-commandordomain-prefix-command?- Regarding module placement: domain or domain_prefix?
Comment #12
kasperg commentedHere's a new patch which implements
drush domain-command. Better late than never.It supports clearing cache through
drush domain-command cc all.Comment #13
agentrickard6.x is closed to new features. This has to go in 7.x.3.
I suppose the only real use-case for this is alternate caching (such as Views provides) and table prefixing. In general I don't see much utility here.
Comment #14
helmo commentedHere's a re-roll of #12 for 7.x-3.x with a few comment style improvements.
@agentrickard: Or is there an easier way to clear the cache tables of all domains?
Comment #15
interdruper commentedPatch #14 for 7.x-3.x works fine for me.
In some installations, the used drush_shell_exec_interactive() command may issue this error:
A workaround may consist in giving exec permission to that file:
Comment #16
agentrickardIs there any way to avoid that error other than file permissions?
Comment #17
gabrielu commentedFor me is fine to give Execute rights for Drush.
I just have one small improvement to add, only run it for Active domains. Please see the attached.
Comment #18
Andreas Radloff commentedI had this problem in a shared environment. To avoid the permissions error caused by drush_shell_exec_interactive() you can write a custom Drush command in a modulename.drush.inc and use drush_invoke_process instead.
Dion't forget the info hook:
Comment #19
bluegeek9 commentedDrupal 7 in End of Life and no longer supported. We encourage you to upgrade to a supported version of Drupal. For more information, see https://www.drupal.org/upgrade.