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

Class: PHP_Shell_Commands

Source Location: /PHP_Shell-0.3.2/PHP/Shell/Commands.php

Class Overview

PHP_Shell_Commands Class



  • Release: @package_version@


  • 2006 Jan Kneschke



Inherited Variables

Inherited Methods

Class Details

[line 51]
PHP_Shell_Commands Class

Extensions can register their own commands for the shell like the InlineHelp Extension which provides inline help for all functions

It uses the pattern '? <string>' to catch the cmdline strings.

registerCommand() should be called by the extensions in the register() method. Its parameters are

  • the regex which matches the command
  • the object and the method to call if the command is matched
  • the human readable command string and the description for the help

[ Top ]

Class Variables

$commands = array()

[line 68]

registered commands

array('quit' => ... )

Type:   array

[ Top ]

$instance =

[line 58]

instance of the current class
  • Access: protected

Type:   PHP_Shell_Commands

[ Top ]

Method Detail

getCommands   [line 97]

all getCommands( )

return a copy of the commands array
  • Return: commands
  • Access: public

[ Top ]

getInstance   [line 109]

void getInstance( )

getInstance return the instance (singleton pattern)
  • Access: public

[ Top ]

registerCommand   [line 81]

void registerCommand( string $regex, string $obj, string $method, string $cmd, string $help)

register your own command for the shell
  • Access: public


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

[ Top ]

Documentation generated on Mon, 12 Dec 2011 23:00:07 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.