/**
  * @return AbstractConfDriver
  */
 public function getConfImpl()
 {
     if (!isset(self::$confImpl) || isset($this->pluginConf["UNIQUE_INSTANCE_CONFIG"]["instance_name"]) && self::$confImpl->getId() != $this->pluginConf["UNIQUE_INSTANCE_CONFIG"]["instance_name"]) {
         if (isset($this->pluginConf["UNIQUE_INSTANCE_CONFIG"])) {
             self::$confImpl = ConfService::instanciatePluginFromGlobalParams($this->pluginConf["UNIQUE_INSTANCE_CONFIG"], "AbstractConfDriver");
             AJXP_PluginsService::getInstance()->setPluginUniqueActiveForType("conf", self::$confImpl->getName());
         }
     }
     return self::$confImpl;
 }
Exemplo n.º 2
0
 /**
  * @return AbstractCacheDriver
  */
 public function cachePluginSoftLoad()
 {
     $coreConfigs = array();
     $corePlug = AJXP_PluginsService::getInstance()->softLoad("core.cache", array());
     CoreConfLoader::loadBootstrapConfForPlugin("core.cache", $coreConfigs);
     if (!empty($coreConfigs)) {
         $corePlug->loadConfigs($coreConfigs);
     }
     return $corePlug->getCacheImpl();
 }
Exemplo n.º 3
0
 /**
  * @param String $pluginId
  * @param String $options
  */
 public function _savePluginConfig($pluginId, $options)
 {
     $jsonData = CoreConfLoader::getBootstrapConf();
     if (!is_array($jsonData)) {
         $jsonData = array();
     }
     $jsonData[$pluginId] = $options;
     if ($pluginId == "core.conf" || $pluginId == "core.auth" || $pluginId == "core.cache") {
         $testKey = $pluginId == "core.conf" || $pluginId == "core.cache" ? "UNIQUE_INSTANCE_CONFIG" : "MASTER_INSTANCE_CONFIG";
         $current = array();
         $this->_loadPluginConfig($pluginId, $current);
         if (isset($current[$testKey]["instance_name"]) && $current[$testKey]["instance_name"] != $options[$testKey]["instance_name"]) {
             $forceDisconnexion = $pluginId;
         }
     }
     CoreConfLoader::saveBootstrapConf($jsonData);
     if (isset($forceDisconnexion)) {
         if ($pluginId == "core.conf") {
             // DISCONNECT
             AuthService::disconnect();
         } else {
             if ($pluginId == "core.auth") {
                 // DELETE admin_counted file and DISCONNECT
                 @unlink(AJXP_CACHE_DIR . "/admin_counted");
             }
         }
     }
 }