Add handling for phar
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__.'/Autoload/ClassLoader.php'), false);
|
||||||
$this->addFile($phar, new \SplFileInfo(__DIR__.'/../../res/composer-schema.json'), 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 = new Finder();
|
||||||
$finder->files()
|
$finder->files()
|
||||||
|
|
|
@ -128,8 +128,17 @@ class ConsoleIO implements IOInterface
|
||||||
{
|
{
|
||||||
// handle windows
|
// handle windows
|
||||||
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
|
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);
|
$this->write($question, false);
|
||||||
$value = rtrim(shell_exec(__DIR__.'\\hiddeninput.exe'));
|
$value = rtrim(shell_exec($exe));
|
||||||
$this->write('');
|
$this->write('');
|
||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
|
|
Loading…
Reference in New Issue