+WP-CLI uses a [custom version](https://github.com/wp-cli/wp-cli/blob/master/php/wp-settings-cli.php) of WordPress's `wp-settings.php` file. Before WP-CLI can load `wp-settings-cli.php`, it needs to know all of the constants defined in `wp-config.php` (database connection details and so on). Because WP-CLI doesn't want WordPress to load yet when it's [pulling the constants](https://github.com/wp-cli/wp-cli/blob/master/php/wp-cli.php#L22) out of `wp-config.php`, [it uses regex](https://github.com/wp-cli/wp-cli/blob/master/php/WP_CLI/Runner.php#L324) to strip the `require_once(ABSPATH . 'wp-settings.php');` statement.
0 commit comments