This repository has been archived by the owner on Oct 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.php
91 lines (75 loc) · 2.88 KB
/
bootstrap.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
/**
* Created by JetBrains PhpStorm.
* User: hugozonderland
* Date: 26-05-13
* Time: 16:28
* Boostrap file. Sets enviroment variables
*/
session_start();
ob_start();
// Global used variables
define('WEBSITE_URL', 'http://product.esser-emmerik.hugozonderland.nl/');
define('DOCUMENT_ROOT', '/home/ocrtxndf/domains/hugozonderland.nl/public_html/product.esser-emmerik/');
define('CONFIG_ROOT', DOCUMENT_ROOT . 'App_Config/');
define('TMP_ROOT', DOCUMENT_ROOT . 'Temporary/');
define('LOG_ROOT', TMP_ROOT . 'Logs/');
define('SESSION_ROOT', TMP_ROOT . 'Sessions');
// Model and controller root
define('MODEL_ROOT', DOCUMENT_ROOT . 'Model/');
define('CONTROLLER_ROOT', DOCUMENT_ROOT . 'Controller/');
define('LIBRARY_ROOT', DOCUMENT_ROOT . 'Library/');
define('HELPER_ROOT', DOCUMENT_ROOT . 'Helper/');
// Used for the templates
define('VIEW_ROOT', DOCUMENT_ROOT . 'View/');
define('SHARED_ROOT', VIEW_ROOT . 'Shared/');
// Includes made from the browser side
define('CSS_ROOT', WEBSITE_URL . 'css/');
define('IMAGE_ROOT', WEBSITE_URL . 'images/');
define('JAVASCRIPT_ROOT', WEBSITE_URL . 'javascript/');
// Includes made from the server/code side
define('HTML_ROOT', DOCUMENT_ROOT . 'Static/html/');
// We always want logs, we LOVE logs!
ini_set('log_errors', 1);
ini_set('error_log', LOG_ROOT . 'error.log');
// Load the debug helper first
include_once(HELPER_ROOT . 'Debug_function.php');
// Load the Library config + helper
include_once(CONFIG_ROOT . 'Library_config.php');
include_once(HELPER_ROOT . 'Library_function.php');
// Load the Database config + load the library + inits + load helper the connection
include_once(CONFIG_ROOT . 'Db_config.php');
Library::load('RedBeanPHP');
R::setup('mysql:host=' . DB_HOST . ';dbname=' . DB_NAME . '', '' . DB_USERNAME . '', '' . DB_PASS . '');
// Production/Debug
define('STATUS', 'development');
// Setting various settings according to status
switch (STATUS) {
case 'production':
{
ini_set('display_errors', 0);
define('OUTPUT_DEBUG', false);
R::debug(false);
R::freeze(true);
}
case 'development':
{
error_reporting(E_ALL);
ini_set('display_errors', 1);
define('OUTPUT_DEBUG', true);
//R::debug(true);
}
}
// Load the Google API Client config, library and helper
include_once(CONFIG_ROOT . 'Google_API_Client_config.php');
Library::load('Google_API_Client');
Library::load('Google_Analytics_Service');
Library::load('Google_Oauth2Service');
// Load the route config + helper + controller
include_once(CONTROLLER_ROOT . 'Route_Controller.php');
include_once(MODEL_ROOT . 'Route_Model.php');
include_once(CONFIG_ROOT . 'Route_config.php');
include_once(HELPER_ROOT . 'Route_function.php');
// Main_Controller
include_once CONTROLLER_ROOT . 'Main_Controller.php';
?>