Example #1
0
 public function home()
 {
     $response = WFERouter::run(new WFERequest('GET', 'do', array('parameter' => 'BLA')));
     $response = new WFEResponse();
     $response->setContent(WFETemplate::render());
     return $response;
 }
Example #2
0
 /**
  * Alias to re-routes to a 500 error page
  */
 public static function run500()
 {
     $response = WFERouter::run(new WFERequest('GET', 'WFE500'));
     $response->send();
 }
Example #3
0
set_exception_handler(function (Exception $e) {
    if (WFEConfig::get('env') == 'dev') {
        exit($e->getMessage());
    } elseif (WFEConfig::get('env') == 'prod') {
        $response = WFERouter::run(new WFERequest('GET', 'WFE500'));
        $response->send();
    }
});
// Register autoload
WFEAutoload::register(__NAMESPACE__);
// Load main config
WFELoader::load('app/config/config.php');
// Load Database
\core\ORM\WFEDb::connect();
// Load smarty
WFELoader::load('core/libs/smarty/Smarty.class.php');
// set environment spec
if (WFEConfig::get('env') == 'dev') {
    error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_ALL);
} elseif (WFEConfig::get('env') == 'prod') {
    error_reporting(0);
} else {
    throw new WFEDefinitionException('Config settings env is not set properly (must be dev or prod)');
}
// init session
WFEsession::init();
// init request data
$request = new WFERequest();
// Routes request and get response
WFERouter::run($request);