Add handling for phar

main
Jordi Boggiano 12 years ago
parent 3210da0b84
commit 26b3a1711f

@ -65,6 +65,7 @@ class Compiler
}
$this->addFile($phar, new \SplFileInfo(__DIR__.'/Autoload/ClassLoader.php'), false);
$this->addFile($phar, new \SplFileInfo(__DIR__.'/../../res/composer-schema.json'), false);
$this->addFile($phar, new \SplFileInfo(__DIR__.'/../../src/Composer/IO/hiddeninput.exe'), false);
$finder = new Finder();
$finder->files()

@ -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;

Loading…
Cancel
Save