-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
46 lines (38 loc) · 984 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* PHP Version 7.2
*
* @category Router
* @package SimplePHPOOPMvc
* @author Orlando J Betancourth <orlando.betancourth@gmail.com>
* @license MIT http://
* @version CVS:1.0.0
* @link http://
*/
use Utilities\Context;
use Utilities\Site;
require_once "autoloader.php";
require __DIR__ . '/vendor/autoload.php';
session_start();
\Utilities\Site::configure();
$pageRequest = \Utilities\Site::getPageRequest();
try {
$instance = new $pageRequest();
$instance->run();
die();
} catch(\Controllers\PrivateNoAuthException $ex){
$instance = new \Controllers\NoAuth();
$instance->run();
die();
} catch(\Controllers\PrivateNoLoggedException $ex){
$redirTo = urlencode(\Utilities\Context::getContextByKey("request_uri"));
\Utilities\Site::redirectTo("index.php?page=sec.login&redirto=".$redirTo);
die();
} catch(Error $ex)
{
error_log($ex);
$instance = new \Controllers\Error();
$instance->run();
die();
}
?>