-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
73 lines (63 loc) · 2.95 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
namespace Framework;
require __DIR__ . '/vendor/autoload.php';
require __DIR__ . '/vendor/aws-autoloader.php';
session_start();
/** Define the correct and incorrect seperators */
define('DSEP', DIRECTORY_SEPARATOR);
define('RSEP', ((DSEP === '/') ? '\\' : '/'));
/**
* Return a path with the correct platform directory seperators
* @param string $path Path before conversion to platform specific seperators
* @return string Path after conversion to platform specific seperators
*/
function _FixPath($path){
return str_replace(RSEP, DSEP, $path);
}
/**
* Include a file with the correct separators and the correct method enabling exceptions
* @param string $path Path before conversion to platform specific seperators
* @return void
* @uses \Framework\_FixPath()
*/
function _IncludeCorrect($path)
{ include_once _FixPath($path); }
/** Setup the base defines to get us running */
define("WEB_ROOT", dirname(__DIR__) . DSEP);
define("FRAMEWORK_ROOT", __DIR__ . DSEP);
define("FRAMEWORK_SUPPORT", FRAMEWORK_ROOT . "Support" . DSEP);
define("FRAMEWORK_ABSTRACT", FRAMEWORK_SUPPORT . "Abstracts" . DSEP);
define("FRAMEWORK_INTERFACE", FRAMEWORK_SUPPORT . "Interfaces" . DSEP);
define("FRAMEWORK_OBJECT", FRAMEWORK_SUPPORT . "Object" . DSEP);
define("FRAMEWORK_APPLICATION", FRAMEWORK_ROOT . "Application" . DSEP);
define("CONFIGURATION_ROOT", FRAMEWORK_ROOT . 'Configuration' . DSEP);
define("LOG_DIRECTORY", FRAMEWORK_ROOT . "Logs" . DSEP);
ini_set('display_errors', 0);
_IncludeCorrect(FRAMEWORK_ROOT."Exceptional".DSEP."ExceptionInterface.php");
_IncludeCorrect(FRAMEWORK_ROOT."Exceptional".DSEP."BaseException.php");
_IncludeCorrect(FRAMEWORK_ROOT."Exceptional".DSEP."StandardExceptions.php");
_IncludeCorrect(FRAMEWORK_ROOT."Exceptional".DSEP."StandardFaults.php");
_IncludeCorrect(FRAMEWORK_ROOT."Exceptional".DSEP."Handler.php");
_IncludeCorrect(FRAMEWORK_ROOT."Event".DSEP."Autoload.php");
_IncludeCorrect(FRAMEWORK_ROOT."Core".DSEP."Core.php");
_IncludeCorrect(FRAMEWORK_ROOT."Modulus".DSEP."Mysql.interface.php");
_IncludeCorrect(FRAMEWORK_ROOT."Modulus".DSEP."PDOdatabases.php");
_IncludeCorrect(FRAMEWORK_ROOT."Modulus".DSEP."Query.php");
_IncludeCorrect(FRAMEWORK_ROOT."Core".DSEP."Architect.php");
_IncludeCorrect(FRAMEWORK_ROOT."Core".DSEP."Contour.php");
_IncludeCorrect(FRAMEWORK_ROOT."Core".DSEP."Receptionist.php");
_IncludeCorrect(FRAMEWORK_ROOT."Core".DSEP."Admit.php");
_IncludeCorrect(FRAMEWORK_ROOT."Core".DSEP."Euri.php");
_IncludeCorrect(FRAMEWORK_ROOT."Core".DSEP."Advent.php");
_IncludeCorrect(FRAMEWORK_ROOT."Core".DSEP."Fiolos.php");
/** Set the exception handlers */
set_error_handler( array('Framework\Exceptional\Handler', 'StandardException') );
register_shutdown_function( array('Framework\Exceptional\Handler', 'FatalException') );
/** Let the Architect take it from here */
try {
$Architect = \Framework\Core\Architect::getInstance ();
$Architect->run ();
} catch ( \Framework\Exceptional\BaseException $exception ){
print_r($exception);
exit();
}