New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use `dirname()` instead of `..` to locate `wp-config.php` to match Core behavior #4963

Merged
merged 2 commits into from Oct 30, 2018

Conversation

2 participants
@dgroddick
Copy link
Contributor

dgroddick commented Oct 4, 2018

fix for #4856 to add dirname when searching for wp-config inline with WordPress

@@ -234,7 +234,7 @@ function locate_wp_config() {
if ( file_exists( ABSPATH . 'wp-config.php' ) ) {
$path = ABSPATH . 'wp-config.php';
} elseif ( file_exists( ABSPATH . '../wp-config.php' ) && ! file_exists( ABSPATH . '/../wp-settings.php' ) ) {
} elseif ( file_exists( dirname( ABSPATH ) . '../wp-config.php' ) && ! file_exists( dirname( ABSPATH ) . '/../wp-settings.php' ) ) {

This comment has been minimized.

@schlessera

schlessera Oct 4, 2018

Member

dirname() replaces the .. subpath that traverses to the parent folder, so you need to remove this bit from wp-config.php file.

@schlessera schlessera changed the title add dirname to locate wp-config function to match WordPress Use `dirname()` instead of `..` to locate `wp-config.php` to match Core behavior Oct 4, 2018

@schlessera schlessera added this to the 2.1.0 milestone Oct 30, 2018

@schlessera schlessera merged commit eb681ee into wp-cli:master Oct 30, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment