Пример #1
0
 /**
  * Configures modules of this application before they are initialized
  *
  * @param SiteConfigModule $config the config module of this application to
  *                                  use for configuration other modules.
  */
 protected function configure(SiteConfigModule $config)
 {
     parent::configure($config);
     if (isset($config->exceptions->log_location)) {
         SwatException::setLogger(new SiteExceptionLogger($config->exceptions->log_location, $config->exceptions->base_uri, $config->email->logging_address));
     }
     if (isset($config->errors->log_location)) {
         SwatError::setLogger(new SiteErrorLogger($config->errors->log_location, $config->errors->base_uri, $config->email->logging_address));
     }
     SwatForm::$default_salt = $config->swat->form_salt;
     $this->database->dsn = $config->database->dsn;
     $this->setBaseUri($config->uri->base);
     $this->setSecureBaseUri($config->uri->secure_base);
     $this->default_time_zone = new Date_TimeZone($config->date->time_zone);
     $this->analytics->setGoogleAccount($config->analytics->google_account);
 }
Пример #2
0
 /**
  * Configures modules of this application before they are initialized
  *
  * @param SiteConfigModule $config the config module of this application to
  *                                  use for configuration other modules.
  */
 protected function configure(SiteConfigModule $config)
 {
     parent::configure($config);
     SwatForm::$default_salt = $config->swat->form_salt;
     $this->database->dsn = $config->database->dsn;
     $this->setBaseUri($config->uri->base);
     $this->setSecureBaseUri($config->uri->secure_base);
     $this->default_time_zone = new HotDateTimeZone($config->date->time_zone);
     setlocale(LC_ALL, $config->i18n->locale);
     if (isset($this->memcache)) {
         $this->memcache->server = $config->memcache->server;
         $this->memcache->app_ns = $config->memcache->app_ns;
     }
 }