Merge branch '2.5'
commit
54808d9bde
|
@ -339,7 +339,8 @@ class Application extends BaseApplication
|
|||
|
||||
// Check system temp folder for usability as it can cause weird runtime issues otherwise
|
||||
Silencer::call(static function () use ($io): void {
|
||||
$tempfile = sys_get_temp_dir() . '/temp-' . getmypid() . '-' . md5(microtime());
|
||||
$pid = function_exists('getmypid') ? getmypid() . '-' : '';
|
||||
$tempfile = sys_get_temp_dir() . '/temp-' . $pid . md5(microtime());
|
||||
if (!(file_put_contents($tempfile, __FILE__) && (file_get_contents($tempfile) === __FILE__) && unlink($tempfile) && !file_exists($tempfile))) {
|
||||
$io->writeError(sprintf('<error>PHP temp directory (%s) does not exist or is not writable to Composer. Set sys_temp_dir in your php.ini</error>', sys_get_temp_dir()));
|
||||
}
|
||||
|
|
|
@ -337,8 +337,7 @@ if (PHP_VERSION_ID < 80000) {
|
|||
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
|
||||
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
|
||||
) {
|
||||
include("phpvfscomposer://" . $binPathExported);
|
||||
exit(0);
|
||||
return include("phpvfscomposer://" . $binPathExported);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -360,7 +359,7 @@ namespace Composer;
|
|||
|
||||
$globalsCode
|
||||
$streamProxyCode
|
||||
include $binPathExported;
|
||||
return include $binPathExported;
|
||||
|
||||
PROXY;
|
||||
}
|
||||
|
|
|
@ -264,7 +264,7 @@ class PluginManager
|
|||
if ($separatorPos) {
|
||||
$className = substr($class, $separatorPos + 1);
|
||||
}
|
||||
$code = Preg::replace('{^((?:final\s+)?(?:\s*))class\s+('.preg_quote($className).')}mi', '$1class $2_composer_tmp'.self::$classCounter, $code, 1);
|
||||
$code = Preg::replace('{^((?:(?:final|readonly)\s+)*(?:\s*))class\s+('.preg_quote($className).')}mi', '$1class $2_composer_tmp'.self::$classCounter, $code, 1);
|
||||
$code = strtr($code, [
|
||||
'__FILE__' => var_export($path, true),
|
||||
'__DIR__' => var_export(dirname($path), true),
|
||||
|
|
Loading…
Reference in New Issue