/** * 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}"); } }
/** * 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'); }