[wp-trac] [WordPress Trac] #9444: Allow to read wp-config.php without loading WP

WordPress Trac noreply at wordpress.org
Sun Feb 15 02:14:07 UTC 2015


#9444: Allow to read wp-config.php without loading WP
--------------------------------------------------+----------------------
 Reporter:  hakre                                 |       Owner:
     Type:  defect (bug)                          |      Status:  closed
 Priority:  normal                                |   Milestone:
Component:  General                               |     Version:  2.7.1
 Severity:  normal                                |  Resolution:  wontfix
 Keywords:  has-patch tested commit dev-feedback  |     Focuses:
--------------------------------------------------+----------------------
Changes (by jeremyfelt):

 * status:  reopened => closed
 * resolution:   => wontfix
 * severity:  major => normal


Comment:

 Hi @rpayne7264, I think
 [https://core.trac.wordpress.org/ticket/9444#comment:19 Westi's comment]
 from above still sums this up well:

  As Ryan wrote lots of plugins rely on wp-config.php pulling in WordPress
 as do external integrations.
  If you want to create something that just contains the config data for
 use is an external codebase then just dump your config in a seperate php
 file which gets included by wp-config.php and just include that from your
 external app.

 A common approach for local/staging/production environments is to use `wp-
 config.php` to include a `local-config.php` or other file. The same can be
 done with a `wp-db-config.php` file that could be read by your other
 application when DB access is needed. Another option would be for `wp-
 config.php` to bail early if a specific environment was detected.

 The history of `wp-config.php` is so great, it would be hard to justify a
 refactor of how it is loaded. Even then, we would then be supporting
 multiple methods to maintain backward compatibility.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/9444#comment:23>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list