Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle multisites and site aliases #68

Merged
merged 80 commits into from
Apr 20, 2016

Conversation

joddie
Copy link
Contributor

@joddie joddie commented Oct 4, 2015

This pull request is based on the work in #18 to make drush commands support site aliases. It also allows drupal-mode to work better with multisite installations. (I dislike multisite setups, but sometimes have to deal with them…)

It adds a concept of the "current site", which can be specified either using a site alias or a parameter to --uri. It also refactors all Drush calls so that they go through a standard interface which respects these parameters.

The "current site" setting is common to all buffers within the same project. It should be detected automatically, and can be changed using a command (M-x drupal-set-site) or via the menubar.

This has received only light testing, but it seems to work, so I wanted to open a PR to allow others to potentially test and review it. (Also happy to add more ERT tests, etc.)

arnested and others added 30 commits February 21, 2014 21:56
Properly chain into the checker chain for js/css modes. Also check info
files. Closes arnested#41.
Add menu items for function & hook templates
Add interface with gtags via `ggtags.el'
No need to call `cd-absolute`. It's probably better to supply the
DRUPAL_ROOT as a parameter to drush.
Added the DRUPAL_ROOT as parameter to the drush command.
Evaluate active region with `drush php-eval`.

Idea from @kostajh. Closes arnested#46.
drupal-detect-drupal-version: Allow tabs in .info
Minor glitch in on of the improved regexps from arnested#50.
When inserting a hook_update_N() with `drupal-insert-hook` an we will
suggest an ID the hook implementation based on previous update hooks and
Drupal and module major versions.
The Drupalize.Me API site is retired.

See https://drupalize.me/api-site.
arnested and others added 28 commits July 3, 2015 11:33
With eldoc enabled, this function could move point unexpectedly to the
end of line when point was on the *definition* of anything listed in the
TAGS file.  (This is due to the `find-tag-noselect`, which can return the
already-open buffer for a given tag's file, if one exists).

Adding a `save-excursion` around the `with-current-buffer` fixes this bug.
The hook implementation skeleton funcalls `drupal-get-function-args` to
check whether the new function implementation already exists elsewhere
in the project.  When the value of this variable is
`drupal/etags-get-function-args`, it throws an error for non-existent
function names, making it impossible to insert a new implementation.
Adding `ignore-errors` around the call fixes this.
Avoid "no tags containing" error in hook skeleton
Add `drupal-drush-sql-cli` command
…tibility

Also load gtags.el with helm-gtags.
It is slow and requires another version of makeinfo.
- New variable: `drupal-drush-site-url`, allows specifying a site to
  work on within a multisite configuration

- New command: `drupal-set-site` allows interactively changing the site
  or site alias to work on

- New function: `drupal-call-drush-process` abstracts calling drush with
  the correct options, including site alias or URI if set

- New function: `drupal-drush-command-to-string` runs a drush command
  and return its output as a string
Additionally, make both automatically buffer-local, like
drupal-{project,version}, etc.
- New function `drupal-dir-site-aliases` returns a list of site aliases
  matching a given directory

- Use the new function in `drupal-set-site` to offer only aliases that
  match the current context as choices
Without this fix, the dynamic mode-line indicator from commit 4188199 is
displayed in two separate pieces, and raises an error on being
clicked (`Cannot find minor mode ...`).  Using `concat` in the mode-line
expression restores the expected clickable behavior.
@arnested
Copy link
Owner

arnested commented Oct 4, 2015

This looks very impressive, @joddie! I'll try it out the next couple of days and provide some feedback!

@arnested arnested merged commit 685790c into arnested:feature/site-alias Apr 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants