Make WordPress Core

Opened 7 years ago

Closed 6 days ago

#41783 closed enhancement (wontfix)

allow loading wp-config.php (values) without DB bootstrap

Reported by: drzraf's profile drzraf Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.8.1
Component: Bootstrap/Load Keywords:
Focuses: Cc:

Description

Directly related issue: wp-cli plugin download command

wp-config.php is a fundamental and unique source of information about the WP instance. It contains information about database, but some others about languages/paths/...

In some case we may want to provide preprovisionned WP instance but also about the to-be-instanciated installation: filesystem/plugin/themes/... to be provided in the filesystem *before* WP got installed).
This may be the case when a team share a common WP filesystem image / Docker image / ...

External tool (ex wp-cli) may benefit from loading not only the WP-core helpers (like, eg, plugins_api()), but also to know about some constants inside wp-config.php although DB is not yet available.

An issue is that currently, loading wp-config.php forcefully attempt a DB connexion. This happens via the unconditional call to wp_set_wpdb_vars() inside wp-settings.php

We rather should provide a mechanism to optionally disable such a behaviour.
There already exist a SHORTINIT define. Could we introduce another one that may allow to load wp-config.php in a database-less environment?

Indirectly related: WP_* configuration constants from the environment

Change History (2)

#1 @jorbin
4 weeks ago

  • Keywords close added

Sorry that it has taken 7 years for an initial response. That said, I think this is a wontfix for two main reasons:

1) As site information about WordPress is stored in the DB including which plugins to load, plugins which can and do further modify the site information, I don't think there is a reliable way to provide information about where plugins can be installed with the DB. As pointed out on the linked wp-cli issue, this is something that can already be done with tools like wget and curl

2) Modifying every sites wp-config.php isn't something that can happen as the file isn't always modifiable. This means making it a standalone file isn't something that can happen across every site.

#2 @desrosj
6 days ago

  • Keywords close removed
  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Thanks for this suggestion @drzraf!

I do tend to agree with @jorbin's assessment above, so I'm going to close this out.

Discussion can always continue on closed tickets, and they can be reopened in the future should conditions change.

Note: See TracTickets for help on using tickets.