@@ -2,10 +2,10 @@ |
||
2 | 2 | |
3 | 3 | # Mime types |
4 | 4 | |
5 | -define('MIME_TYPE_HTML', 'html'); |
|
6 | -define('MIME_TYPE_XML', 'xml'); |
|
7 | -define('MIME_TYPE_JSON', 'json'); |
|
5 | +define('MIME_TYPE_HTML', 'html'); |
|
6 | +define('MIME_TYPE_XML', 'xml'); |
|
7 | +define('MIME_TYPE_JSON', 'json'); |
|
8 | 8 | |
9 | -define('MIME_TYPE_JPEG', 'jpeg'); |
|
10 | -define('MIME_TYPE_PNG', 'png'); |
|
11 | -define('MIME_TYPE_GIF', 'gif'); |
|
9 | +define('MIME_TYPE_JPEG', 'jpeg'); |
|
10 | +define('MIME_TYPE_PNG', 'png'); |
|
11 | +define('MIME_TYPE_GIF', 'gif'); |
@@ -32,28 +32,28 @@ |
||
32 | 32 | |
33 | 33 | # Class load exception |
34 | 34 | |
35 | - class ClassLoad extends Exception { |
|
35 | + class ClassLoad extends Exception { |
|
36 | 36 | |
37 | 37 | protected $message = 'Class \'$value$\' not found'; |
38 | 38 | } |
39 | 39 | |
40 | 40 | # Database connect exception |
41 | 41 | |
42 | - class DBConnect extends Exception { |
|
42 | + class DBConnect extends Exception { |
|
43 | 43 | |
44 | 44 | protected $message = 'Unable to connect to database'; |
45 | 45 | } |
46 | 46 | |
47 | 47 | # Database select exception |
48 | 48 | |
49 | - class DBSelect extends Exception { |
|
49 | + class DBSelect extends Exception { |
|
50 | 50 | |
51 | 51 | protected $message = 'Unable to select database'; |
52 | 52 | } |
53 | 53 | |
54 | 54 | # Database charset exception |
55 | 55 | |
56 | - class DBCharset extends Exception { |
|
56 | + class DBCharset extends Exception { |
|
57 | 57 | |
58 | 58 | protected $message = 'Unable to set database charset'; |
59 | 59 | } |
@@ -2,24 +2,24 @@ |
||
2 | 2 | |
3 | 3 | # Define constants |
4 | 4 | |
5 | -define('DIR_FRAMEWORK', (dirname(__FILE__) . '/')); |
|
5 | +define('DIR_FRAMEWORK', (dirname(__FILE__).'/')); |
|
6 | 6 | |
7 | -define('DIR_CLASSES', (DIR_FRAMEWORK . 'Classes/')); |
|
8 | -define('DIR_DATA', (DIR_FRAMEWORK . 'Data/')); |
|
9 | -define('DIR_INCLUDES', (DIR_FRAMEWORK . 'Includes/')); |
|
10 | -define('DIR_TEMPLATES', (DIR_FRAMEWORK . 'Templates/')); |
|
7 | +define('DIR_CLASSES', (DIR_FRAMEWORK.'Classes/')); |
|
8 | +define('DIR_DATA', (DIR_FRAMEWORK.'Data/')); |
|
9 | +define('DIR_INCLUDES', (DIR_FRAMEWORK.'Includes/')); |
|
10 | +define('DIR_TEMPLATES', (DIR_FRAMEWORK.'Templates/')); |
|
11 | 11 | |
12 | 12 | # Require classes |
13 | 13 | |
14 | -require_once (DIR_FRAMEWORK . 'Engine.php'); |
|
15 | -require_once (DIR_FRAMEWORK . 'Exception.php'); |
|
14 | +require_once (DIR_FRAMEWORK.'Engine.php'); |
|
15 | +require_once (DIR_FRAMEWORK.'Exception.php'); |
|
16 | 16 | |
17 | 17 | # Require configuration |
18 | 18 | |
19 | -require_once (DIR_INCLUDES . 'Constants.php'); |
|
20 | -require_once (DIR_INCLUDES . 'Regex.php'); |
|
21 | -require_once (DIR_INCLUDES . 'Headers/Mime.php'); |
|
22 | -require_once (DIR_INCLUDES . 'Headers/Status.php'); |
|
19 | +require_once (DIR_INCLUDES.'Constants.php'); |
|
20 | +require_once (DIR_INCLUDES.'Regex.php'); |
|
21 | +require_once (DIR_INCLUDES.'Headers/Mime.php'); |
|
22 | +require_once (DIR_INCLUDES.'Headers/Status.php'); |
|
23 | 23 | |
24 | 24 | # Set defaults |
25 | 25 |
@@ -46,7 +46,7 @@ |
||
46 | 46 | |
47 | 47 | $number = number_format(($number / pow(1024, $exponent)), (($exponent < 2) ? $exponent : 2)); |
48 | 48 | |
49 | - return (floatval($number) . ' ' . $text); |
|
49 | + return (floatval($number).' '.$text); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | # ------------------------ |
@@ -12,7 +12,7 @@ |
||
12 | 12 | |
13 | 13 | public static function __autoload() { |
14 | 14 | |
15 | - self::init(DIR_DATA . 'Geo/Countries.php'); |
|
15 | + self::init(DIR_DATA.'Geo/Countries.php'); |
|
16 | 16 | } |
17 | 17 | } |
18 | 18 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | |
13 | 13 | public static function __autoload() { |
14 | 14 | |
15 | - self::init(DIR_DATA . 'Geo/Timezones.php'); |
|
15 | + self::init(DIR_DATA.'Geo/Timezones.php'); |
|
16 | 16 | } |
17 | 17 | } |
18 | 18 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | |
118 | 118 | public static function status(string $code) { |
119 | 119 | |
120 | - if (self::isStatusCode($code)) header(getenv('SERVER_PROTOCOL') . ' ' . self::$status_codes[$code]); |
|
120 | + if (self::isStatusCode($code)) header(getenv('SERVER_PROTOCOL').' '.self::$status_codes[$code]); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | # Send content header |
@@ -126,12 +126,12 @@ discard block |
||
126 | 126 | |
127 | 127 | if (self::isContentTypeText($type)) { |
128 | 128 | |
129 | - return header('Content-type: ' . self::$content_types_text[$type] . '; charset=UTF-8'); |
|
129 | + return header('Content-type: '.self::$content_types_text[$type].'; charset=UTF-8'); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | if (self::isContentTypeMedia($type)) { |
133 | 133 | |
134 | - return header('Content-type: ' . self::$content_types_media[$type]); |
|
134 | + return header('Content-type: '.self::$content_types_media[$type]); |
|
135 | 135 | } |
136 | 136 | } |
137 | 137 | |
@@ -143,13 +143,13 @@ discard block |
||
143 | 143 | |
144 | 144 | if (!in_array($limiter, [CACHE_LIMITER_PRIVATE, CACHE_LIMITER_PUBLIC], true)) return; |
145 | 145 | |
146 | - header('Expires: ' . gmdate('D, d M Y H:i:s', (REQUEST_TIME + $expires)) . ' GMT'); |
|
146 | + header('Expires: '.gmdate('D, d M Y H:i:s', (REQUEST_TIME + $expires)).' GMT'); |
|
147 | 147 | |
148 | - header('Last-Modified: ' . gmdate('D, d M Y H:i:s', REQUEST_TIME) . ' GMT'); |
|
148 | + header('Last-Modified: '.gmdate('D, d M Y H:i:s', REQUEST_TIME).' GMT'); |
|
149 | 149 | |
150 | - header('Cache-Control: ' . $limiter . ', max-age=' . $expires . ', pre-check=' . $expires); |
|
150 | + header('Cache-Control: '.$limiter.', max-age='.$expires.', pre-check='.$expires); |
|
151 | 151 | |
152 | - header('Pragma: ' . $limiter); |
|
152 | + header('Pragma: '.$limiter); |
|
153 | 153 | |
154 | 154 | # ------------------------ |
155 | 155 | |
@@ -162,9 +162,9 @@ discard block |
||
162 | 162 | |
163 | 163 | if (self::$cache_send) return; |
164 | 164 | |
165 | - header('Expires: ' . gmdate('D, d M Y H:i:s', strtotime('-1 day')) . ' GMT'); |
|
165 | + header('Expires: '.gmdate('D, d M Y H:i:s', strtotime('-1 day')).' GMT'); |
|
166 | 166 | |
167 | - header('Last-Modified: ' . gmdate('D, d M Y H:i:s', strtotime('-1 day')) . ' GMT'); |
|
167 | + header('Last-Modified: '.gmdate('D, d M Y H:i:s', strtotime('-1 day')).' GMT'); |
|
168 | 168 | |
169 | 169 | header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0'); |
170 | 170 |
@@ -45,7 +45,7 @@ |
||
45 | 45 | |
46 | 46 | public static function redirect(string $url) { |
47 | 47 | |
48 | - header("Location: " . $url); exit(); |
|
48 | + header("Location: ".$url); exit(); |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | } |
@@ -23,9 +23,9 @@ |
||
23 | 23 | |
24 | 24 | public static function __autoload() { |
25 | 25 | |
26 | - $file_mobiles = (DIR_DATA . 'Agent/Mobiles.php'); |
|
26 | + $file_mobiles = (DIR_DATA.'Agent/Mobiles.php'); |
|
27 | 27 | |
28 | - $file_robots = (DIR_DATA . 'Agent/Robots.php'); |
|
28 | + $file_robots = (DIR_DATA.'Agent/Robots.php'); |
|
29 | 29 | |
30 | 30 | if (is_array($mobiles = Explorer::php($file_mobiles))) self::$mobiles = $mobiles; |
31 | 31 |