final function __construct($path, $lib) { // second stage (module specific) construction $this->init(); // assign in the paramamters $this->path = $path; $this->lib = $lib; $this->name = strtolower(str_replace('Module', '', get_class($this))); $classname = get_class($this); // load any dependant modules if ($this->getDepends()) { foreach ($this->getDepends() as $thisDepends) { $this->lib->loadMod($thisDepends); } } // include any normal files that need to be included if ($this->getIncludes()) { foreach ($this->getIncludes() as $thisInclude) { if ($thisInclude[0] == '/') { require $thisInclude; } else { require $this->path . '/' . $thisInclude; } } } // register any class files if ($classes = $this->getClasses()) { foreach ($classes as $thisClass) { ZoopLoader::addClass($thisClass, $this->path . '/' . $thisClass . '.php'); } } if ($this->hasConfig) { $this->loadConfig(); } // handle configuration $this->configure(); }
/** * static -- Register a class for auto-loading with the name of the class * and the full path of the file that contains it. * * @param string $className * @param string $fullPath */ static function registerClass($className, $fullPath) { ZoopLoader::addClass($className, $fullPath); }