Example #1
0
 public function __construct()
 {
     $this->emailConfig = Config::get('global.config', 'emailConfiguration');
     try {
         Application::import('vendor' . DS . $this->emailConfig['swift_mailer_path']);
     } catch (Exception $ex) {
         throw new Exception($ex->getMessage());
     }
     //set transport type protocol
     $this->setTransportType($this->emailConfig['protocol']);
 }
Example #2
0
 /**
  * @return bool
  */
 public function terminate()
 {
     /**------------------------------------------------------------------
      * Throw Exception is default controller
      * has not been set in configuration
      * ------------------------------------------------------------------
      */
     if (is_null(Config::get('global.config', "default_controller"))) {
         trigger_error("Default controller not found ! Please set the default\n                            controller in configs/application" . EXT);
     }
     Application::import(APPPATH . '.routes');
 }
Example #3
0
 /**
  * @return bool
  */
 public function terminate()
 {
     /**-------------------------------------------------------------------
      * Check if it is running via cli and return false
      * -------------------------------------------------------------------
      */
     $filename = preg_replace('#(\\?.*)$#', '', $_SERVER['REQUEST_URI']);
     if (php_sapi_name() === 'cli-server' && is_file($filename)) {
         return false;
     }
     Application::import('apps.routes');
 }