FF_CLI Class Reference

List of all members.

Public Member Functions

 FF_CLI ($in_app= 'fastframe')
singleton ()
 writeln ($text= '', $pre=false)
 indent ($text)
 bold ($text)
 red ($text)
 green ($text)
 blue ($text)
 yellow ($text)
 message ($message, $type= 'cli.message')
 fatal ($error)
 prompt ($prompt, $choices=null)
 init ()
 runningFromCLI ()

Public Attributes

 $_console
 $_newline
 $_indent
 $_bold_start = ''
 $_bold_end = ''
 $_red_start = ''
 $_green_start = ''
 $_yellow_start = ''
 $_blue_start = ''
 $_red_end = ''
 $_green_end = ''
 $_yellow_end = ''
 $_blue_end = ''

Detailed Description

Definition at line 48 of file CLI.php.


Constructor & Destructor Documentation

FF_CLI::FF_CLI in_app = 'fastframe'  ) 
 

Constructor. Detects the current environment (web server or console) and sets internal values accordingly.

Parameters:
string $in_app (optional) The app name to push
public
Returns:
void

Definition at line 110 of file CLI.php.

References $o_registry, $term, init(), runningFromCLI(), and FF_Registry::singleton().

Referenced by singleton().


Member Function Documentation

FF_CLI::blue text  ) 
 

Returns a blue version of $text.

Parameters:
string $text The text to print in blue.

Definition at line 260 of file CLI.php.

Referenced by message().

FF_CLI::bold text  ) 
 

Returns a bold version of $text.

Parameters:
string $text The text to bold.

Definition at line 221 of file CLI.php.

Referenced by prompt().

FF_CLI::fatal error  ) 
 

Displays a fatal error message.

Parameters:
string $error The error text to display.

Definition at line 317 of file CLI.php.

References writeln().

FF_CLI::green text  ) 
 

Returns a green version of $text.

Parameters:
string $text The text to print in green.

Definition at line 247 of file CLI.php.

Referenced by message().

FF_CLI::indent text  ) 
 

Returns the indented string.

Parameters:
string $text The text to indent.

Definition at line 208 of file CLI.php.

FF_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.

static

Definition at line 386 of file CLI.php.

Referenced by FF_CLI().

FF_CLI::message message,
type = 'cli.message'
 

Displays a message.

Parameters:
string $event The message string.
optional string $type The type of message: 'cli.error', 'cli.warning', 'cli.success', or 'cli.message'.

Definition at line 289 of file CLI.php.

References blue(), green(), red(), writeln(), and yellow().

FF_CLI::prompt prompt,
choices = null
 

Prompts for a user response.

Parameters:
string $prompt The message to display when prompting the user.
optional array $choices The choices available to the user or null for a text input.
Returns:
mixed The user's response to the prompt.

Definition at line 341 of file CLI.php.

References bold(), and writeln().

FF_CLI::red text  ) 
 

Returns a red version of $text.

Parameters:
string $text The text to print in red.

Definition at line 234 of file CLI.php.

Referenced by message().

FF_CLI::runningFromCLI  ) 
 

Make sure we're being called from the command line, and not via the web.

static

Returns:
boolean True if we are, false otherwise.

Definition at line 409 of file CLI.php.

Referenced by FF_CLI().

& FF_CLI::singleton  ) 
 

Returns a single instance of the FF_CLI class.

Definition at line 171 of file CLI.php.

References FF_CLI().

FF_CLI::writeln text = '',
pre = false
 

Prints $text on a single line.

Parameters:
string $text The text to print.
bool $pre If true the linebreak is printed before the text instead of after it.

Definition at line 191 of file CLI.php.

Referenced by fatal(), message(), and prompt().

FF_CLI::yellow text  ) 
 

Returns a yellow version of $text.

Parameters:
string $text The text to print in yellow.

Definition at line 273 of file CLI.php.

Referenced by message().


Member Data Documentation

FF_CLI::$_blue_end = ''
 

Definition at line 95 of file CLI.php.

FF_CLI::$_blue_start = ''
 

Definition at line 87 of file CLI.php.

FF_CLI::$_bold_end = ''
 

Definition at line 79 of file CLI.php.

FF_CLI::$_bold_start = ''
 

Definition at line 73 of file CLI.php.

FF_CLI::$_console
 

Definition at line 55 of file CLI.php.

FF_CLI::$_green_end = ''
 

Definition at line 93 of file CLI.php.

FF_CLI::$_green_start = ''
 

Definition at line 85 of file CLI.php.

FF_CLI::$_indent
 

Definition at line 67 of file CLI.php.

FF_CLI::$_newline
 

Definition at line 61 of file CLI.php.

FF_CLI::$_red_end = ''
 

The strings to mark the end of coloured text.

Definition at line 92 of file CLI.php.

FF_CLI::$_red_start = ''
 

The strings to mark the beginning of coloured text.

Definition at line 84 of file CLI.php.

FF_CLI::$_yellow_end = ''
 

Definition at line 94 of file CLI.php.

FF_CLI::$_yellow_start = ''
 

Definition at line 86 of file CLI.php.


The documentation for this class was generated from the following file:
Generated on Fri Jun 23 11:38:35 2006 for FastFrame by  doxygen 1.4.4