diff --git a/composer.json b/composer.json index 9e15cd796..d98358638 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ "wp-cli/site-health-command": "^1", "wp-cli/super-admin-command": "^2", "wp-cli/widget-command": "^2", - "wp-cli/wp-cli": "dev-main" + "wp-cli/wp-cli": "dev-copilot/fix-wp-config-not-file as 2.13.0" }, "require-dev": { "roave/security-advisories": "dev-latest", diff --git a/composer.lock b/composer.lock index f5d46998e..561dea965 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c2c06eaebfeb4c1884f044c795b98d19", + "content-hash": "cf347ae35fcca5cc06f9df9137a8ef01", "packages": [ { "name": "composer/semver", @@ -2668,16 +2668,16 @@ }, { "name": "wp-cli/wp-cli", - "version": "dev-main", + "version": "dev-copilot/fix-wp-config-not-file", "source": { "type": "git", "url": "https://github.com/wp-cli/wp-cli.git", - "reference": "4177cb58ca649407e390a264aa19577a4125fdfe" + "reference": "1cb029f93f9db640f4fe37b4416a272e749c214a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/wp-cli/zipball/4177cb58ca649407e390a264aa19577a4125fdfe", - "reference": "4177cb58ca649407e390a264aa19577a4125fdfe", + "url": "https://api.github.com/repos/wp-cli/wp-cli/zipball/1cb029f93f9db640f4fe37b4416a272e749c214a", + "reference": "1cb029f93f9db640f4fe37b4416a272e749c214a", "shasum": "" }, "require": { @@ -2700,7 +2700,6 @@ "ext-readline": "Include for a better --prompt implementation", "ext-zip": "Needed to support extraction of ZIP archives when doing downloads or updates" }, - "default-branch": true, "bin": [ "bin/wp", "bin/wp.bat" @@ -2748,7 +2747,7 @@ "issues": "https://github.com/wp-cli/wp-cli/issues", "source": "https://github.com/wp-cli/wp-cli" }, - "time": "2026-05-21T20:19:24+00:00" + "time": "2026-05-25T09:33:09+00:00" }, { "name": "wp-cli/wp-config-transformer", @@ -9794,7 +9793,14 @@ "time": "2025-02-09T18:58:54+00:00" } ], - "aliases": [], + "aliases": [ + { + "package": "wp-cli/wp-cli", + "version": "dev-copilot/fix-wp-config-not-file", + "alias": "2.13.0", + "alias_normalized": "2.13.0.0" + } + ], "minimum-stability": "dev", "stability-flags": { "roave/security-advisories": 20, diff --git a/features/bootstrap.feature b/features/bootstrap.feature index b2ef01e7a..8024e37b4 100644 --- a/features/bootstrap.feature +++ b/features/bootstrap.feature @@ -81,3 +81,17 @@ Feature: Bootstrap WP-CLI Status: Inactive """ And STDERR should be empty + + Scenario: Mustache templates should be resolved correctly when PHAR is renamed without extension + + Given an empty directory + And a new Phar with the same version + And I run `php {PHAR_PATH} core download` + + When I run `cp {PHAR_PATH} wp-renamed` + And I run `php wp-renamed config create --dbname=wordpress --dbuser=user --dbpass=pass --skip-check` + Then STDOUT should contain: + """ + Success: Generated 'wp-config.php' file. + """ + And STDERR should be empty diff --git a/php/boot-phar.php b/php/boot-phar.php index e5f94a262..64fb7e948 100644 --- a/php/boot-phar.php +++ b/php/boot-phar.php @@ -10,7 +10,7 @@ } // Store the path to the Phar early on for `Utils\phar-safe-path()` function. -define( 'WP_CLI_PHAR_PATH', Phar::running( true ) ); +define( 'WP_CLI_PHAR_PATH', Phar::running( false ) ); if ( file_exists( 'phar://wp-cli.phar/php/wp-cli.php' ) ) { define( 'WP_CLI_ROOT', 'phar://wp-cli.phar' );