Пример #1
0
 public function getActivePlugins()
 {
     if ($this->activePluginsFetched === false) {
         $activePluginsDb = $this->optionManager->getOptionValue('active_plugins', array());
         if (!empty($activePluginsDb)) {
             foreach ($activePluginsDb as $plugin) {
                 $configuration = $this->findConfiguration($plugin);
                 if (empty($configuration)) {
                     throw new \Exception(sprintf("No matching configuration could be found in the filesystem " . "for the active plugin in the database (%s)", $plugin));
                 }
                 $this->activePlugins[$plugin] = $configuration;
                 $this->activePluginOptions[$plugin] = $this->optionManager->getOptionValue('plugin_options_' . $plugin, new \stdClass());
             }
         }
         $this->activePluginsFetched = true;
     }
     return $this->activePlugins;
 }
Пример #2
0
 /**
  * @return mixed
  * @throws \Exception
  */
 public function getActiveTheme()
 {
     if ($this->activeThemeFetched === false) {
         $activeThemeDb = $this->optionManager->getOptionValue('active_theme', null);
         if ($activeThemeDb !== null) {
             $configuration = $this->findConfiguration($activeThemeDb);
             if (empty($configuration)) {
                 throw new \Exception(sprintf("No matching configuration could be found in the filesystem " . "for the active theme in the database (%s)", $activeThemeDb));
             }
             $this->activeTheme = $activeThemeDb;
             $this->activeThemeConfig = $configuration;
             $this->activeThemeOptions = $this->optionManager->getOptionValue('theme_options_' . $activeThemeDb, new \stdClass());
         } else {
             throw new \Exception("No active theme was defined, this should never happen!");
         }
         $this->activeThemeFetched = true;
     }
     return $this->activeTheme;
 }