Property | Type | Description | |
---|---|---|---|
$_blue_end | |||
$_blue_start | |||
$_bold_end | string | The string to mark the end of bold text. | |
$_bold_start | string | The string to mark the beginning of bold text. | |
$_clearscreen | string | The string to use for clearing the screen. | |
$_console | boolean | Are we running on a console? | |
$_green_end | |||
$_green_start | |||
$_indent | string | The indent string to use. | |
$_newline | string | The newline string to use. | |
$_red_end | string | The strings to mark the end of coloured text. | |
$_red_start | string | The strings to mark the beginning of coloured text. | |
$_terminalBackgrounds | array | Terminal background color codes. Not used yet. | |
$_terminalForegrounds | array | Terminal foreground color codes. Not used yet. | |
$_yellow_end | |||
$_yellow_start |
Method | Description | |
---|---|---|
__construct ( ) | Detect the current environment (web server or console) and sets internal values accordingly. | |
blue ( string $text ) : string | Returns a blue version of $text. | |
bold ( string $text ) : string | Returns a bold version of $text. | |
clearScreen ( ) | Clears the entire screen, if possible. | |
fatal ( mixed $error ) | Displays a fatal error message. | |
green ( string $text ) : string | Returns a green version of $text. | |
indent ( string $text ) : string | Returns the indented string. | |
init ( ) : Horde_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. | |
message ( $message, string $type = 'cli.message' ) | Displays a message. | |
passwordPrompt ( string $prompt ) : string | Interactively prompts for input without echoing to the terminal. | |
prompt ( string $prompt, array $choices = null, string $default = null ) : mixed | Prompts for a user response. | |
readStdin ( ) : string | Reads everything that is sent through standard input and returns it as a single string. | |
red ( string $text ) : string | Returns a red version of $text. | |
runningFromCLI ( ) : boolean | Make sure we're being called from the command line, and not via the web. | |
shutdown ( ) | Destroys any session on script end. | |
writeln ( string $text = '', boolean $pre = false ) | Prints $text on a single line. | |
yellow ( string $text ) : string | Returns a yellow version of $text. |
public __construct ( ) |
public static init ( ) : Horde_Cli | ||
return | Horde_Cli | A Horde_Cli instance. |
public passwordPrompt ( string $prompt ) : string | ||
$prompt | string | The message to display when prompting the user. |
return | string | The user's response to the prompt. |
public prompt ( string $prompt, array $choices = null, string $default = null ) : mixed | ||
$prompt | string | The message to display when prompting the user. |
$choices | array | The choices available to the user or null for a text input. |
$default | string | The default value if no value specified. |
return | mixed | The user's response to the prompt. |
public static runningFromCLI ( ) : boolean | ||
return | boolean | True if we are, false otherwise. |
protected string $_bold_end | ||
return | string |
protected string $_bold_start | ||
return | string |
protected string $_clearscreen | ||
return | string |
protected string $_red_end | ||
return | string |
protected string $_red_start | ||
return | string |
protected array $_terminalBackgrounds | ||
return | array |
protected array $_terminalForegrounds | ||
return | array |