/** * Persists a plugin in the database. * * @param PluginBundle $pluginBundle * @param array $pluginConfiguration */ public function insert(PluginBundle $pluginBundle, array $pluginConfiguration) { $pluginEntity = new Plugin(); $pluginEntity->setVendorName($pluginBundle->getVendorName()); $pluginEntity->setBundleName($pluginBundle->getBundleName()); $pluginEntity->setHasOptions($pluginConfiguration['has_options']); $this->em->persist($pluginEntity); $this->persistConfiguration($pluginConfiguration, $pluginEntity, $pluginBundle); $this->em->flush(); return $pluginEntity; }
public function postUpdate() { $installedBundles = $this->container->getParameter('kernel.bundles'); if (isset($installedBundles['IcapPortfolioBundle'])) { $icapPortfolioPlugin = $this->om->getRepository('ClarolineCoreBundle:Plugin')->findOneByBundleFQCN($installedBundles['IcapPortfolioBundle']); if (null === $icapPortfolioPlugin) { $this->log(' Creation of Portfolio plugin in database.'); $icapPortfolioPlugin = new Plugin(); $icapPortfolioPlugin->setVendorName('Icap'); $icapPortfolioPlugin->setBundleName('PortfolioBundle'); $icapPortfolioPlugin->setHasOptions(false); $this->om->persist($icapPortfolioPlugin); $this->om->flush(); } } }
/** * @param array $themeConfiguration * @param Plugin $plugin * @param Theme $theme */ private function persistTheme($themeConfiguration, Plugin $plugin, Theme $theme) { $theme->setName($themeConfiguration['name']); $theme->setPath('ClarolineCoreBundle:less:claroline/theme.html.twig'); if ($themeConfiguration['path']) { $theme->setPath($plugin->getVendorName() . $plugin->getBundleName() . ":" . substr_replace($themeConfiguration['path'], ":", strpos($themeConfiguration['path'], "/"), 1)); } $theme->setPlugin($plugin); $this->em->persist($theme); }
protected static function createPlugin($vendor, $bundle) { $plugin = new Plugin(); $plugin->setVendorName($vendor); $plugin->setBundleName($bundle); $plugin->setHasOptions(false); $plugin->setIcon('default'); self::create($vendor . $bundle, $plugin); }
public function disable(Plugin $plugin) { $this->iniFileManager->updateKey($plugin->getBundleFQCN(), false, $this->kernelRootDir . '/config/bundles.ini'); //cache the results $this->loadedBundles = parse_ini_file($this->iniFile); return $plugin; }
private function websitePlugin() { $plugin = $this->om->getRepository('ClarolineCoreBundle:Plugin')->findOneByBundleName('WebsiteBundle'); if (!$plugin) { $plugin = new Plugin(); $plugin->setVendorName('Icap'); $plugin->setBundleName('WebsiteBundle'); $plugin->setHasOptions(false); $this->om->persist($plugin); } return $plugin; }