Пример #1
0
 final function __construct($path, $lib)
 {
     //	assign in the paramamters
     $this->path = $path;
     $this->lib = $lib;
     $this->name = strtolower(str_replace('Module', '', get_class($this)));
     //	second stage (module specific) construction
     $this->init();
     $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 $className => $classPath) {
             ZincLoader::addClass($className, $this->path . '/' . $classPath);
         }
     }
     if ($this->hasConfig) {
         $this->loadConfig();
     }
     //	handle configuration
     $this->configure();
 }
Пример #2
0
 /**
  * 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
  */
 public static function registerClass($className, $fullPath)
 {
     ZincLoader::addClass($className, $fullPath);
 }