1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-11 01:22:54 +00:00

Add handling for phar

This commit is contained in:
Jordi Boggiano 2012-04-01 20:59:50 +02:00
parent 3210da0b84
commit 26b3a1711f
2 changed files with 11 additions and 1 deletions

View file

@ -128,8 +128,17 @@ class ConsoleIO implements IOInterface
{
// handle windows
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
$exe = __DIR__.'\\hiddeninput.exe';
// handle code running from a phar
if ('phar:' === substr(__FILE__, 0, 5)) {
$tmpExe = sys_get_temp_dir().'/hiddeninput.exe';
copy($exe, $tmpExe);
$exe = $tmpExe;
}
$this->write($question, false);
$value = rtrim(shell_exec(__DIR__.'\\hiddeninput.exe'));
$value = rtrim(shell_exec($exe));
$this->write('');
return $value;