-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
34 lines (24 loc) · 784 Bytes
/
index.php
File metadata and controls
34 lines (24 loc) · 784 Bytes
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
<?php
date_default_timezone_set('UTC');
define('ROOT_DIR', $_SERVER['DOCUMENT_ROOT']);
require_once ROOT_DIR . '/vendor/autoload.php';
use engine\Engine;
$isPhpVersionUnsuppurted = version_compare($currentVersion = phpversion(), $requiredVersion = Engine::PHP_MIN, '<');
if ($isPhpVersionUnsuppurted) {
$errorMessage = "
<div style=\"position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);width:100%;text-align:center;\">
<h1>" . Engine::NAME . "</h1>
<p>
Your server is running <b>PHP $currentVersion</b> version,
the system requires at least <b>PHP $requiredVersion</b>.
</p>
</div>
";
exit($errorMessage);
}
try {
Engine::start();
} catch (\ErrorException $error) {
echo $error->getMessage();
}
Engine::stop();