Fix phar path resolution

This commit is contained in:
Alain Schlesser 2025-05-06 12:03:03 +02:00
parent 806b93e49b
commit 11cc23fbbb
No known key found for this signature in database
GPG key ID: 93B8E2CCB82BF816

View file

@ -10,7 +10,7 @@ if ( 'cli' !== PHP_SAPI ) {
}

// Store the path to the Phar early on for `Utils\phar-safe-path()` function.
define( 'WP_CLI_PHAR_PATH', getcwd() );
define( 'WP_CLI_PHAR_PATH', Phar::running( true ) );

if ( file_exists( 'phar://wp-cli.phar/php/wp-cli.php' ) ) {
define( 'WP_CLI_ROOT', 'phar://wp-cli.phar' );