Пример #1
0
 /**
  * Output a command prompt
  *
  * @var	string	String to echo
  * @var	array		Accepted responses
  *
  * @return	string	Response value
  */
 private function prompt($value, $responses = null)
 {
     do {
         $this->echo_phrase("\r\n----------------------------------\r\n");
         $this->echo_phrase($this->convert_phrase($value));
         $this->echo_phrase('>');
         $response = trim(@fgets(STDIN));
     } while (!empty($responses) and is_array($responses) and !in_array($response, $responses));
     $this->db->ping();
     return $response;
 }