コード例 #1
0
 /**
  * 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;
 }
コード例 #2
0
 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();
         }
     }
 }
コード例 #3
0
ファイル: DatabaseWriter.php プロジェクト: ChMat/CoreBundle
 /**
  * @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);
 }
コード例 #4
0
 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);
 }
コード例 #5
0
 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;
 }
コード例 #6
0
ファイル: Persister.php プロジェクト: claroline/distribution
 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;
 }