summaryrefslogtreecommitdiff
path: root/framework/3rdParty/PhpShell/PHP/Shell/Extensions.php
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2015-02-05 11:45:26 +0100
committerFabio Bas <ctrlaltca@gmail.com>2015-02-05 11:45:26 +0100
commit6dae236ec5528522de472637f9d70a98158b9a5d (patch)
tree0392bc0afb1f09921810d8b313b1f22b2f360106 /framework/3rdParty/PhpShell/PHP/Shell/Extensions.php
parent81efaa0c6acdcd2e36081fed21ad5eac11fad3bc (diff)
Renamed 3rdparty directory to vendor
Php namespaces can’t begin with a number
Diffstat (limited to 'framework/3rdParty/PhpShell/PHP/Shell/Extensions.php')
-rw-r--r--framework/3rdParty/PhpShell/PHP/Shell/Extensions.php86
1 files changed, 0 insertions, 86 deletions
diff --git a/framework/3rdParty/PhpShell/PHP/Shell/Extensions.php b/framework/3rdParty/PhpShell/PHP/Shell/Extensions.php
deleted file mode 100644
index 9b210c47..00000000
--- a/framework/3rdParty/PhpShell/PHP/Shell/Extensions.php
+++ /dev/null
@@ -1,86 +0,0 @@
-<?php
-
-/**
-* the interface for all shell extensions
-*
-* Extension can hook into the execution of the shell
-*
-* examples:
-* - execution time for parsing and execute
-* - colours for the output
-* - inline help
-*
-*
-*/
-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
- *
- * @var array
- */
- 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) {
- $obj->register();
-
- $this->exts[$k] = $obj;
- }
-
- /**
- * @return object a singleton of the class
- */
- static function getInstance() {
- if (is_null(self::$instance)) {
- $class = __CLASS__;
- self::$instance = new $class();
- }
- return self::$instance;
- }
-}
-
-