Commits

Anonymous committed 3bc29a7

- Replaced all the echo-s by fwrite(STDOUT, <message>); in the classes.

Comments (0)

Files changed (1)

 		$_message .= $_label . $message;
 		$_message .= "\n";
 		
-		echo $_message;
+		fwrite(STDOUT, $_message);
 		unset($_label, $_message, $message);
 		
 		if ($type == 'error' && $continue === FALSE)
 				if (is_dir($destination . self::system_folder_name . '/' . self::application_folder_name))
 				{
 					$_default_answer = (self::move_application_folder) ? 'yes' : 'no';
-					$_question  = 'Do you want to move the application folder outside of the system folder? [Default: ' . $_default_answer . ']';
-					echo $_question;
+					$_question  = "'Do you want to move the application folder outside of the system folder? [Default: ${_default_answer}]\n[yes/no] ";
+					fwrite(STDOUT, $_question);
 					
 					$_answer = strtolower(trim(fgets(STDIN)));
 					
 						$i = 0;
 						do
 						{
-							echo 'I do not understand...' . "\n";
-							echo $_question;
+							fwrite(STDOUT, "I do not understand...\n$_question");
 							$_answer = strtolower(trim(fgets(STDIN)));
 							if ($_answer == 'yes' || $_answer == 'y' || (empty($_answer) && $_default_answer == 'yes'))
 							{
 				if (!is_dir($destination . self::name_of_assets_folder))
 				{
 					$_default_answer = (self::create_assets_folder) ? 'yes' : 'no';
-					$_question  = 'Do you want to create an assets folder? [Default: ' . $_default_answer . '] ';
-					echo $_question;
+					$_question  = "'Do you want to create an assets folder? [Default: ${_default_answer}\n[yes/no] ";
+					fwrite(STDOUT, $_question);
 					
 					$_answer = strtolower(trim(fgets(STDIN)));
 					if ($_answer == 'yes' || $_answer = 'y' || (empty($_answer) && $_default_answer == 'yes'))
 						$i = 0;
 						do
 						{
-							echo 'I do not understand...' . "\n";
-							echo $_question;
+							fwrite(STDOUT, "I do not understand...\n$_question");
 							$_answer = strtolower(trim(fgets(STDIN)));
 							if ($_answer == 'yes' || $_answer == 'y' || (empty($_answer) && $_default_answer == 'yes'))
 							{
 	 */
 	private function _get_name($destination)
 	{
-		echo 'Choose a name for your project: ';
+		fwrite(STDOUT, 'Choose a name for your project: ');
 		$name = trim(fgets(STDIN));
 		
 		$i = 0;
 				break;
 			}
 			
-			echo 'Choose a ' . $state . ' name for your project: ';
+			fwrite(STDOUT, 'Choose a ' . $state . ' name for your project: ');
 			$name = trim(fgets(STDIN));
 			$i++;
 		} while ($i < 3);
 	 */
 	public function create()
 	{
-		// FIXME - Controller and model generation broken
 		if (empty($this->name))
 		{
 			$this->name = $this->_get_name();
 	{
 		if (empty($name))
 		{
-			echo 'Please enter the name of the action you want to create: ';
+			fwrite(STDOUT, 'Please enter the name of the action you want to create: ');
 			$name = fgets(STDIN);
 			$name = trim($name);
 			if (empty($name))
 	 */
 	private function _get_name()
 	{
-		echo 'Please enter the name of the ' . $this->type . ': ';
+		fwrite(STDOUT, 'Please enter the name of the ' . $this->type . ': ');
 		return trim(fgets(STDIN));
 	} // End of _get_name
 	
 			
 			$i = 0;
 			do {
-				echo "Do you want to overwrite ${file} ? [Default: y]\n[y/n] ";
+				fwrite(STDOUT, "Do you want to overwrite ${file} ? [Default: y]\n[y/n] ");
 				$_answer = trim(fgets(STDIN));
 				if ($_answer == 'n')
 				{
 				}
 				else
 				{
-					echo "I don't understand...\n";
+					fwrite(STDOUT, "I don't understand...\n");
 					$i++;
 				}
 				
 | DEBUG
 */
 
-print_r($argv);
+// print_r($argv);
 
 // die();
 
 		$last_type = $argv[1];
 		
 		$max = count($argv);
-		
-		// echo "max = $max\n\n";
-		
 		for ($i=3; $i < $max; $i++)
 		{
-			// echo "\$i = $i\n\$argv[\$i] | \$argv[$i] = " . $argv[$i] . "\n\n";
 			switch ($argv[$i])
 			{
 				case 'new':