-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(WPConfigFile) inherit env while parsing
This updates the `WPConfigFile` class, and the classes used by it, to inherit the environment variables and allow setups configuring the `wp-config.php` file based on those (e.g. `ddev`) to work correctly during setup.
- Loading branch information
Showing
10 changed files
with
139 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ extend-exclude = [ | |
".git/", | ||
"includes/", | ||
"vendor/", | ||
"tests/_data" | ||
] | ||
ignore-hidden = false | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
/** | ||
* #ddev-generated: Automatically generated WordPress settings file. | ||
* ddev manages this file and may delete or overwrite the file unless this comment is removed. | ||
* | ||
* @package ddevapp | ||
*/ | ||
|
||
if ( getenv( 'IS_DDEV_PROJECT' ) == 'true' ) { | ||
/** The name of the database for WordPress */ | ||
defined( 'DB_NAME' ) || define( 'DB_NAME', 'db' ); | ||
|
||
/** MySQL database username */ | ||
defined( 'DB_USER' ) || define( 'DB_USER', 'db' ); | ||
|
||
/** MySQL database password */ | ||
defined( 'DB_PASSWORD' ) || define( 'DB_PASSWORD', 'db' ); | ||
|
||
/** MySQL hostname */ | ||
defined( 'DB_HOST' ) || define( 'DB_HOST', 'ddev-ddev-project-db' ); | ||
|
||
/** WP_HOME URL */ | ||
defined( 'WP_HOME' ) || define( 'WP_HOME', 'https://ddev-project.ddev.site:33001' ); | ||
|
||
/** WP_SITEURL location */ | ||
defined( 'WP_SITEURL' ) || define( 'WP_SITEURL', WP_HOME . '/' ); | ||
|
||
/** Enable debug */ | ||
defined( 'WP_DEBUG' ) || define( 'WP_DEBUG', true ); | ||
|
||
/** | ||
* Set WordPress Database Table prefix if not already set. | ||
* | ||
* @global string $table_prefix | ||
*/ | ||
if ( ! isset( $table_prefix ) || empty( $table_prefix ) ) { | ||
// phpcs:disable WordPress.WP.GlobalVariablesOverride.Prohibited | ||
$table_prefix = 'wp_'; | ||
// phpcs:enable | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
/** | ||
* #ddev-generated: Automatically generated WordPress settings file. | ||
* ddev manages this file and may delete or overwrite the file unless this comment is removed. | ||
* It is recommended that you leave this file alone. | ||
* | ||
* @package ddevapp | ||
*/ | ||
|
||
/** Database charset to use in creating database tables. */ | ||
define( 'DB_CHARSET', 'utf8' ); | ||
|
||
/** The database collate type. Don't change this if in doubt. */ | ||
define( 'DB_COLLATE', '' ); | ||
|
||
/** Authentication Unique Keys and Salts. */ | ||
define( 'AUTH_KEY', 'tCGZUeKbIdopaFexrGoPqNNlLNsfaJPrHlXPBoPwhGZFvguTIpelFEFsNwCgyQWP' ); | ||
define( 'SECURE_AUTH_KEY', 'EdTQtDpfrFpzuwMOIFljwQcyusSTVPtqMfpGhBfKEAJwFxDmFaBdOKiNGPwJsDWA' ); | ||
define( 'LOGGED_IN_KEY', 'oWUgUNaIPqTZAeTAAyPALbLWwnRHFVSPYSJooRBpuRlphdjogVDIYLYRRqhwZXIm' ); | ||
define( 'NONCE_KEY', 'kHzVnpmLOgkzfNyESZslNHZNzxsatEAJVVnmxJqbKjnooSmdSoVJHzxcWxAxNUwA' ); | ||
define( 'AUTH_SALT', 'kGENEUGicWfvwDvjjMtncIOmLQAJztohoqSMRumqjlmhexnRLocvZCjfXGnftfTL' ); | ||
define( 'SECURE_AUTH_SALT', 'WLPqqvorXIIPCnPOBPLopTADMtDVGYpvJDSMHOvpgaIpTADVZYNNWakSKtiXhJKg' ); | ||
define( 'LOGGED_IN_SALT', 'KZTqsQCEnJMPaYMGHOkpSEBsjnMznCPdzKVxFCHWldfnlNSYpdRaWzXFsBxiTcsk' ); | ||
define( 'NONCE_SALT', 'jeBUcIcVAFQjsWbOpomcvjIBARyiEQWwHWSGDzUyLIBixJnHJPtZTdjNUkIgDFow' ); | ||
|
||
/* Add any custom values between this line and the "stop editing" line. */ | ||
|
||
|
||
|
||
/* That's all, stop editing! Happy publishing. */ | ||
|
||
/** Absolute path to the WordPress directory. */ | ||
defined( 'ABSPATH' ) || define( 'ABSPATH', dirname( __FILE__ ) . '/' ); | ||
|
||
// Include for settings managed by ddev. | ||
$ddev_settings = __DIR__ . '/wp-config-ddev.php'; | ||
if ( ! defined( 'DB_USER' ) && getenv( 'IS_DDEV_PROJECT' ) == 'true' && is_readable( $ddev_settings ) ) { | ||
require_once( $ddev_settings ); | ||
} | ||
|
||
/** Include wp-settings.php */ | ||
if ( file_exists( ABSPATH . '/wp-settings.php' ) ) { | ||
require_once ABSPATH . '/wp-settings.php'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?php | ||
// Nothing to see here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters