mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Simplify php bin proxies further
This commit is contained in:
parent
e1dbd65aff
commit
df6c2ce1db
1 changed files with 2 additions and 14 deletions
|
@ -277,25 +277,13 @@ class BinaryInstaller
|
|||
* @generated
|
||||
*/
|
||||
|
||||
\$binPath = realpath(__DIR__ . "/" . $binPathExported);
|
||||
|
||||
if (PHP_VERSION_ID >= 80000) {
|
||||
include \$binPath;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
\$contents = file_get_contents(\$binPath);
|
||||
\$contents = preg_replace('{^#!/.+\\r?\\n<\\?(php)?}', '', \$contents, 1, \$replaced);
|
||||
if (\$replaced) {
|
||||
if (PHP_VERSION_ID < 80000) {
|
||||
ob_start(function (\$buffer, \$phase) {
|
||||
return (PHP_OUTPUT_HANDLER_START & \$phase) && '#!' === substr(\$buffer, 0, 2) ? '' : \$buffer;
|
||||
}, 1);
|
||||
|
||||
include \$binPath;
|
||||
exit(0);
|
||||
}
|
||||
include \$binPath;
|
||||
|
||||
include __DIR__ . "/" . $binPathExported;
|
||||
PROXY;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue