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; } }