Skip to content

Commit 5ee2679

Browse files
committed
Don't require wp-config to be read-only for wp config has
1 parent 581bdbb commit 5ee2679

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

features/config-has.feature

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ Feature: Check whether the wp-config.php file or the wp-custom-config.php file h
1515
Then STDOUT should be empty
1616
And the return code should be 0
1717

18+
Scenario: Check for the existance of an existing wp-config.php constant in a read-only file system
19+
Given a WP install
20+
21+
When I run `chmod -w wp-config.php`
22+
And I try `wp config has DB_NAME`
23+
Then STDOUT should be empty
24+
And the return code should be 0
25+
1826
@custom-config-file
1927
Scenario: Check the existence of an existing wp-custom-config.php constant or variable
2028
Given an empty directory

src/Config_Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ public function has( $args, $assoc_args ) {
818818
$type = Utils\get_flag_value( $assoc_args, 'type' );
819819

820820
try {
821-
$config_transformer = new WPConfigTransformer( $path );
821+
$config_transformer = new WPConfigTransformer( $path, true );
822822

823823
switch ( $type ) {
824824
case 'all':

0 commit comments

Comments
 (0)