예제 #1
0
 /**
  * Loads the specified plugin and returns the instance
  * @param $name string Name of plugin to load
  * @return object returns the plugin instance
  */
 public function plugin($name, $basePath = '')
 {
     if ($basePath == '') {
         $basePath = PLUGINS_PATH;
     }
     if (!in_array($name, self::$__loaded)) {
         if (!file_exists("{$basePath}/{$name}/class.php")) {
             throw new LoaderPluginNotFound($name);
         }
         include "{$basePath}/{$name}/class.php";
     }
     if (!array_key_exists($name, self::$__plugins)) {
         $strName = ClassHelper::cleanClassName($name . 'Plugin');
         self::$__plugins[$name] = new $strName();
     }
     return self::$__plugins[$name];
 }
예제 #2
0
 public function model($name, $basePath = '')
 {
     if ($basePath == '') {
         $basePath = $this->directory;
     }
     $classRef = new ClassReference();
     $classRef->className = ClassHelper::cleanClassName($name);
     $classRef->classPath = "{$basePath}{$name}.php";
     $this->managers[$name] = $classRef;
 }