diff --git a/features/command.feature b/features/command.feature index 26242b4df..69ba35a03 100644 --- a/features/command.feature +++ b/features/command.feature @@ -1676,3 +1676,17 @@ Feature: WP-CLI Commands """ core custom-subcommand """ + + Scenario: Templates should still be found when WP CLI phar is renamed + Given a WP installation + And these installed and active plugins: + """ + akismet + """ + And a new Phar with the same version + + When I run `wp plugin status akismet` + Then STDOUT should contain: + """ + Plugin akismet details: + """ diff --git a/php/boot-phar.php b/php/boot-phar.php index 406402e97..6bcf30091 100644 --- a/php/boot-phar.php +++ b/php/boot-phar.php @@ -11,6 +11,7 @@ // Store the path to the Phar early on for `Utils\phar-safe-path()` function. define( 'WP_CLI_PHAR_PATH', getcwd() ); +define( 'WP_CLI_PHAR_HOST_FILENAME', basename( dirname( __DIR__ ) ) ); if ( file_exists( 'phar://wp-cli.phar/php/wp-cli.php' ) ) { define( 'WP_CLI_ROOT', 'phar://wp-cli.phar' );