PHPonTrax
[ class tree: PHPonTrax ] [ index: PHPonTrax ] [ all elements ]

Class: PHP_Shell

Source Location: /vendor/trax/php_shell/shell.php

Class Overview




Variables

Constants

Methods



Class Details

[line 159]


[ Top ]


Class Variables

$autoload =  false

[line 197]

does the use want to use the internal autoload ?



Tags:

access:  protected

Type:   bool


[ Top ]

$code =

[line 164]

current code-buffer



Tags:

access:  protected

Type:   string


[ Top ]

$colours =

[line 206]

shell colours



Tags:

see:  setColourScheme
access:  protected

Type:   array


[ Top ]

$colour_scheme =

[line 214]

shell colour schemes



Tags:

see:  PHP_Shell::registerColourScheme()
access:  protected

Type:   array


[ Top ]

$commands =

[line 190]

registered commands



Tags:

see:  PHP_Shell::registerCommand()
access:  protected

Type:   array


[ Top ]

$have_readline =

[line 176]

set if readline support is enabled



Tags:

access:  protected

Type:   bool


[ Top ]

$verbose =

[line 170]

set if 'p ...' is executed



Tags:

access:  protected

Type:   bool


[ Top ]

$version =  '0.2.7'

[line 182]

current version of the class



Tags:

access:  protected

Type:   string


[ Top ]



Class Methods


constructor __construct [line 240]

PHP_Shell __construct( )

init the shell and change if readline support is available



Tags:

access:  public


[ Top ]

method appendCode [line 1117]

void appendCode( string $code)

append code to the code-buffer



Tags:

access:  public


Parameters:

string   $code   input buffer

[ Top ]

method applyColourScheme [line 1164]

false applyColourScheme( string $scheme)

apply a colour scheme to the current shell



Tags:

return:  if colourscheme is not known, otherwise true
access:  public


Parameters:

string   $scheme   name of the scheme

[ Top ]

method cmdHelp [line 881]

string cmdHelp( $l)

handle the '?' commands

With the help of the Reflection Class we extract the DocComments and display them For internal Functions we extract the prototype from the php source.

? Class::method() ? $obj->method() ? Class::property ? $obj::property ? Class ? $obj ? function()

The license of the PHP_Shell class ? license




Tags:

return:  the help text
access:  protected


Parameters:

   $l  

[ Top ]

method cmdPrint [line 855]

string cmdPrint( $l)

handle the 'p ' command

set the verbose flag




Tags:

return:  the pure command-string without the 'p ' command
access:  protected


Parameters:

   $l  

[ Top ]

method cmdQuit [line 844]

bool cmdQuit( $l)

handle the 'quit' command



Tags:

return:  false to leave the input() call
see:  PHP_Shell::input()
access:  protected


Parameters:

   $l  

[ Top ]

method cmdSet [line 1016]

void cmdSet( $l)

set a shell-var

:set al to enable autoload :set bg=dark to enable highlighting with a dark backgroud




Tags:

access:  public


Parameters:

   $l  

[ Top ]

method getCode [line 1101]

string getCode( )

get the code-buffer



Tags:

return:  the code-buffer
access:  public


[ Top ]

method getColour [line 1154]

string getColour( string $type)

get a colour for the shell



Tags:

return:  a colour string or a empty string
access:  public


Parameters:

string   $type   one of (value|exception|reset|default)

[ Top ]

method getHelp [line 825]

string getHelp( )

get the inline help



Tags:

return:  the inline help as string
access:  public


[ Top ]

method getVerbose [line 1126]

bool getVerbose( )

check if we have a verbose print-out



Tags:

return:  1 if verbose, 0 otherwise
access:  public


[ Top ]

method getVersion [line 1144]

string getVersion( )

get version of the class



Tags:

return:  version-string
access:  public


[ Top ]

method hasReadline [line 1135]

bool hasReadline( )

check if readline support is enabled



Tags:

return:  true if enabled, false otherwise
access:  public


[ Top ]

method input [line 1063]

bool input( )

handle the input line

read the input and handle the commands of the shell




Tags:

return:  false on 'quit' or EOF, true otherwise
access:  public


[ Top ]

method isAutoloadEnabled [line 1092]

void isAutoloadEnabled( )



Tags:

access:  public


[ Top ]

method parse [line 307]

int parse( )

parse the PHP code

we parse before we eval() the code to

  • fetch fatal errors before they come up
  • know about where we have to wait for closing braces




Tags:

return:  0 if a executable statement is in the code-buffer, non-zero otherwise
access:  public


[ Top ]

method readline [line 798]

string readline( )

show the prompt and fetch a single line

uses readline() if avaialbe




Tags:

return:  a input-line
access:  public


[ Top ]

method registerColourScheme [line 1178]

void registerColourScheme( string $scheme, array $colours)

registers a colour scheme



Tags:

access:  public


Parameters:

string   $scheme   name of the colour scheme
array   $colours   a array of colours

[ Top ]

method registerCommand [line 289]

void registerCommand( string $regex, string $callback, string $cmd, string $help)

register your own command for the shell



Tags:

access:  public


Parameters:

string   $regex   a regex to match against the input line
string   $callback   a method in this class to call of the regex matches
string   $cmd   the command string for the help
string   $help   the full help description for this command

[ Top ]

method resetCode [line 1108]

void resetCode( )

reset the code-buffer



Tags:

access:  public


[ Top ]


Class Constants

C_BLACK =  "\033[0;30m"

[line 219]


[ Top ]

C_BLUE =  "\033[0;34m"

[line 223]


[ Top ]

C_BROWN =  "\033[0;33m"

[line 222]


[ Top ]

C_CYAN =  "\033[0;36m"

[line 225]


[ Top ]

C_GRAY =  "\033[1;30m"

[line 228]


[ Top ]

C_GREEN =  "\033[0;32m"

[line 221]


[ Top ]

C_LIGHT_BLUE =  "\033[1;34m"

[line 232]


[ Top ]

C_LIGHT_CYAN =  "\033[1;36m"

[line 234]


[ Top ]

C_LIGHT_GRAY =  "\033[0;37m"

[line 226]


[ Top ]

C_LIGHT_GREEN =  "\033[1;32m"

[line 230]


[ Top ]

C_LIGHT_PURPLE =  "\033[1;35m"

[line 233]


[ Top ]

C_LIGHT_RED =  "\033[1;31m"

[line 229]


[ Top ]

C_PURPLE =  "\033[0;35m"

[line 224]


[ Top ]

C_RED =  "\033[0;31m"

[line 220]


[ Top ]

C_RESET =  "\033[0m"

[line 217]


[ Top ]

C_WHITE =  "\033[1;37m"

[line 235]


[ Top ]

C_YELLOW =  "\033[1;33m"

[line 231]


[ Top ]



Documentation generated on Mon, 21 May 2007 22:28:55 -0600 by phpDocumentor 1.3.2