Skip to content
This repository has been archived by the owner on Jun 28, 2019. It is now read-only.

Update wp-config.php during subsequent provisioning #12

Open
montchr opened this issue Feb 21, 2019 · 0 comments
Open

Update wp-config.php during subsequent provisioning #12

montchr opened this issue Feb 21, 2019 · 0 comments

Comments

@montchr
Copy link
Contributor

montchr commented Feb 21, 2019

Current Behavior

As of #11 /var/www/spiritedmedia.dev/wp-config.php will only be modified upon initial provisioning, i.e. when the install script is run for the first time and the box is created.

Upon subsequent runs of vagrant provision/vagrant up --provision, Nginx and PHP configs will be copied from synced folders to their respective locations on the box, but wp-config.php will remain untouched. That means that any necessary updates to wp-config.php will need to occur on the box directly and in config/wp-config-additions.txt.

This is because of the complexity of modifying an existing file, where we insert the contents of config/wp-config-additions.txt into a specific location within the existing wp-config.php during initial provision.

Expected Behavior

Customizations to wp-config.php should be wiped and the contents of wp-config-additions.txt should be inserted into that file again so that we can easily add important configuration changes to the additions file and run vagrant provision to bring them into effect.

A possible approach could be creating a backup of wp-config-additions.txt alongside wp-config.php, searching wp-config.php for the contents of that backup, deleting those lines, and inserting the contents of the current version of wp-config-additions.txt from the config/ synced folder.

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

1 participant