Set $_SERVER['SCRIPT_NAME'] within proxy command (#11562)
parent
f4738d97b7
commit
9c25633d6d
|
@ -359,6 +359,11 @@ namespace Composer;
|
||||||
|
|
||||||
$globalsCode
|
$globalsCode
|
||||||
$streamProxyCode
|
$streamProxyCode
|
||||||
|
|
||||||
|
if (__FILE__ === realpath(\$_SERVER['SCRIPT_NAME'])) {
|
||||||
|
\$_SERVER['SCRIPT_NAME'] = realpath($binPathExported);
|
||||||
|
}
|
||||||
|
|
||||||
return include $binPathExported;
|
return include $binPathExported;
|
||||||
|
|
||||||
PROXY;
|
PROXY;
|
||||||
|
|
|
@ -110,6 +110,18 @@ EOL
|
||||||
<?php declare(strict_types=1);
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
echo 'success '.$_SERVER['argv'][1];
|
echo 'success '.$_SERVER['argv'][1];
|
||||||
|
EOL
|
||||||
|
],
|
||||||
|
'php file which validates $_SERVER["SCRIPT_NAME"]' => [<<<'EOL'
|
||||||
|
<?php
|
||||||
|
if (__FILE__ === realpath($_SERVER['SCRIPT_NAME'])) {
|
||||||
|
echo 'success '.$_SERVER['argv'][1];
|
||||||
|
} else {
|
||||||
|
fwrite(STDERR, "Test failure: __FILE__ does not match \$_SERVER['SCRIPT_NAME']\n");
|
||||||
|
fwrite(STDERR, "\t__FILE__:\t" . __FILE__ . "\n");
|
||||||
|
fwrite(STDERR, "\t\$_SERVER['SCRIPT_NAME']:\t" . $_SERVER['SCRIPT_NAME'] . "\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
EOL
|
EOL
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue