Changeset View
Changeset View
Standalone View
Standalone View
src/console/format.php
Context not available. | |||||
do { | do { | ||||
$response = phutil_console_prompt($prompt.' '.$prompt_options); | $response = phutil_console_prompt($prompt.' '.$prompt_options); | ||||
$c = trim(strtolower($response)); | $c = trim(@strtolower($response)); | ||||
} while ($c != 'y' && $c != 'n' && $c != ''); | } while ($c != 'y' && $c != 'n' && $c != ''); | ||||
echo "\n"; | echo "\n"; | ||||
Context not available. | |||||
$response = phutil_console_prompt($prompt.' '.$select_options); | $response = phutil_console_prompt($prompt.' '.$select_options); | ||||
$selection = trim($response); | $selection = trim($response); | ||||
if (preg_match('/^\d+\z/', $selection)) { | if (@preg_match('/^\d+\z/', $selection)) { | ||||
$selection = (int)$selection; | $selection = (int)$selection; | ||||
if ($selection >= $min && $selection <= $max) { | if ($selection >= $min && $selection <= $max) { | ||||
return $selection; | return $selection; | ||||
Context not available. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0