Last active
March 14, 2019 16:53
-
-
Save mttjohnson/18aff7d54c3b1cfbeb44e927029bbd6e to your computer and use it in GitHub Desktop.
comment/disable or uncomment/enable lines in magento env.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Comment out all load_from_slave entries in env.php | |
PERL_COMMANDS=$(cat <<'PERL_HEREDOC' | |
s/^(\s*)(?='load_from_slave')(.*)$/$1#$2/;print | |
PERL_HEREDOC | |
) | |
ENV_PHP=$(cat app/etc/env.php | perl -nle ${PERL_COMMANDS}) | |
echo "${ENV_PHP}" > app/etc/env.php | |
# Uncomment all load_from_slave entries in env.php | |
PERL_COMMANDS=$(cat <<'PERL_HEREDOC' | |
s/^(\s*)(#)(\s*)(?='load_from_slave')(.*)$/$1$3$4/;print | |
PERL_HEREDOC | |
) | |
ENV_PHP=$(cat app/etc/env.php | perl -nle ${PERL_COMMANDS}) | |
echo "${ENV_PHP}" > app/etc/env.php |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment