From 6dae236ec5528522de472637f9d70a98158b9a5d Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Thu, 5 Feb 2015 11:45:26 +0100 Subject: Renamed 3rdparty directory to vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Php namespaces can’t begin with a number --- .../PhpShell/PHP/Shell/Extensions/Autoload.php | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 framework/Vendor/PhpShell/PHP/Shell/Extensions/Autoload.php (limited to 'framework/Vendor/PhpShell/PHP/Shell/Extensions/Autoload.php') diff --git a/framework/Vendor/PhpShell/PHP/Shell/Extensions/Autoload.php b/framework/Vendor/PhpShell/PHP/Shell/Extensions/Autoload.php new file mode 100644 index 00000000..72a5692b --- /dev/null +++ b/framework/Vendor/PhpShell/PHP/Shell/Extensions/Autoload.php @@ -0,0 +1,60 @@ +registerOption("autoload", $this, "optSetAutoload"); + $opt->registerOptionAlias("al", "autoload"); + } + + /** + * sets the autoload-flag + * + * - the $value is ignored and doesn't have to be set + * - if __autoload() is defined, the set fails + */ + public function optSetAutoload($key, $value) { + if ($this->autoload) { + print('autload is already enabled'); + return; + } + + if (function_exists('__autoload')) { + print('can\'t enabled autoload as a external __autoload() function is already defined'); + return; + } + + $this->autoload = true; + } + + /** + * is the autoload-flag set ? + * + * @return bool true if __autoload() should be set by the external wrapper + */ + public function isAutoloadEnabled() { + return $this->autoload; + } +} + -- cgit v1.2.3