Ejemplo n.º 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);
 }
Ejemplo n.º 2
0
 /**
  * Constructor
  * 
  * Setup the server configuration in the construcor
  */
 public function __construct(\Foundation\Configuration $config)
 {
     $this->exceptions = true;
     parent::__construct(true);
     $this->subjectPrefix = $config->getMailSubjectPrefix();
     switch ($config->getMailServerType()) {
         case 'php':
             //we don't need to do any addtional setup for PHP mail
             break;
         case 'sendmail':
             $this->IsSendmail();
             break;
         case 'smtp+ssl':
             $this->SMTPSecure();
             //added secure but continue with smtp
         //added secure but continue with smtp
         case 'smtp':
             $this->IsSMTP();
             $this->Host = $config->getMailServerHost();
             if ($config->getMailServerPort()) {
                 $this->Port = $config->getMailServerPort();
             }
             if ($config->getMailServerUsername()) {
                 $this->SMTPAuth();
                 $this->Username = $config->getMailServerUsername();
                 $this->Password = $config->getMailServerPassword();
             }
             break;
     }
     //set the from address to the default and override it later
     if ($config->getMailDefaultFromAddress()) {
         $this->SetFrom($config->getMailDefaultFromAddress(), $config->getMailDefaultFromName(), false);
     }
     if ($config->getMailOverrideToAddress()) {
         $this->AddAddress($config->getMailOverrideToAddress(), $config->getMailOverrideToName());
         $this->isToOverridden = true;
     }
 }
Ejemplo n.º 3
0
 *
 * Load all of the Views, Controllers, and Elements
 * @author  Jon Johnson  <*****@*****.**>
 * @license http://jazzee.org/license BSD-3-Clause
 */
//If the composer autoloader hasn't been loaded then load it here
//We do it this way in case Jazzee has been built as a composer app into another app
if (!class_exists('Composer\\Autoload\\ClassLoader', false)) {
    require __DIR__ . '/../vendor/autoload.php';
}
//Setup the Lvc options
\Foundation\VC\Config::addControllerPath(__DIR__ . '/controllers/');
\Foundation\VC\Config::addControllerViewPath(__DIR__ . '/views/');
\Foundation\VC\Config::addLayoutViewPath(__DIR__ . '/views/layouts/');
\Foundation\VC\Config::addElementViewPath(__DIR__ . '/views/elements/');
\Foundation\VC\Config::addElementViewPath(\Foundation\Configuration::getSourcePath() . '/src/elements/');
//Load apply controllers and views
\Foundation\VC\Config::addControllerPath(__DIR__ . '/controllers/apply/');
\Foundation\VC\Config::addControllerViewPath(__DIR__ . '/views/apply/');
//Load admin controllers and views
\Foundation\VC\Config::addControllerPath(__DIR__ . '/controllers/admin/');
\Foundation\VC\Config::addControllerViewPath(__DIR__ . '/views/admin/');
//Load manage controllers and views
\Foundation\VC\Config::addControllerPath(__DIR__ . '/controllers/manage/');
\Foundation\VC\Config::addControllerViewPath(__DIR__ . '/views/manage/');
//Load payments controllers and views
\Foundation\VC\Config::addControllerPath(__DIR__ . '/controllers/payments/');
\Foundation\VC\Config::addControllerViewPath(__DIR__ . '/views/payments/');
//Load setup controllers and views
\Foundation\VC\Config::addControllerPath(__DIR__ . '/controllers/setup/');
\Foundation\VC\Config::addControllerViewPath(__DIR__ . '/views/setup/');