Completed
Push — master ( 2a3bc6...6ae057 )
by Nazar
04:33
created
core/functions.php 1 patch
Indentation   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   CleverStyle CMS
4
- * @author    Nazar Mokrynskyi <[email protected]>
5
- * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
6
- * @license   MIT License, see license.txt
7
- */
3
+	 * @package   CleverStyle CMS
4
+	 * @author    Nazar Mokrynskyi <[email protected]>
5
+	 * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
6
+	 * @license   MIT License, see license.txt
7
+	 */
8 8
 /**
9
- * Base system functions, do not edit this file, or make it very carefully
10
- * otherwise system workability may be broken
11
- */
9
+	 * Base system functions, do not edit this file, or make it very carefully
10
+	 * otherwise system workability may be broken
11
+	 */
12 12
 use
13 13
 	cs\App,
14 14
 	cs\Cache,
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
 	cs\Response,
20 20
 	cs\Text;
21 21
 /**
22
- * Auto Loading of classes
23
- */
22
+	 * Auto Loading of classes
23
+	 */
24 24
 spl_autoload_register(function ($class) {
25 25
 	static $cache;
26 26
 	if (!isset($cache)) {
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
 	return false;
57 57
 }, true, true);
58 58
 /**
59
- * Clean cache of classes autoload and customization
60
- */
59
+	 * Clean cache of classes autoload and customization
60
+	 */
61 61
 function clean_classes_cache () {
62 62
 	if (file_exists(CACHE.'/classes/autoload')) {
63 63
 		unlink(CACHE.'/classes/autoload');
@@ -101,46 +101,46 @@  discard block
 block discarded – undo
101 101
 	App::instance()->execute();
102 102
 }
103 103
 /**
104
- * Enable of errors processing
105
- * @todo Remove in 4.x
106
- */
104
+	 * Enable of errors processing
105
+	 * @todo Remove in 4.x
106
+	 */
107 107
 function errors_on () {
108 108
 	error_reporting(defined('DEBUG') && DEBUG ? E_ALL : E_ERROR | E_WARNING | E_PARSE);
109 109
 }
110 110
 /**
111
- * Disabling of errors processing
112
- * @todo Remove in 4.x
113
- */
111
+	 * Disabling of errors processing
112
+	 * @todo Remove in 4.x
113
+	 */
114 114
 function errors_off () {
115 115
 	error_reporting(0);
116 116
 }
117 117
 /**
118
- * Enabling of page interface
119
- *
120
- * @deprecated Use `cs\Page::$interface` property instead
121
- * @todo       Remove in 4.x
122
- */
118
+	 * Enabling of page interface
119
+	 *
120
+	 * @deprecated Use `cs\Page::$interface` property instead
121
+	 * @todo       Remove in 4.x
122
+	 */
123 123
 function interface_on () {
124 124
 	Page::instance()->interface	= true;
125 125
 }
126 126
 /**
127
- * Disabling of page interface
128
- *
129
- * @deprecated Use `cs\Page::$interface` property instead
130
- * @todo       Remove in 4.x
131
- */
127
+	 * Disabling of page interface
128
+	 *
129
+	 * @deprecated Use `cs\Page::$interface` property instead
130
+	 * @todo       Remove in 4.x
131
+	 */
132 132
 function interface_off () {
133 133
 	Page::instance()->interface	= false;
134 134
 }
135 135
 /**
136
- * Easy getting of translations
137
- *
138
- * @param string $item
139
- * @param mixed  $arguments There can be any necessary number of arguments here
140
- * @param mixed  $_
141
- *
142
- * @return string
143
- */
136
+	 * Easy getting of translations
137
+	 *
138
+	 * @param string $item
139
+	 * @param mixed  $arguments There can be any necessary number of arguments here
140
+	 * @param mixed  $_
141
+	 *
142
+	 * @return string
143
+	 */
144 144
 function __ ($item, $arguments = null, $_ = null) {
145 145
 	$L = Language::instance();
146 146
 	if (func_num_args() > 1) {
@@ -150,12 +150,12 @@  discard block
 block discarded – undo
150 150
 	}
151 151
 }
152 152
 /**
153
- * Get file url by it's destination in file system
154
- *
155
- * @param string		$source
156
- *
157
- * @return false|string
158
- */
153
+	 * Get file url by it's destination in file system
154
+	 *
155
+	 * @param string		$source
156
+	 *
157
+	 * @return false|string
158
+	 */
159 159
 function url_by_source ($source) {
160 160
 	$Config	= Config::instance(true);
161 161
 	if (!$Config) {
@@ -168,12 +168,12 @@  discard block
 block discarded – undo
168 168
 	return false;
169 169
 }
170 170
 /**
171
- * Get file destination in file system by it's url
172
- *
173
- * @param string		$url
174
- *
175
- * @return false|string
176
- */
171
+	 * Get file destination in file system by it's url
172
+	 *
173
+	 * @param string		$url
174
+	 *
175
+	 * @return false|string
176
+	 */
177 177
 function source_by_url ($url) {
178 178
 	$Config	= Config::instance(true);
179 179
 	if (!$Config) {
@@ -185,10 +185,10 @@  discard block
 block discarded – undo
185 185
 	return false;
186 186
 }
187 187
 /**
188
- * Public cache cleaning
189
- *
190
- * @return bool
191
- */
188
+	 * Public cache cleaning
189
+	 *
190
+	 * @return bool
191
+	 */
192 192
 function clean_pcache () {
193 193
 	$ok = true;
194 194
 	$list = get_files_list(PUBLIC_CACHE, false, 'fd', true, true, 'name|desc');
@@ -203,12 +203,12 @@  discard block
 block discarded – undo
203 203
 	return $ok;
204 204
 }
205 205
 /**
206
- * Formatting of time in seconds to human-readable form
207
- *
208
- * @param int		$time	Time in seconds
209
- *
210
- * @return string
211
- */
206
+	 * Formatting of time in seconds to human-readable form
207
+	 *
208
+	 * @param int		$time	Time in seconds
209
+	 *
210
+	 * @return string
211
+	 */
212 212
 function format_time ($time) {
213 213
 	if (!is_numeric($time)) {
214 214
 		return $time;
@@ -246,13 +246,13 @@  discard block
 block discarded – undo
246 246
 	return implode(' ', $res);
247 247
 }
248 248
 /**
249
- * Formatting of data size in bytes to human-readable form
250
- *
251
- * @param int		$size
252
- * @param bool|int	$round
253
- *
254
- * @return float|string
255
- */
249
+	 * Formatting of data size in bytes to human-readable form
250
+	 *
251
+	 * @param int		$size
252
+	 * @param bool|int	$round
253
+	 *
254
+	 * @return float|string
255
+	 */
256 256
 function format_filesize ($size, $round = false) {
257 257
 	if (!is_numeric($size)) {
258 258
 		return $size;
@@ -277,10 +277,10 @@  discard block
 block discarded – undo
277 277
 	return $round ? round($size, $round).$unit : $size.$unit;
278 278
 }
279 279
 /**
280
- * Get list of timezones
281
- *
282
- * @return array
283
- */
280
+	 * Get list of timezones
281
+	 *
282
+	 * @return array
283
+	 */
284 284
 function get_timezones_list () {
285 285
 	if (
286 286
 		!class_exists('\\cs\\Cache', false) ||
@@ -316,12 +316,12 @@  discard block
 block discarded – undo
316 316
 	return $timezones;
317 317
 }
318 318
 /**
319
- * Get multilingual value from $Config->core array
320
- *
321
- * @param string $item
322
- *
323
- * @return false|string
324
- */
319
+	 * Get multilingual value from $Config->core array
320
+	 *
321
+	 * @param string $item
322
+	 *
323
+	 * @return false|string
324
+	 */
325 325
 function get_core_ml_text ($item) {
326 326
 	$Config	= Config::instance(true);
327 327
 	if (!$Config) {
Please login to merge, or discard this patch.