Exemple #1
0
 /**
  * IPugin interface impl.
  *
  * setup() must be called before load
  *
  * @error 15404
  * @return integer Returns error code due to the initialization.
  */
 function setup()
 {
     //extract service configuration
     $this->serviceConfig = xapp_get_option(self::SERVICE_CONF, $this);
     //logging
     if (xapp_is_option(self::LOGGING_CONF, $this) && $this->serviceConfig) {
         $logConfig = xapp_get_option(self::SERVICE_CONF);
         if ($logConfig && $logConfig[XC_CONF_LOGGER] != null) {
             $this->logger = $logConfig[XC_CONF_LOGGER];
         } else {
             //setup logger
         }
     }
     //cache
     if (xapp_is_option(self::CACHE_CONF, $this) && $this->serviceConfig) {
         $cacheConfig = xapp_get_option(self::CACHE_CONF);
         if ($cacheConfig) {
             $this->cache = Xapp_Cache::instance($this->CACHE_NS, "file", array(Xapp_Cache_Driver_File::PATH => xapp_get_option(XC_CONF_CACHE_PATH, $this->serviceConfig), Xapp_Cache_Driver_File::CACHE_EXTENSION => $this->CACHE_NS, Xapp_Cache_Driver_File::DEFAULT_EXPIRATION => 200));
         }
     }
 }
Exemple #2
0
 private function setup()
 {
     $this->serviceConfig = xapp_get_option(self::SERVICE_CONF, $this);
     //cache
     if (xapp_is_option(self::CACHE_CONF, $this) && $this->serviceConfig) {
         $cacheConfig = xapp_get_option(self::CACHE_CONF);
         if ($cacheConfig) {
             $this->cache = Xapp_Cache::instance("PluginManager", "file", array(Xapp_Cache_Driver_File::PATH => xapp_get_option(XC_CONF_CACHE_PATH, $this->serviceConfig), Xapp_Cache_Driver_File::CACHE_EXTENSION => "pmmanager", Xapp_Cache_Driver_File::DEFAULT_EXPIRATION => 200));
         }
     }
 }