-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
41 lines (33 loc) · 1.04 KB
/
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
<?php
/**
* NunezEngine
* Micro-framework for rapid web application development.
*
* @author Raymond Nunez <[email protected]>
* @version v0.1
*/
error_reporting(E_ALL);
try {
// Bootstrap
$initPath = './init.php';
if (!file_exists($initPath)) {
throw new \Exception('Fatal Error:/init.php is missing.');
} else {
require_once './init.php';
}
// Include NunezEngine
$nePath = SYSTEM_PATH . DS . 'NunezEngine.php';
if (!file_exists($nePath)) {
throw new \Exception('Fatal Error: SYSTEM_PATH/NunezEngine.php is missing.');
} else {
require_once $nePath;
$Engine = new Engine($Config);
// Dispatch request
$q = (isSet($_GET['q']) ? $_GET['q'] : '');
$Engine->Router->dispatch($q);
$Engine->Logger->log($Engine);
$Engine->Logger->display();
}
} catch (\Exception $e) {
echo '<p style="border: 1px solid #333; padding: 5px;">Caught exception: '. $e->getMessage() .' on file '. $e->getFile() .', line '. $e->getLine() .'.</p>';
}