forked from albertogcatalan/product-hunt-clone
/
index.php
55 lines (41 loc) · 1.16 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
<?php
/*
* Copyright (c) 2014 Alberto González
* Distributed under MIT License
* (see README for details)
*/
namespace Quaver;
ini_set('display_errors', 0);
// Check config file
if ( !file_exists('./Quaver/Config.php') || !file_exists('./Quaver/Autoloader.php')) {
$msg = "This instance of app doesn't seem to be configured, please read the deployment guide, configure and try again.";
error_log($msg);
echo "<h1>{$msg}</h1>";
die;
}
// Autoloader
require_once('./Quaver/Autoloader.php');
// Load configuration
require_once('./Quaver/Config.php');
// Check dev mode
if (defined('DEV_MODE')) {
if (DEV_MODE) {
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);
ini_set('display_errors', 1);
}
}
// Load other main classes
require_once('./Quaver/Core/DB.php');
require_once('./Quaver/Core/Core.php');
// Load YAML Parser
require_once('./Quaver/Lib/yaml/vendor/autoload.php');
// Check maintenance
if (defined(MAINTENANCE_MODE) && MAINTENANCE_MODE === true && $_SERVER['REQUEST_URI'] != '/maintenance') {
header('Location: /maintenance');
exit;
}
use Quaver\Core\Core;
// Init core
$core = new Core;
$core->start();
?>