Skip to content

Instantly share code, notes, and snippets.

@sjb9774
Created May 22, 2020 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sjb9774/4f8aecdcbc9a4908fa2c9cd1b5f88033 to your computer and use it in GitHub Desktop.
Save sjb9774/4f8aecdcbc9a4908fa2c9cd1b5f88033 to your computer and use it in GitHub Desktop.
# add to ~/.bashrc and run . ~/.bashrc or open a new terminal window
function m2config () {
ssh -C $1 'php -d include_path='\''/var/www/stage/current:/var/www/html/current:/var/www/prod/current'\'' -r '\''$c = include "app/etc/env.php"; echo json_encode($c);'\''' | jq -r .$2
}
# usage
m2config www-stage@stage.mysite.com db.connection.default.username # returns db username from env.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment