-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.php
More file actions
51 lines (44 loc) · 1.45 KB
/
init.php
File metadata and controls
51 lines (44 loc) · 1.45 KB
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
<?php
/**
* init.php
*
* The purpose of this file is to have a sequence of events that
* will always take place before any other classes or functions
* start loading. Its basically Gandalf, if you don't meet these
* requirements, "YOU SHALL NOT PASS".
*
* @version 2.0
* @author Joey Kimsey <JoeyKimsey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
*/
namespace TheTempusProject;
use TempusProjectCore\Classes\Debug;
use TempusProjectCore\Functions\Routes;
use TempusProjectCore\Classes\Redirect;
// session_start();
define('APP_SPACE', __NAMESPACE__);
$mods = apache_get_modules();
if (!in_array('mod_rewrite', $mods)) {
echo file_get_contents('App/Views/Errors/Rewrite.php');
exit();
}
if (!file_exists('vendor/autoload.php')) {
echo file_get_contents('views/errors/composer.php');
exit();
}
require_once 'vendor/autoload.php';
// set_exception_handler('TempusProjectCore\\Functions\\ExceptionHandler::ExceptionHandler');
/**
* This will check for the htaccess file since it controls
* the routing of the site. If not found it will redirect to
* our error page for a broken installation.
*
* @todo - Deal with this differently.
*/
$htaccessPath = Routes::getFull().'.htaccess';
$installPath = Routes::getFull().'install.php';
if (!file_exists($htaccessPath) && !file_exists($installPath)) {
echo file_get_contents('App/Views/Errors/533.php');
exit();
}