/** * List all enabled plugins, installed and recommend packages. * @return string */ public function index() { $this->requireAdmin(); $json = $this->getComposerJson(); $this->view->installedPackages = $json['require']; $pluginInfo = new PluginInformationCollection(); $pluginInfo->add(FilesPluginInformation::newFromDir(PHPCI_DIR . "PHPCI/Plugin/")); $pluginInfo->add(ComposerPluginInformation::buildFromYaml(PHPCI_DIR . "vendor/composer/installed.json")); $this->view->plugins = $pluginInfo->getInstalledPlugins(); $this->layout->title = Lang::get('plugins'); return $this->view->render(); }
public function index() { if (!$_SESSION['user']->getIsAdmin()) { throw new \Exception('You do not have permission to do that.'); } $this->view->canWrite = is_writable(APPLICATION_PATH . 'composer.json'); $this->view->required = $this->required; $json = $this->getComposerJson(); $this->view->installedPackages = $json['require']; $this->view->suggestedPackages = $json['suggest']; $pluginInfo = new PluginInformationCollection(); $pluginInfo->add(FilesPluginInformation::newFromDir(PHPCI_DIR . "PHPCI/Plugin/")); $pluginInfo->add(ComposerPluginInformation::buildFromYaml(PHPCI_DIR . "vendor/composer/installed.json")); $this->view->plugins = $pluginInfo->getInstalledPlugins(); $this->config->set('page_title', 'Plugins'); return $this->view->render(); }