@@ -262,7 +262,7 @@ |
||
262 | 262 | "$this->root/license.txt", |
263 | 263 | "$this->root/Storage.php" |
264 | 264 | ]; |
265 | - $files = []; |
|
265 | + $files = []; |
|
266 | 266 | foreach ($files_to_include as $s) { |
267 | 267 | if (is_file($s)) { |
268 | 268 | $files[] = $s; |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | Phar::webPhar(null, 'install.php'); |
160 | 160 | } |
161 | 161 | __HALT_COMPILER(); |
162 | -STUB |
|
162 | +stub |
|
163 | 163 | ); |
164 | 164 | $phar->stopBuffering(); |
165 | 165 | return "Done! CleverStyle CMS $version"; |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | #</Files> |
300 | 300 | |
301 | 301 | RewriteRule .* index.php |
302 | -HTACCESS; |
|
302 | +htaccess; |
|
303 | 303 | } |
304 | 304 | /** |
305 | 305 | * @param string $module |
@@ -22,7 +22,7 @@ |
||
22 | 22 | use |
23 | 23 | Singleton; |
24 | 24 | |
25 | - protected $data_model = [ |
|
25 | + protected $data_model = [ |
|
26 | 26 | 'id' => 'int', |
27 | 27 | 'amount' => 'float:0', |
28 | 28 | 'currency' => 'text', |
@@ -264,7 +264,7 @@ |
||
264 | 264 | function count ($item) { |
265 | 265 | $item = (int)$item; |
266 | 266 | $L = Language::instance(); |
267 | - return $this->cache->get("$item/count/$L->clang", function () use ($item) { |
|
267 | + return $this->cache->get("$item/count/$L->clang", function () use ($item) { |
|
268 | 268 | return $this->count_internal($this->tree_data($item)) ?: 0; |
269 | 269 | }); |
270 | 270 | } |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | /** |
38 | 38 | * @var int Avatar size in px, can be redefined |
39 | 39 | */ |
40 | - public $avatar_size = 36; |
|
40 | + public $avatar_size = 36; |
|
41 | 41 | |
42 | 42 | protected function construct () { |
43 | - $this->module = Request::instance()->current_module; |
|
44 | - $this->cache = new Cache_prefix("Comments/$this->module"); |
|
43 | + $this->module = Request::instance()->current_module; |
|
44 | + $this->cache = new Cache_prefix("Comments/$this->module"); |
|
45 | 45 | } |
46 | 46 | /** |
47 | 47 | * Set module (current module assumed by default) |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | * @param string $module Module name |
50 | 50 | */ |
51 | 51 | function set_module ($module) { |
52 | - $this->module = $module; |
|
53 | - $this->cache = new Cache_prefix("Comments/$this->module"); |
|
52 | + $this->module = $module; |
|
53 | + $this->cache = new Cache_prefix("Comments/$this->module"); |
|
54 | 54 | } |
55 | 55 | /** |
56 | 56 | * Returns database index |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @return array|false Array of comment data on success or <b>false</b> on failure |
69 | 69 | */ |
70 | 70 | function get ($id) { |
71 | - $id = (int)$id; |
|
71 | + $id = (int)$id; |
|
72 | 72 | return $this->db()->qf( |
73 | 73 | "SELECT |
74 | 74 | `id`, |
@@ -97,14 +97,14 @@ discard block |
||
97 | 97 | * @return array|bool Array of comment data on success or <b>false</b> on failure |
98 | 98 | */ |
99 | 99 | function add ($item, $text, $parent = 0) { |
100 | - $L = Language::instance(); |
|
100 | + $L = Language::instance(); |
|
101 | 101 | $User = User::instance(); |
102 | 102 | $text = xap($text, true); |
103 | 103 | if (!$text) { |
104 | 104 | return false; |
105 | 105 | } |
106 | - $item = (int)$item; |
|
107 | - $parent = (int)$parent; |
|
106 | + $item = (int)$item; |
|
107 | + $parent = (int)$parent; |
|
108 | 108 | if ( |
109 | 109 | $parent != 0 && |
110 | 110 | $this->db_prime()->qfs( |
@@ -172,12 +172,12 @@ discard block |
||
172 | 172 | * @return array|false Array of comment data on success or <b>false</b> on failure |
173 | 173 | */ |
174 | 174 | function set ($id, $text) { |
175 | - $text = xap($text, true); |
|
175 | + $text = xap($text, true); |
|
176 | 176 | if (!$text) { |
177 | 177 | return false; |
178 | 178 | } |
179 | - $id = (int)$id; |
|
180 | - $comment = $this->get($id); |
|
179 | + $id = (int)$id; |
|
180 | + $comment = $this->get($id); |
|
181 | 181 | if (!$comment) { |
182 | 182 | return false; |
183 | 183 | } |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $this->module |
194 | 194 | )) { |
195 | 195 | unset($this->cache->{$comment['item']}); |
196 | - $comment['text'] = $text; |
|
196 | + $comment['text'] = $text; |
|
197 | 197 | return $comment; |
198 | 198 | } |
199 | 199 | return false; |
@@ -206,8 +206,8 @@ discard block |
||
206 | 206 | * @return bool |
207 | 207 | */ |
208 | 208 | function del ($id) { |
209 | - $id = (int)$id; |
|
210 | - $comment = $this->db_prime()->qf( |
|
209 | + $id = (int)$id; |
|
210 | + $comment = $this->db_prime()->qf( |
|
211 | 211 | "SELECT `p`.`item`, COUNT(`c`.`id`) AS `count` |
212 | 212 | FROM `[prefix]comments` AS `p` |
213 | 213 | LEFT JOIN `[prefix]comments` AS `c` |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | * @return bool |
245 | 245 | */ |
246 | 246 | function del_all ($item) { |
247 | - $item = (int)$item; |
|
247 | + $item = (int)$item; |
|
248 | 248 | if ($this->db_prime()->q( |
249 | 249 | "DELETE FROM `[prefix]comments` |
250 | 250 | WHERE |
@@ -276,9 +276,9 @@ discard block |
||
276 | 276 | if (!is_array($data)) { |
277 | 277 | return 0; |
278 | 278 | } |
279 | - $count = 0; |
|
279 | + $count = 0; |
|
280 | 280 | foreach ($data as &$d) { |
281 | - $count += $this->count_internal($d['comments']) + 1; |
|
281 | + $count += $this->count_internal($d['comments']) + 1; |
|
282 | 282 | } |
283 | 283 | return $count; |
284 | 284 | } |
@@ -301,12 +301,12 @@ discard block |
||
301 | 301 | * @return false|array |
302 | 302 | */ |
303 | 303 | function tree_data ($item, $parent = 0) { |
304 | - $Cache = $this->cache; |
|
305 | - $L = Language::instance(); |
|
304 | + $Cache = $this->cache; |
|
305 | + $L = Language::instance(); |
|
306 | 306 | if (($comments = $Cache->{"$item/$L->clang"}) === false) { |
307 | - $item = (int)$item; |
|
308 | - $parent = (int)$parent; |
|
309 | - $comments = $this->db()->qfa( |
|
307 | + $item = (int)$item; |
|
308 | + $parent = (int)$parent; |
|
309 | + $comments = $this->db()->qfa( |
|
310 | 310 | "SELECT |
311 | 311 | `id`, |
312 | 312 | `parent`, |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | * Cache only root tree data |
332 | 332 | */ |
333 | 333 | if ($parent == 0) { |
334 | - $Cache->{"$item/$L->clang"} = $comments; |
|
334 | + $Cache->{"$item/$L->clang"} = $comments; |
|
335 | 335 | } |
336 | 336 | } |
337 | 337 | return $comments; |
@@ -344,15 +344,15 @@ discard block |
||
344 | 344 | * @return string |
345 | 345 | */ |
346 | 346 | function tree_html ($comments) { |
347 | - $L = Language::instance(); |
|
348 | - $User = User::instance(); |
|
347 | + $L = Language::instance(); |
|
348 | + $User = User::instance(); |
|
349 | 349 | if (!is_array($comments) || !$comments) { |
350 | 350 | return ''; |
351 | 351 | } |
352 | - $content = ''; |
|
352 | + $content = ''; |
|
353 | 353 | foreach ($comments as $comment) { |
354 | - $uniqid = uniqid('comment_', true); |
|
355 | - $content .= str_replace($uniqid, $comment['text'], h::{'article.cs-comments-comment'}( |
|
354 | + $uniqid = uniqid('comment_', true); |
|
355 | + $content .= str_replace($uniqid, $comment['text'], h::{'article.cs-comments-comment'}( |
|
356 | 356 | h::{'img.cs-comments-comment-avatar'}([ |
357 | 357 | 'src' => $User->avatar($this->avatar_size, $comment['user']), |
358 | 358 | 'alt' => $User->username($comment['user']), |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | * @return string |
409 | 409 | */ |
410 | 410 | function block ($item) { |
411 | - $L = new Language_prefix('comments_'); |
|
411 | + $L = new Language_prefix('comments_'); |
|
412 | 412 | return h::{'section#comments.cs-comments-comments'}( |
413 | 413 | $L->comments.':'. |
414 | 414 | ( |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $verbosity => true |
121 | 121 | ] |
122 | 122 | ); |
123 | - $output = new Output; |
|
123 | + $output = new Output; |
|
124 | 124 | $output->set_stream(fopen("$storage/last_execution.log", 'w')); |
125 | 125 | $application->setAutoExit(false); |
126 | 126 | $status_code = $application->run($input, $output); |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | 'repositories' => [], |
192 | 192 | 'require' => [] |
193 | 193 | ]; |
194 | - $Config = Config::instance(); |
|
194 | + $Config = Config::instance(); |
|
195 | 195 | foreach (array_keys($Config->components['modules']) as $module) { |
196 | 196 | if ( |
197 | 197 | $module == $component_name && |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | if (!$package['require']) { |
267 | 267 | return; |
268 | 268 | } |
269 | - $composer['repositories'][] = [ |
|
269 | + $composer['repositories'][] = [ |
|
270 | 270 | 'type' => 'package', |
271 | 271 | 'package' => $package |
272 | 272 | ]; |
@@ -31,7 +31,7 @@ |
||
31 | 31 | 'module' => 'text', |
32 | 32 | 'data' => null //Is set in constructor |
33 | 33 | ]; |
34 | - protected $table = '[prefix]deferred_tasks_tasks'; |
|
34 | + protected $table = '[prefix]deferred_tasks_tasks'; |
|
35 | 35 | /** |
36 | 36 | * @var int |
37 | 37 | */ |
@@ -31,19 +31,19 @@ |
||
31 | 31 | * @return string |
32 | 32 | */ |
33 | 33 | function http_build_url ($url, $parts) { |
34 | - $url = explode('?', $url, 2); |
|
35 | - $params = []; |
|
34 | + $url = explode('?', $url, 2); |
|
35 | + $params = []; |
|
36 | 36 | if (isset($url[1])) { |
37 | 37 | foreach (explode('&', $url[1]) as $u) { |
38 | - $params[] = $u; |
|
38 | + $params[] = $u; |
|
39 | 39 | } |
40 | 40 | unset($u, $url[1]); |
41 | 41 | } |
42 | - $url = $url[0]; |
|
42 | + $url = $url[0]; |
|
43 | 43 | foreach ($parts as $name => $value) { |
44 | - $params[] = $name.'='.urlencode($value); |
|
44 | + $params[] = $name.'='.urlencode($value); |
|
45 | 45 | } |
46 | 46 | unset($parts, $p); |
47 | - $params = array_unique($params); |
|
47 | + $params = array_unique($params); |
|
48 | 48 | return "$url?".implode('&', $params); |
49 | 49 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | const DEFAULT_IMAGE = 'components/modules/Shop/includes/img/no-image.svg'; |
57 | 57 | |
58 | - protected $data_model = [ |
|
58 | + protected $data_model = [ |
|
59 | 59 | 'id' => 'int', |
60 | 60 | 'date' => 'int', |
61 | 61 | 'category' => 'int', |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | 'string' => '', |
444 | 444 | 'text' => '' |
445 | 445 | ]; |
446 | - $lang = ''; |
|
446 | + $lang = ''; |
|
447 | 447 | switch ($this->attribute_type_to_value_field($attribute_data['type'])) { |
448 | 448 | case 'numeric_value': |
449 | 449 | $value_type['numeric'] = $value; |
@@ -286,17 +286,20 @@ |
||
286 | 286 | $where = []; |
287 | 287 | $where_params = []; |
288 | 288 | foreach ($search_parameters as $key => $details) { |
289 | - if (isset($this->data_model[$key])) { // Property |
|
289 | + if (isset($this->data_model[$key])) { |
|
290 | +// Property |
|
290 | 291 | $where[] = "`i`.`$key` = '%s'"; |
291 | 292 | $where_params[] = $details; |
292 | - } elseif (is_numeric($key)) { // Tag |
|
293 | + } elseif (is_numeric($key)) { |
|
294 | +// Tag |
|
293 | 295 | $joins .= |
294 | 296 | "INNER JOIN `{$this->table}_tags` AS `t` |
295 | 297 | ON |
296 | 298 | `i`.`id` = `t`.`id` AND |
297 | 299 | `t`.`tag` = '%s'"; |
298 | 300 | $where_params[] = $details; |
299 | - } else { // Attribute |
|
301 | + } else { |
|
302 | +// Attribute |
|
300 | 303 | $field = @$this->attribute_type_to_value_field($Attributes->get($key)['type']); |
301 | 304 | if (!$field || empty($details)) { |
302 | 305 | continue; |
@@ -67,7 +67,7 @@ |
||
67 | 67 | |
68 | 68 | const PAYMENT_METHOD_CASH = 'shop:cash'; |
69 | 69 | |
70 | - protected $data_model = [ |
|
70 | + protected $data_model = [ |
|
71 | 71 | 'id' => 'int', |
72 | 72 | 'user' => 'int', |
73 | 73 | 'date' => 'int', |
@@ -113,7 +113,7 @@ |
||
113 | 113 | if (!$items) { |
114 | 114 | return; |
115 | 115 | } |
116 | -$items_total = $Items->search( |
|
116 | +$items_total = $Items->search( |
|
117 | 117 | [ |
118 | 118 | 'listed' => 1, |
119 | 119 | 'category' => $current_category, |