/**
  * Getter for {@see $_backendConfiguration}
  * 
  * @param boolean $_getConfiguredBackend
  * @return mixed [If {@param $_key} is set then only the specified option is returned, otherwise the whole options hash]
  */
 public static function getBackendConfiguration($_key = null, $_default = null)
 {
     //lazy loading for $_backendConfiguration
     if (!isset(self::$_backendConfiguration)) {
         if (Tinebase_Application::getInstance()->isInstalled('Tinebase')) {
             $rawBackendConfiguration = Tinebase_Config::getInstance()->get(Tinebase_Config::AUTHENTICATIONBACKEND, new Tinebase_Config_Struct())->toArray();
         } else {
             $rawBackendConfiguration = array();
         }
         self::$_backendConfiguration = is_array($rawBackendConfiguration) ? $rawBackendConfiguration : Zend_Json::decode($rawBackendConfiguration);
         if (!empty(self::$_backendConfiguration['password'])) {
             Tinebase_Core::getLogger()->getFormatter()->addReplacement(self::$_backendConfiguration['password']);
         }
     }
     if (isset($_key)) {
         return isset(self::$_backendConfiguration[$_key]) || array_key_exists($_key, self::$_backendConfiguration) ? self::$_backendConfiguration[$_key] : $_default;
     } else {
         return self::$_backendConfiguration;
     }
 }
Ejemplo n.º 2
0
 /**
  * Getter for {@see $_backendConfiguration}
  * 
  * @param boolean $_getConfiguredBackend
  * @return mixed [If {@param $_key} is set then only the specified option is returned, otherwise the whole options hash]
  */
 public static function getBackendConfiguration($_key = null, $_default = null)
 {
     //lazy loading for $_backendConfiguration
     if (!isset(self::$_backendConfiguration)) {
         if (Setup_Controller::getInstance()->isInstalled('Tinebase')) {
             $rawBackendConfiguration = Tinebase_Config::getInstance()->getConfig(Tinebase_Config::AUTHENTICATIONBACKEND, null, array())->value;
         } else {
             $rawBackendConfiguration = array();
         }
         self::$_backendConfiguration = is_array($rawBackendConfiguration) ? $rawBackendConfiguration : Zend_Json::decode($rawBackendConfiguration);
     }
     if (isset($_key)) {
         return array_key_exists($_key, self::$_backendConfiguration) ? self::$_backendConfiguration[$_key] : $_default;
     } else {
         return self::$_backendConfiguration;
     }
 }