forked from hernantas/MangaReader
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.php
105 lines (92 loc) · 2.88 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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php
/**
* PHP Code Enhancement Framework
*
* PHP Code Enhancement or PCE in short is small project (part of Code Enhancement
* project) created to help making web application using PHP easier and more
* efficient by writing less. PCE purpose is to provide class and method so
* developer will write less code, manage their code better and can share code
* with other easily. PCE will be modular as much as possible by splitting project
* or package into it own directory and can be integrated into website application
* easily.
*
* @copyright Hernantas 2016
* @license MIT
* @link http://www.hernantas.com
*/
/**
* Core Configuration
*
* BECAREFUL WHEN MODIFYING BELLOW THIS LINE.
*
* This is core configuration to determine basic behaviour such as environment
* settings, framework location and default app location. Invalid configuration
* will break the project.
*/
/**
* Project environment settings.
*
* @var string
*/
$environment = 'development';
/**
* Path to System directory where framework vendor is located.
*
* @var string
*/
$systemPath = 'system';
/**
* Path to App directory where your application vendor is located.
*
* @var string
*/
$appPath = 'app';
/**
* Path to Public directory where your public files is located (CSS, JS, Images, etc).
*
* @var string
*/
$publicPath = 'public';
/**
* STOP, DO NOT MODIFY BELLOW THIS LINE.
*
* This is the end of core configuration.
*/
/**
* Set PHP error reporting based on environment settings.
*/
switch ($environment)
{
case 'development':
error_reporting(-1);
break;
case 'testing':
case 'release':
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
break;
default:
header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
echo 'The application environment isn\'t correctly configured.';
exit(1); // EXIT_ERROR
}
/**
* Clean and fix path variable.
*/
$systemPath = rtrim(str_replace('\\', '/', $systemPath),'/') . '/';
$appPath = rtrim(str_replace('\\', '/', $appPath),'/') . '/';
$publicPath = rtrim(str_replace('\\', '/', $publicPath),'/') . '/';
/**
* GLOBAL CONSTANT
*
* Define global constant variable for later use.
*/
define('ENVIRONMENT', $environment);
define('BASE_PATH', rtrim(str_replace('\\', '/', dirname(__FILE__)),'/') . '/');
define('SYSTEM_PATH', $systemPath);
define('APP_PATH', $appPath);
define('PUBLIC_PATH', $publicPath);
/**
* Begin Bootstraping neccessary file.
*/
require(SYSTEM_PATH . 'core/core.php');
?>