Example #1
0
 /**
  * Setup configuration
  *
  * Load config.ini.php
  * translate to foundation config
  * create absolute path
  * set defautl timezone
  */
 protected function setupConfiguration()
 {
     $this->_config = new \Jazzee\Configuration();
     $this->_foundationConfig = new \Foundation\Configuration();
     if ($this->_config->getStatus() == 'DEVELOPMENT') {
         $this->_foundationConfig->setCacheType('array');
     } else {
         $this->_foundationConfig->setCacheType('apc');
     }
     $this->_foundationConfig->setMailSubjectPrefix($this->_config->getMailSubjectPrefix());
     $this->_foundationConfig->setMailDefaultFromAddress($this->_config->getMailDefaultFromAddress());
     $this->_foundationConfig->setMailDefaultFromName($this->_config->getMailDefaultFromName());
     $this->_foundationConfig->setMailOverrideToAddress($this->_config->getMailOverrideToAddress());
     $this->_foundationConfig->setMailServerType($this->_config->getMailServerType());
     $this->_foundationConfig->setMailServerHost($this->_config->getMailServeHost());
     $this->_foundationConfig->setMailServerPort($this->_config->getMailServerPort());
     $this->_foundationConfig->setMailServerUsername($this->_config->getMailServerUsername());
     $this->_foundationConfig->setMailServerPassword($this->_config->getMailServerPassword());
     \Foundation\VC\Config::setCache(self::getCache());
     if (empty($_SERVER['HTTPS']) or $_SERVER['HTTPS'] == 'off') {
         $protocol = 'http';
     } else {
         $protocol = 'https';
     }
     if (in_array($_SERVER['SERVER_PORT'], array('80', '443'))) {
         $port = '';
     } else {
         $port = ':' . $_SERVER['SERVER_PORT'];
     }
     $this->_serverPath = $protocol . '://' . $_SERVER['SERVER_NAME'] . $port;
     \Jazzee\Globals::setConfig($this->_config);
 }