core/classes/Console.class.php
public function consolePrompt($question,$cannotBeBlank = false){

        @ob_flush();

        exec("read -p '{$question} ' answer; echo \$answer;",$answer);

        if(!$answer[0] && $cannotBeBlank === true){
            echo PHP_EOL . 'Answer cannot be blank! Try again...' . PHP_EOL . PHP_EOL; 
            return self::consolePrompt($question,$cannotBeBlank);
        }//if

        return $answer[0];

    }
public function consolePrompt($question,$cannotBeBlank = false){

        @ob_flush();

        exec("read -p '{$question} ' answer; echo \$answer;",$answer);

        if(!$answer[0] && $cannotBeBlank === true){
            echo PHP_EOL . 'Answer cannot be blank! Try again...' . PHP_EOL . PHP_EOL; 
            return self::consolePrompt($question,$cannotBeBlank);
        }//if

        return $answer[0];

    }
public function consolePrompt ( $ question , $ cannotBeBlank = false ) { @ ob_flush ( ) ; exec ( "read -p '{$question} ' answer; echo \$answer;" , $ answer ) ; if ( ! $ answer [ 0 ] && $ cannotBeBlank === true ) { echo PHP_EOL . 'Answer cannot be blank! Try again...' . PHP_EOL . PHP_EOL ; return self :: consolePrompt ( $ question , $ cannotBeBlank ) ; } //if return $ answer [ 0 ] ; }
Prompt the user at the console to enter a free form text response to a question.

@param string $question The question that needs a response.
@param boolean $cannotBeBlank The response to the question cannot be blank.

@return string The response to the question.
Prompt the user at the console to enter a free form text response to a question .