public function pluginsAction() { $data = $this->getCachedVersion(); $version = $data->version; $pluginCheck = new \ShopwarePlugins\SwagUpdate\Components\PluginCheck($this->container); $result = $pluginCheck->checkInstalledPluginsAvailableForNewVersion($version); $this->View()->assign(array('success' => true, 'data' => $result)); return; }
public function updateAction() { $pluginCheck = new \ShopwarePlugins\SwagUpdate\Components\PluginCheck($this->container); /** @var PluginLicenceService $service */ $licenceService = $this->get('shopware_plugininstaller.plugin_licence_service'); /** @var AccountManagerService $accountService */ $accountService = $this->get('shopware_plugininstaller.account_manager_service'); $request = new UpdateLicencesRequest($this->getVersion(), $this->getLocale(), $accountService->getDomain(), $this->getAccessToken()); try { $result = $licenceService->updateLicences($request); } catch (Exception $e) { $this->handleException($e); return; } $plugins = $pluginCheck->checkInstalledPluginsAvailableForNewVersion($this->getVersion()); $updatable = array_filter($plugins, function ($plugin) { return $plugin['updatable']; }); $notUpdatable = array_filter($plugins, function ($plugin) { return $plugin['inStore'] == false; }); $this->View()->assign(['success' => true, 'result' => $result, 'plugins' => array_values($plugins), 'updatable' => array_values($updatable), 'notUpdatable' => array_values($notUpdatable)]); }