wp-cli-tests/utils
Alain Schlesser 83d3dc312a
Honor WP_CLI_PHP and WP_CLI_PHP_ARGS in the Debian and RPM packages
The Debian and RPM packages shipped the Phar directly as /usr/bin/wp, so it
launched through its `#!/usr/bin/env php` shebang and never consulted
WP_CLI_PHP or WP_CLI_PHP_ARGS. Those variables are only read by the bin/wp
shell wrapper, which is not part of a Phar install, so a packaged wp-cli has
never been able to select its PHP interpreter. Reported in wp-cli/wp-cli#5886.

Install the Phar to /usr/share/wp-cli/wp-cli.phar and ship a small POSIX-sh
launcher at /usr/bin/wp that selects the interpreter from WP_CLI_PHP (falling
back to the php on PATH), exports WP_CLI_PHP_USED, and passes WP_CLI_PHP_ARGS
through, mirroring the semantics of wp-cli's bin/wp. The launcher is generated
inline because the deployment workflow downloads the build scripts standalone.

`wp cli update` keeps working: it resolves the Phar via argv[0], so it rewrites
/usr/share/wp-cli/wp-cli.phar and leaves the launcher untouched.

Also replace the ls-only package verification steps with smoke tests that
assert the package layout and that the launcher actually honors WP_CLI_PHP.

Fixes #1078
2026-07-21 12:21:48 +02:00
..
amp-paths.txt Revert "Remove WP-CLI files unrelated to wp package *" 2017-03-10 12:57:05 -08:00
find-php Revert "Remove WP-CLI files unrelated to wp package *" 2017-03-10 12:57:05 -08:00
get-package-require-from-composer.php PHPStan fixes 2025-11-21 20:29:34 +01:00
make-phar-spec.php Update to WPCS v3 (#569) 2023-08-30 09:19:33 -07:00
make-phar.php Fix newly reported PHPStan error 2026-03-07 08:34:13 +01:00
test-phar-download Revert "Remove WP-CLI files unrelated to wp package *" 2017-03-10 12:57:05 -08:00
update-phar Revert "Support Phive package manager" 2018-02-01 10:30:33 +01:00
wp-cli-rpm.spec Honor WP_CLI_PHP and WP_CLI_PHP_ARGS in the Debian and RPM packages 2026-07-21 12:21:48 +02:00
wp-cli-updatedeb.sh Honor WP_CLI_PHP and WP_CLI_PHP_ARGS in the Debian and RPM packages 2026-07-21 12:21:48 +02:00
wp-cli-updaterpm.sh Honor WP_CLI_PHP and WP_CLI_PHP_ARGS in the Debian and RPM packages 2026-07-21 12:21:48 +02:00