[ Index ]
 

Code source de PHPonTrax 2.6.6-svn

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/vendor/trax/php_shell/ -> shell.php (sommaire)

(PHP 5)

Copyright: (c) 2005 John Peterson
Version: $Id:$
Poids: 1315 lignes (43 kb)
Inclus ou requis: 1 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

PHP_Shell:: (21 méthodes):
  __construct()
  registerCommand()
  parse()
  readline()
  getHelp()
  cmdQuit()
  cmdPrint()
  cmdHelp()
  cmdSet()
  input()
  isAutoloadEnabled()
  getCode()
  resetCode()
  appendCode()
  getVerbose()
  hasReadline()
  getVersion()
  getColour()
  applyColourScheme()
  registerColourScheme()
  __shell_readline_complete()


Classe: PHP_Shell  - X-Ref

__construct()   X-Ref
init the shell and change if readline support is available


registerCommand($regex, $callback, $cmd, $help)   X-Ref
register your own command for the shell

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

parse()   X-Ref
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

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

readline()   X-Ref
show the prompt and fetch a single line

uses readline() if avaialbe

return: string a input-line

getHelp()   X-Ref
get the inline help

return: string the inline help as string

cmdQuit($l)   X-Ref
handle the 'quit' command

return: bool false to leave the input() call

cmdPrint($l)   X-Ref
handle the 'p ' command

set the verbose flag

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

cmdHelp($l)   X-Ref
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

return: string the help text

cmdSet($l)   X-Ref
set a shell-var

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

input()   X-Ref
handle the input line

read the input and handle the commands of the shell

return: bool false on 'quit' or EOF, true otherwise

isAutoloadEnabled()   X-Ref
Pas de description

getCode()   X-Ref
get the code-buffer

return: string the code-buffer

resetCode()   X-Ref
reset the code-buffer


appendCode($code)   X-Ref
append code to the code-buffer

param: string $code input buffer

getVerbose()   X-Ref
check if we have a verbose print-out

return: bool 1 if verbose, 0 otherwise

hasReadline()   X-Ref
check if readline support is enabled

return: bool true if enabled, false otherwise

getVersion()   X-Ref
get version of the class

return: string version-string

getColour($type)   X-Ref
get a colour for the shell

param: string $type one of (value|exception|reset|default)
return: string a colour string or a empty string

applyColourScheme($scheme)   X-Ref
apply a colour scheme to the current shell

param: string $scheme name of the scheme
return: false if colourscheme is not known, otherwise true

registerColourScheme($scheme, $colours)   X-Ref
registers a colour scheme

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

__shell_readline_complete($str, $pos)   X-Ref
a readline completion callback

param: string $str linebuffer
param: integer $pos position in linebuffer
return: array list of possible matches



Généré le : Sun Feb 25 20:04:38 2007 par Balluche grâce à PHPXref 0.7