Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Enable variable-set #24

Closed
Wylbur opened this issue Dec 24, 2020 · 3 comments
Closed

Enable variable-set #24

Wylbur opened this issue Dec 24, 2020 · 3 comments

Comments

@Wylbur
Copy link

Wylbur commented Dec 24, 2020

I'm using brush to create some local development automation scripts, and would like to use it to set the stage_file_proxy locations:
fin brush variable-set stage_file_proxy_origin "http://www.example.com"

Is this easy to do?

Thanks for considering!

I am really liking brush as a drop-in replacement on my new Backdrop sites.

@klonos
Copy link
Member

klonos commented Dec 25, 2020

Hey @Wylbur 👋

variable_get() and variable_set() have been deprecated in Backdrop, in favor of CMI. See the following resources for more info:

You will need to use the config_get() and config_set() functions respectively instead.

For brush specifically, the relevant config-* commands seem to be:

  • brush config-list (brush clist for short)
  • brush config-get (brush cget for short)
  • brush config-set (brush cset for short)
  • brush config-clear (brush cdel for short)

See the config_brush_command() function for details: https://github.com/backdrop-contrib/brush/blob/1.x-1.x/commands/core/config.brush.inc#L9

PS: there seem to be aliases set for the "old" variable-* commands, but you should stop using those:

  • brush clist may also be brush vlist
  • brush cget may also be brush vget
  • brush cset may also be brush vset
  • brush cdel may also be brush vdel

For setting the stage_file_proxy_origin setting specifically, please try the following command (untested):

brush cset --yes stage_file_proxy.settings origin "http://www.example.com"

To find which settings file and which specific "variable" ("setting" now) to use for the command above, I've looked in the /config folder of the stage_file_proxy module, for its default .json config file. See: https://github.com/backdrop-contrib/stage_file_proxy/blob/1.x-1.x/config/stage_file_proxy.settings.json

Hope this helps 😉

@alanmels
Copy link
Member

Hi @Wylbur,

As Gregory @klonos explained there are some changes peculiar more to Backdrop CMS than to Brush. Otherwise, it is mostly the same tool as Drush for Drupal, so you can try commands Gregory has listed above. If anything you need is missing - we use Brush at AltaGrade on daily basis and - can quickly add new features or make necessary changes.

@alanmels
Copy link
Member

Please also read #2 (in the very end you'll find more detailed table of commands) and #12.

And since the requested commands have already been implemented, I will go ahead and mark this issue as closed. However, feel free to update this issue or create new ones if you have more questions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants