Merge branch '2.2' into main

main
Jordi Boggiano 2 years ago
commit 0be1e5a279
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

@ -39,7 +39,7 @@ requirements:
The required version of the `composer-plugin-api` follows the same [rules][7]
as a normal package's rules.
The current Composer plugin API version is `2.1.0`.
The current Composer plugin API version is `2.2.0`.
An example of a valid plugin `composer.json` file (with the autoloading
part omitted and an optional require-dev dependency on `composer/composer` for IDE auto completion):

@ -158,6 +158,10 @@ class BinaryInstaller
return trim($match[1]);
}
if (substr($bin, -4) === '.jar') {
return 'java -jar ';
}
return 'php';
}
@ -224,7 +228,7 @@ class BinaryInstaller
$binPath = $this->filesystem->findShortestPath($link, $bin);
$caller = self::determineBinaryCaller($bin);
// if the target is a php file, we run the unixy proxy file
// if the target is a php file, we run the unixy proxy file (a php script in this case)
// to ensure that _composer_autoload_path gets defined, instead
// of running the binary directly
if ($caller === 'php') {
@ -394,6 +398,11 @@ include $binPathExported;
PROXY;
}
$caller = '';
if (substr($bin, -4) === '.jar') {
$caller = 'java -jar ';
}
return <<<PROXY
#!/usr/bin/env sh
@ -415,7 +424,7 @@ fi
export COMPOSER_BIN_DIR=\$(cd "\${self%[/\\\\]*}" > /dev/null; pwd)
"\${dir}/$binFile" "\$@"
$caller"\${dir}/$binFile" "\$@"
PROXY;
}

Loading…
Cancel
Save