forked from AccessAtECS/Project-REALISE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
39 lines (29 loc) · 874 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
<?php
try {
// Start the application
require_once("app/bootstrap.php");
$request = isset($_GET['p']) && $_GET['p'] != "/" ? $_GET['p'] : SYS_DEFAULTCNTRLR;
// Generate the superview.
$superview = new view('superview');
// Create a new despatcher object.
$despacher = new despatcher(function_exists('getRuntimeObjects') ? getRuntimeObjects() : array());
// Set the superview
$despacher->setSuperview($superview);
$despacher->request($request);
} catch(Exception $e){
// Try and use a builtin handler.
$Vault = Vault::singleton();
$handler = $Vault->objects("exceptionHandler");
switch( $e->getCode() ){
case 404:
// Page is not found, load the default controller.
$despacher->setSuperview($superview);
$despacher->request(SYS_DEFAULTCNTRLR . "/" . $request);
break;
default:
echo $e->getMessage();
exit;
break;
}
}
?>