WordPress.org

Make WordPress Core

Opened 2 years ago

#41783 new enhancement

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

Reported by: drzraf Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.8.1
Component: Bootstrap/Load Keywords:
Focuses: Cc:
PR Number:

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 (0)

Note: See TracTickets for help on using tickets.