Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions php/WP_CLI/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,15 @@ public function is_command_disabled( $command ) {
/**
* Returns wp-config.php code, skipping the loading of wp-settings.php
*
* @param string $wp_config_file_path Optional. Config file path. If left empty, it tries to
* locate the wp-config.php file automatically.
*
* @return string
*/
public function get_wp_config_code() {
$wp_config_path = Utils\locate_wp_config();
public function get_wp_config_code( $wp_config_path = '' ) {
if ( empty( $wp_config_path ) ) {
$wp_config_path = Utils\locate_wp_config();
}

$wp_config_code = explode( "\n", file_get_contents( $wp_config_path ) );

Expand Down