Horde_Cli:: API for basic command-line functionality/checks.
Copyright 2003-2012 Horde LLC (http://www.horde.org/)
See the enclosed file COPYING for license information (LGPL). If you
did not receive this file, see http://www.horde.org/licenses/lgpl21.
	 
	
	Methods summary
	
		| 
			 public 
			
			
			 | 
		#
		__construct( )
			Detect the current environment (web server or console) and sets
internal values accordingly. 
			Detect the current environment (web server or console) and sets
internal values accordingly. The constructor must not be called after init(). | 
	
		| 
			 public 
			
			
			 | 
		#
		writeln( string $text = '', boolean $pre = false )
			Prints $text on a single line. 
			Prints $text on a single line. Parameters
					$textThe text to print.
$pre<p>If true the linebreak is printed before
                     the text instead of after it.</p>
 | 
	
		| 
			 public 
			
			
			 | 
		#
		clearScreen( )
			Clears the entire screen, if possible. 
			Clears the entire screen, if possible. | 
	
		| 
			 public 
			string
			
			 | 
		#
		indent( string $text )
			Returns the indented string. 
			Returns the indented string. Parameters
					$textThe text to indent.
Returns
					stringThe indented text.
 | 
	
		| 
			 public 
			string
			
			 | 
		#
		bold( string $text )
			Returns a bold version of $text. 
			Returns a bold version of $text. ParametersReturns
					stringThe bolded text.
 | 
	
		| 
			 public 
			string
			
			 | 
		#
		red( string $text )
			Returns a red version of $text. 
			Returns a red version of $text. Parameters
					$textThe text to print in red.
Returns
					stringThe red text.
 | 
	
		| 
			 public 
			string
			
			 | 
		#
		green( string $text )
			Returns a green version of $text. 
			Returns a green version of $text. Parameters
					$textThe text to print in green.
Returns
					stringThe green text.
 | 
	
		| 
			 public 
			string
			
			 | 
		#
		blue( string $text )
			Returns a blue version of $text. 
			Returns a blue version of $text. Parameters
					$textThe text to print in blue.
Returns
					stringThe blue text.
 | 
	
		| 
			 public 
			string
			
			 | 
		#
		yellow( string $text )
			Returns a yellow version of $text. 
			Returns a yellow version of $text. Parameters
					$textThe text to print in yellow.
Returns
					stringThe yellow text.
 | 
	
		| 
			 public 
			
			
			 | 
		#
		message( string $message, string $type = 'cli.message' )
			Displays a message. Parameters
					$message$event  The message string.
$type<p>The type of message: 'cli.error', 'cli.warning',
                      'cli.success', or 'cli.message'.</p>
 | 
	
		| 
			 public 
			
			
			 | 
		#
		fatal( mixed $error )
			Displays a fatal error message. 
			Displays a fatal error message. Parameters
					$error<p>The error text to display, an exception or an
                     object with a getMessage() method.</p>
 | 
	
		| 
			 public 
			mixed
			
			 | 
		#
		prompt( string $prompt, array $choices = null, string $default = null )
			Prompts for a user response. 
			Prompts for a user response. Parameters
					$promptThe message to display when prompting the user.
$choices<p>The choices available to the user or null for a
                        text input.</p>
$defaultThe default value if no value specified.
Returns
					mixedThe user's response to the prompt.
 | 
	
		| 
			 public 
			string
			
			 | 
		#
		passwordPrompt( string $prompt )
			Interactively prompts for input without echoing to the terminal.
Requires a bash shell or Windows and won't work with safe_mode settings
(uses shell_exec). 
			Interactively prompts for input without echoing to the terminal.
Requires a bash shell or Windows and won't work with safe_mode settings
(uses shell_exec). From: http://www.sitepoint.com/blogs/2009/05/01/interactive-cli-password-prompt-in-php/ Parameters
					$promptThe message to display when prompting the user.
Returns
					stringThe user's response to the prompt.
 | 
	
		| 
			 public 
			string
			
			 | 
		#
		readStdin( )
			Reads everything that is sent through standard input and returns it
as a single string. 
			Reads everything that is sent through standard input and returns it
as a single string. Returns
					stringThe contents of the standard input.
 | 
	
		| 
			 public static
			Horde_Cli | 
		#
		init( )
			CLI scripts shouldn't timeout, so try to set the time limit to
none. Also initialize a few variables in $_SERVER that aren't present
from the CLI. 
			CLI scripts shouldn't timeout, so try to set the time limit to
none. Also initialize a few variables in $_SERVER that aren't present
from the CLI. You must not call init() statically before calling the constructor.
Either use the singleton() method to retrieve a Horde_Cli object after
calling init(), or don't call init() statically. Returns | 
	
		| 
			 public static
			boolean
			
			 | 
		#
		runningFromCLI( )
			Make sure we're being called from the command line, and not via
the web. 
			Make sure we're being called from the command line, and not via
the web. Returns
					booleanTrue if we are, false otherwise.
 | 
	
		| 
			 public 
			
			
			 | 
		#
		shutdown( )
			Destroys any session on script end. 
			Destroys any session on script end. |