I’m working on a project for users with WP installed domains.
I store data in the same DB that WP uses (just in different tables).
I cant use the include function to fetch the file and simply use the info from there because, according to a user from http://wordpress.stackexchange.com, the wp-config.php should never be included in a file after posting a question regarding issues I was encountering (only sometimes) when doing so (The Issues that encounter when including the file).
Now, I already have one option (because inculding the wp-config.php issues ONLY encounter sometimes):
The application I’m working on requires an installation to run (by the user). So, during that installation, I could just simply include the wp-config.php file ONCE, copy the info I need, and place it into my own file, and just use that for the rest of the application.
The issue with the solution above is, what if i encounter the issues during the installation? The user would have to try again and again until it works. = un-happy user.
Any ideas on alternatives I could use to acomplish this?
This blog post seems to have the answer you’re looking for, complete with code to do it. The author does as is suggested in the comments of the post you linked in your question.
Excerpt from the post:
UPDATE: As original blog post is unavailable here’s the original code:
Source: https://web.archive.org/web/20130410000149/www.markflint.net/parsing-wordpress-wp-config-php-file/