Author: Jack P.
Inheritance: extends Avalon\AppKernel
Ejemplo n.º 1
0
 /**
  * Registers the plugins autoload paths with the autoloader.
  */
 public function registerWithAutoloader()
 {
     // Register namespace with autoloader
     $vendorDir = __DIR__ . '/../../vendor';
     foreach ($this->autoload as $namespace => $directory) {
         Traq::registerNamespace($namespace, $vendorDir . "/{$this->directory}/{$directory}");
     }
 }
Ejemplo n.º 2
0
 /**
  * Install plugin.
  */
 public function installAction()
 {
     $info = Registry::infoFor(Request::$query['plugin']);
     $vendorDir = __DIR__ . '/../../../vendor';
     // Register autoload paths
     foreach ($info['autoload'] as $namespace => $directory) {
         Traq::registerNamespace($namespace, $vendorDir . "/{$info['directory']}/{$directory}");
     }
     if (class_exists($info['main'])) {
         $info['main']::__install();
         $info['main']::__enable();
         (new Plugin($info))->save();
     }
     return $this->redirectTo('admin_plugins');
 }