Ejemplo n.º 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));
     }
     if (isset($config->errors->log_location)) {
         SwatError::setLogger(new SiteErrorLogger($config->errors->log_location, $config->errors->base_uri));
     }
     if ($config->date->time_zone !== null) {
         $this->default_time_zone = new DateTimeZone($config->date->time_zone);
     }
     $this->default_locale = $config->i18n->locale;
     setlocale(LC_ALL, $config->i18n->locale . '.UTF-8');
     $this->memcache->server = $config->memcache->server;
     $this->memcache->app_ns = $config->memcache->app_ns;
 }
Ejemplo n.º 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);
     $this->addComponentIncludePath('Blorg/admin/components', 'Blorg');
     $this->addComponentIncludePath('Site/admin/components', 'Site');
     if (isset($config->exceptions->log_location)) {
         SwatException::setLogger(new SiteExceptionLogger($config->exceptions->log_location, $config->exceptions->base_uri));
     }
     if (isset($config->errors->log_location)) {
         SwatError::setLogger(new SiteErrorLogger($config->errors->log_location, $config->errors->base_uri));
     }
     SwatForm::$default_salt = $config->swat->form_salt;
     $this->database->dsn = $config->database->dsn;
     $this->setBaseUri($config->uri->base . 'admin/');
     $this->setSecureBaseUri($config->uri->secure_base . 'admin/');
     $this->cookie->setSalt($config->cookies->salt);
     $this->default_time_zone = new HotDateTimeZone($config->date->time_zone);
     $this->default_locale = $config->i18n->locale;
     $config->session->name .= '-' . $_GET['instance'];
     if (isset($this->memcache)) {
         $this->memcache->server = $config->memcache->server;
         $this->memcache->app_ns = $config->memcache->app_ns;
     }
 }
Ejemplo n.º 3
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);
 }
Ejemplo n.º 4
0
    PackageConfig::addPackage('site');
    PackageConfig::addPackage('admin');
    PackageConfig::addPackage('pinhole');
}
require_once 'Swat/exceptions/SwatException.php';
require_once 'Site/SiteExceptionLogger.php';
require_once 'Swat/SwatError.php';
require_once 'Site/SiteErrorLogger.php';
require_once 'Pinhole/Pinhole.php';
require_once 'Pinhole/admin/PinholeAdminApplication.php';
$app = new PinholeAdminApplication('pinholedemoadmin');
$config_filename = dirname(__FILE__) . '/../../demo.ini';
$app->config->setFilename($config_filename);
$app->config->load();
if (isset($app->config->exceptions->log_location)) {
    SwatException::setLogger(new SiteExceptionLogger($app->config->exceptions->log_location, $app->config->exceptions->base_uri));
}
if (isset($app->config->errors->log_location)) {
    SwatError::setLogger(new SiteErrorLogger($app->config->errors->log_location, $app->config->errors->base_uri));
}
$app->database->dsn = $app->config->database->dsn;
$app->setBaseUri($app->config->uri->base . 'admin/');
$app->setSecureBaseUri($app->config->uri->secure_base . 'admin/');
$app->title = 'Pinhole Demo Admin';
$app->setFrontSource('Front');
$app->addComponentIncludePath('Pinhole/admin/components', 'Pinhole');
$app->addComponentIncludePath('WebStats/admin/components', 'WebStats');
$app->default_locale = 'en_CA.UTF8';
$app->default_time_zone = new Date_TimeZone($app->config->default_time_zone);
$app->session->setSavePath($app->config->session_dir . '/' . $app->id);
$app->run();