Implementing non-interactive mode in console scripts

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6470 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2008-02-24 02:44:45 +00:00
parent 0572926d49
commit 3bc622b250

View file

@ -295,7 +295,11 @@ class Shell extends Object {
* @access public
*/
function in($prompt, $options = null, $default = null) {
if (!$this->interactive) {
return $default;
}
$in = $this->Dispatch->getInput($prompt, $options, $default);
if ($options && is_string($options)) {
if (strpos($options, ',')) {
$options = explode(',', $options);