PHP_BINDIR to allow composer.phar to work in more situations

This commit is contained in:
Tony Murray
2020-06-21 15:06:07 -05:00
parent 685d1972f1
commit 258d693477

View File

@@ -55,7 +55,7 @@ if (php_sapi_name() == 'cli' && isset($_SERVER['TERM'])) {
}
if (is_file($install_dir . '/composer.phar')) {
$exec = 'php ' . $install_dir . '/composer.phar';
$exec = PHP_BINDIR . '/php ' . $install_dir . '/composer.phar';
// self-update
passthru("$exec self-update -q" . $extra_args);
@@ -77,8 +77,8 @@ if (is_file($install_dir . '/composer.phar')) {
echo "Error: Failed to download $installer_url\n";
} elseif (@hash_file('SHA384', $dest) === $good_sha) {
// Installer verified
shell_exec("php $dest");
$exec = "php $install_dir/composer.phar";
shell_exec(PHP_BINDIR . "/php $dest");
$exec = PHP_BINDIR . "/php $install_dir/composer.phar";
} else {
echo "Error: Corrupted download, signature doesn't match for $installer_url\n";
}