-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.ph7
47 lines (38 loc) · 1.1 KB
/
init.ph7
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
<?php
/**
* @title Index
* @desc Index file for public root.
*
* @author Pierre-Henry Soria <hello@ph7cms.com>
* @copyright (c) 2011-2019, Pierre-Henry Soria. All Rights Reserved.
* @license See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
* @link http://ph7cms.com
* @package PH7 / ROOT
*/
namespace PH7;
define('PH7', 1);
use RuntimeException;
require __DIR__ . '/WebsiteChecker.php';
$oSiteChecker = new WebsiteChecker();
try {
$oSiteChecker->checkPhpVersion();
if (!$oSiteChecker->doesConfigFileExist()) {
if ($oSiteChecker->doesInstallFolderExist()) {
$oSiteChecker->clearBrowserCache();
$oSiteChecker->moveToInstaller();
} else {
echo $oSiteChecker->getNoConfigFoundMessage();
}
exit;
}
} catch (RuntimeException $oExcept) {
echo $oExcept->getMessage();
exit;
}
require __DIR__ . '/_constants.php';
require PH7_PATH_APP . 'Bootstrap.php';
$oApp = Bootstrap::getInstance();
$oApp->setTimezoneIfNotSet();
ob_start();
$oApp->run();
ob_end_flush();