From a5467e842316daf6a8a4345740f05a9731167ce1 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 23 Sep 2006 01:51:57 +0000 Subject: merge from 3.0 branch till 1435. --- .../PhpShell/PHP/Shell/Extensions/Autoload.php | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 framework/3rdParty/PhpShell/PHP/Shell/Extensions/Autoload.php (limited to 'framework/3rdParty/PhpShell/PHP/Shell/Extensions/Autoload.php') diff --git a/framework/3rdParty/PhpShell/PHP/Shell/Extensions/Autoload.php b/framework/3rdParty/PhpShell/PHP/Shell/Extensions/Autoload.php new file mode 100644 index 00000000..72a5692b --- /dev/null +++ b/framework/3rdParty/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