I'd like to read the database settings in wp-config.php
. However, if I do a require("wp-config.php");
it loads up the entire WordPress environment.
Is there any way to avoid this?
Actually you can read all the constants defined in wp-config.php from any place you want. If you have something like this in your wp-config.php
define('DB_NAME', 'some_value');
You can do this for example in your functions.php file
echo DB_NAME;
Constants are globally accessible from everywhere.
So please think about this approach.