@@ 265-284 (lines=20) @@ | ||
262 | */ |
|
263 | public function askHiddenResponse(OutputInterface $output, $question, $fallback = true) |
|
264 | { |
|
265 | if ('\\' === DIRECTORY_SEPARATOR) { |
|
266 | $exe = __DIR__.'/../Resources/bin/hiddeninput.exe'; |
|
267 | ||
268 | // handle code running from a phar |
|
269 | if ('phar:' === substr(__FILE__, 0, 5)) { |
|
270 | $tmpExe = sys_get_temp_dir().'/hiddeninput.exe'; |
|
271 | copy($exe, $tmpExe); |
|
272 | $exe = $tmpExe; |
|
273 | } |
|
274 | ||
275 | $output->write($question); |
|
276 | $value = rtrim(shell_exec($exe)); |
|
277 | $output->writeln(''); |
|
278 | ||
279 | if (isset($tmpExe)) { |
|
280 | unlink($tmpExe); |
|
281 | } |
|
282 | ||
283 | return $value; |
|
284 | } |
|
285 | ||
286 | if ($this->hasSttyAvailable()) { |
|
287 | $output->write($question); |
@@ 292-310 (lines=19) @@ | ||
289 | */ |
|
290 | private function getHiddenResponse(OutputInterface $output, $inputStream) |
|
291 | { |
|
292 | if ('\\' === DIRECTORY_SEPARATOR) { |
|
293 | $exe = __DIR__.'/../Resources/bin/hiddeninput.exe'; |
|
294 | ||
295 | // handle code running from a phar |
|
296 | if ('phar:' === substr(__FILE__, 0, 5)) { |
|
297 | $tmpExe = sys_get_temp_dir().'/hiddeninput.exe'; |
|
298 | copy($exe, $tmpExe); |
|
299 | $exe = $tmpExe; |
|
300 | } |
|
301 | ||
302 | $value = rtrim(shell_exec($exe)); |
|
303 | $output->writeln(''); |
|
304 | ||
305 | if (isset($tmpExe)) { |
|
306 | unlink($tmpExe); |
|
307 | } |
|
308 | ||
309 | return $value; |
|
310 | } |
|
311 | ||
312 | if ($this->hasSttyAvailable()) { |
|
313 | $sttyMode = shell_exec('stty -g'); |