Source for file Extensions.php
Documentation is available at Extensions.php
* the interface for all shell extensions
* Extension can hook into the execution of the shell
* - execution time for parsing and execute
* - colours for the output
interface PHP_Shell_Extension {
public function register ();
* storage class for Shell Extensions
class PHP_Shell_Extensions {
* @var PHP_Shell_Extensions
static protected $instance;
* storage for the extension
protected $exts = array ();
* the extension object gives access to the register objects
* through the a simple $exts->name->...
* @param string registered name of the extension
* @return PHP_Shell_Extension object handle
public function __get ($key) {
if (!isset ($this->exts[$key])) {
throw new Exception (" Extension $s is not known." );
return $this->exts[$key];
* register set of extensions
* @param array set of (name, class-name) pairs
public function registerExtensions ($exts) {
foreach ($exts as $k => $v) {
$this->registerExtension ($k, $v);
* register a single extension
* @param string name of the registered extension
* @param PHP_Shell_Extension the extension object
public function registerExtension ($k, PHP_Shell_Extension $obj) {
* @return object a singleton of the class
static function getInstance () {
self ::$instance = new $class();
Documentation generated on Mon, 11 Mar 2019 14:40:32 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|