Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit constants and variables defined in wp-config.php #4

Closed
danielbachhuber opened this issue Jan 3, 2017 · 4 comments
Closed

Edit constants and variables defined in wp-config.php #4

danielbachhuber opened this issue Jan 3, 2017 · 4 comments

Comments

@danielbachhuber
Copy link
Member

Editing a wp-config.php file programmatically is imprecise and error-prone, when it ideally would be as easy as running a WP-CLI command.

Borek Bernard has some suggestions for how to implement: wp-cli/wp-cli#2501

@phlbnks
Copy link

phlbnks commented Jun 9, 2017

Started work on a command to do this. Very much a work in progress but initial functionality works well enough for some testing and input if anyones interested: https://github.com/emirpprime/config-update-command
There are various known problems [BUG] and missing features [TODO] commented in the code.

My starting point was to mimic config variables for familiarity / user expectations rather than introduce new behaviours.

@danielbachhuber
Copy link
Member Author

Started work on a command to do this.

Neat!

For programmatically editing a wp-config.php file, I was thinking about creating a new library to serve as an interface for editing the file. This would let us eventually write hundreds of tests for every possible combination of wp-config.php (and others could use it in other systems). Something you'd want to help hack on in a few weeks?

@phlbnks
Copy link

phlbnks commented Jun 9, 2017

Yes happy to chip in - sounds like it might be a bit above my ability to do the heavy lifting but I'll do what I can!

@danielbachhuber
Copy link
Member Author

This was implemented with wp-cli/config-command#44

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

No branches or pull requests

2 participants