It'd be cool to add some drush commands.

drush variable-get-info site_name
drush vgeti site_name

drush variable-get-value site_name
drush vgetv site_name

drush variable-get-default site_name
drush vgetd site_name

Comments

q0rban’s picture

q0rban’s picture

Status: Active » Needs review
StatusFileSize
new2.02 KB
q0rban’s picture

StatusFileSize
new3.03 KB

Whoops! Accidentally added the wrong file. Keep in mind, due to #1201824 above, I had to name this file variable_api.drush.inc. :/

jose reyero’s picture

Status: Needs review » Needs work

Nice!

It doesn't seem to work with that file name though. Do we have any other options? Maybe adding the commands to variable_admin module instead?

q0rban’s picture

Hmm, what version of drush are you using? It's working fine for me. Moving it to variable_admin may work though.

jose reyero’s picture

It kind of works with drush 4.5, though it doesn't return anything.

With drush 5.0 I get:

$ drush variable-get-info site_name
No hook functions were found for variable-get-info. The primary hook function is                   [error]
drush_variable_api_variable_get_info(). Please implement this function. Run with --show-invoke to
see all available hooks.

(I've got drush installed with PEAR)

jose reyero’s picture

Title: Drush commands » Drush commands for Variable / Variable Realms

Added Drush commands for variable realms (get, set, del)

bforchhammer’s picture

Nice, this should also help with/fix #1593540: Drush command for updating domain variables.

Hm, maybe variable realms could be turned into "command options" to allow drush commands of this format: drush variable-get site-slogan --domain=domain1 --language=en

bforchhammer’s picture

I had a quick go at my suggestion of turning realms into options... attached patch contains some initial work on this; I'm out of time for now, so this is only a partial patch. (Command execution does not work yet).

jose reyero’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)

This latter one looks more complex to me than passing realm as a parameter, or having a different function like 'variable_realm_list_all'...

Plus it seems no one is working on this anymore, feel free to reopen it anyway if you want to work on this.