A rebuild of the python wp-reconfigure but in bash so that I can more easily throw options/flags at it, etc.
- v1.0: a weeks' worth of testing without bugs
Quickly, easily reconfigure wp-config files. For moving wordpress sites.
License: MIT License
...although the new values are correct.
So going to have to handle those pipes. Perhaps other special characters as well.
Just what it says
Currently they are truncated and I add a 'prefix_' to where perhaps 'username' becomes 'prefix_usern' - but many times, usernames are similar enough elsewhere to make it so that if I handle several configurations, I wind up trying to assign the same single user to a bunch of databases. Changing it to make it do 'prefix_rname' instead.
Thinking perhaps about nixing the 'verbose' mode and changing it to 'debug' perhaps (different issue). Want to leave the main verbosity phrases set to display as default. Then create a 'quiet' mode so that with -q it just spits out ONLY the main line that I'm interested in.
In wp-config.php, there are some default values:
define('DB_NAME', 'database_name_here');
define('DB_USER', 'username_here');
define('DB_PASSWORD', 'password_here');
Instead of reusing them, if present, I'd like to make that trigger a random name/user/pass generation.
define('DB_HOST', 'sub.domain.com'); // 99% chance you won't need to change this value
Still thinking about it.
The idea would be to remove verbose mode then make a debug mode so in case something isn't behaving properly, it's easy to throw '-d' on the end of it to spit out extra stuff that doesn't necessarily have to do with the normal output. Variable values, etc.
Seems to break things. cPanel doesn't like that.
Database name OK.
Could remove them altogether or convert to underscores.
define('DB_NAME', 'asdf[bcd');
define('DB_USER', '[asdfb');
define('DB_PASSWORD', 'asfd]');
define('DB_HOST', 'asdf]asdf');
None of the above were replaced
Need to bump it to 6. Caused errors.
Just dealt with one where the old server allowed for a $ in the username but the new server did not. Want that taken care of.
If I run into a commented block, as of yet I've no idea whether lines within the block are commented or not.
Wanting to implement a check to grep for each of those items (DB_NAME, etc) and if the count for any of them is not 1, quit running the script with an error. That way I don't go creating bogus database names.
A test case revealed that leaving the wp_host empty caused problems. It mixed the order of the credentials that were then provided as db, user, pass.
Just wanting cleaner output overall, but pondering adjusting how the -v works. Maybe I'll do a -d for debug mode and move some of the -v to it. Have to review.
Don't display the hostname on the end of the output unless it's not 'localhost'
It was suggested to make my random string generation into a function, then call it when I need it. So as to avoid unnecessarily running it if I don't actually wind up using it.
Yeah... someone used hashes on commented db_host lines and it wound up breaking stuff.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.