@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | )", |
59 | 59 | $prepared_arguments |
60 | 60 | ); |
61 | - $id = $insert_id !== false ? $insert_id : $this->db_prime()->id(); |
|
61 | + $id = $insert_id !== false ? $insert_id : $this->db_prime()->id(); |
|
62 | 62 | /** |
63 | 63 | * Id might be 0 if insertion failed or if we insert duplicate entry (which is fine since we use 'INSERT IGNORE' |
64 | 64 | */ |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | } |
156 | 156 | return $id; |
157 | 157 | } |
158 | - $columns = array_filter( |
|
158 | + $columns = array_filter( |
|
159 | 159 | $data_model, |
160 | 160 | function ($column) { |
161 | 161 | return !is_array($column) || !isset($column['data_model']); |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | $id |
224 | 224 | ] |
225 | 225 | ) ?: []; |
226 | - $language_field = isset($model['language_field']) ? $model['language_field'] : null; |
|
226 | + $language_field = isset($model['language_field']) ? $model['language_field'] : null; |
|
227 | 227 | /** |
228 | 228 | * If no rows found for current language - find another language that should contain some rows |
229 | 229 | */ |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | $data_before = $this->read_internal($table, $data_model, $id); |
295 | 295 | } |
296 | 296 | list($prepared_arguments, $joined_tables) = self::crud_arguments_preparation(array_slice($data_model, 1), $prepared_arguments, $id); |
297 | - $columns = implode( |
|
297 | + $columns = implode( |
|
298 | 298 | ',', |
299 | 299 | array_map( |
300 | 300 | function ($column) { |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $first_column = array_keys($data_model)[0]; |
166 | 166 | $data = $this->db()->qf( |
167 | 167 | [ |
168 | - "SELECT $columns |
|
168 | + "select $columns |
|
169 | 169 | FROM `$table` |
170 | 170 | WHERE `$first_column` = '%s' |
171 | 171 | LIMIT 1", |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $fields = '`'.implode('`,`', array_keys($model['data_model'])).'`'; |
216 | 216 | $rows = $this->db_prime()->qfa( |
217 | 217 | [ |
218 | - "SELECT $fields |
|
218 | + "select $fields |
|
219 | 219 | FROM `{$this->table}_$table` |
220 | 220 | WHERE |
221 | 221 | `$id_field` = '%s' |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @package CleverStyle CMS |
|
4 | - * @author Nazar Mokrynskyi <[email protected]> |
|
5 | - * @copyright Copyright (c) 2013-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) 2013-2016, Nazar Mokrynskyi |
|
6 | + * @license MIT License, see license.txt |
|
7 | + */ |
|
8 | 8 | namespace cs\CRUD; |
9 | 9 | use |
10 | 10 | cs\Event, |
@@ -370,7 +370,7 @@ |
||
370 | 370 | * @return array |
371 | 371 | */ |
372 | 372 | protected function get_includes_prepare ($dependencies, $separator) { |
373 | - $includes = [ |
|
373 | + $includes = [ |
|
374 | 374 | 'css' => [], |
375 | 375 | 'js' => [], |
376 | 376 | 'html' => [] |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @package CleverStyle CMS |
|
4 | - * @author Nazar Mokrynskyi <[email protected]> |
|
5 | - * @copyright Copyright (c) 2014-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) 2014-2016, Nazar Mokrynskyi |
|
6 | + * @license MIT License, see license.txt |
|
7 | + */ |
|
8 | 8 | namespace cs\Page; |
9 | 9 | use |
10 | 10 | cs\Core, |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | 'aliases' => &$aliases, |
61 | 61 | 'final_class' => &$next_alias |
62 | 62 | ]; |
63 | - $classes = glob(CUSTOM.'/classes/'.substr($class, 2).'_*.php'); |
|
63 | + $classes = glob(CUSTOM.'/classes/'.substr($class, 2).'_*.php'); |
|
64 | 64 | foreach ($classes as $custom_class) { |
65 | 65 | // Path to file with customized class |
66 | 66 | $custom_class = str_replace(CUSTOM.'/classes/', '', substr($custom_class, 0, -4)); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | 'alias' => "cs\\custom\\$_custom_class", |
74 | 74 | 'path' => $custom_class |
75 | 75 | ]; |
76 | - $next_alias = "cs\\custom\\$custom_class"; |
|
76 | + $next_alias = "cs\\custom\\$custom_class"; |
|
77 | 77 | } |
78 | 78 | if (!is_dir(CACHE.'/classes')) { |
79 | 79 | @mkdir(CACHE.'/classes', 0770, true); |
@@ -1,18 +1,18 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @package CleverStyle CMS |
|
4 | - * @author Nazar Mokrynskyi <[email protected]> |
|
5 | - * @copyright Copyright (c) 2013-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) 2013-2016, Nazar Mokrynskyi |
|
6 | + * @license MIT License, see license.txt |
|
7 | + */ |
|
8 | 8 | namespace cs\Singleton; |
9 | 9 | use |
10 | 10 | cs\False_class; |
11 | 11 | /** |
12 | - * Singleton trait |
|
13 | - * |
|
14 | - * Provides Singleton pattern implementation |
|
15 | - */ |
|
12 | + * Singleton trait |
|
13 | + * |
|
14 | + * Provides Singleton pattern implementation |
|
15 | + */ |
|
16 | 16 | trait Base { |
17 | 17 | final protected function __construct () { |
18 | 18 | } |
@@ -439,7 +439,7 @@ |
||
439 | 439 | if (!$user || !$item || $user == User::GUEST_ID) { |
440 | 440 | return false; |
441 | 441 | } |
442 | - $item = implode( |
|
442 | + $item = implode( |
|
443 | 443 | ',', |
444 | 444 | $this->db_prime()->s((array)$item) |
445 | 445 | ); |
@@ -119,7 +119,7 @@ |
||
119 | 119 | */ |
120 | 120 | $new_items = '`'.implode('`, `', $new_items).'`'; |
121 | 121 | $res = $this->db()->qf( |
122 | - "SELECT $new_items |
|
122 | + "select $new_items |
|
123 | 123 | FROM `[prefix]users` |
124 | 124 | WHERE `id` = '$user' |
125 | 125 | LIMIT 1" |
@@ -1,10 +1,10 @@ |
||
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 | namespace cs\User; |
9 | 9 | use |
10 | 10 | cs\Config, |
@@ -269,7 +269,7 @@ |
||
269 | 269 | * Checks for unconfirmed registrations and deletes expired |
270 | 270 | */ |
271 | 271 | protected function delete_unconfirmed_users () { |
272 | - $reg_date = time() - Config::instance()->core['registration_confirmation_time'] * 86400; //1 day = 86400 seconds |
|
272 | + $reg_date = time() - Config::instance()->core['registration_confirmation_time'] * 86400; //1 day = 86400 seconds |
|
273 | 273 | $ids = $this->db_prime()->qfas( |
274 | 274 | [ |
275 | 275 | "SELECT `id` |
@@ -1,10 +1,10 @@ |
||
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 | namespace cs\User; |
9 | 9 | use |
10 | 10 | cs\Config, |
@@ -31,7 +31,7 @@ |
||
31 | 31 | * Time of start of execution, is used as current time |
32 | 32 | */ |
33 | 33 | define('MICROTIME', microtime(true)); //Time in seconds (float) |
34 | -define('TIME', floor(MICROTIME)); //Time in seconds (integer) |
|
35 | -define('DIR', __DIR__); //Root directory |
|
34 | +define('TIME', floor(MICROTIME)); //Time in seconds (integer) |
|
35 | +define('DIR', __DIR__); //Root directory |
|
36 | 36 | chdir(DIR); |
37 | -require_once DIR.'/core/loader.php'; //Loader starting |
|
37 | +require_once DIR.'/core/loader.php'; //Loader starting |
@@ -1,35 +1,35 @@ |
||
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 | - * Requirements: |
|
10 | - * * Apache2 |
|
11 | - * Apache2 modules MUST be enabled: |
|
12 | - * * rewrite |
|
13 | - * * headers |
|
14 | - * Optional Apache2 modules: |
|
15 | - * * expires |
|
16 | - * * or Nginx |
|
17 | - * * PHP 5.5+ |
|
18 | - * PHP libraries MUST be present: |
|
19 | - * * cURL |
|
20 | - * Optional PHP libraries: |
|
21 | - * * APCu, Memcached |
|
22 | - * * or HHVM 3.3.2+ LTS or HHVM 3.4.1+ |
|
23 | - * * MySQL 5.6+ |
|
24 | - * * or MariaDB 10.0.5+ |
|
25 | - */ |
|
9 | + * Requirements: |
|
10 | + * * Apache2 |
|
11 | + * Apache2 modules MUST be enabled: |
|
12 | + * * rewrite |
|
13 | + * * headers |
|
14 | + * Optional Apache2 modules: |
|
15 | + * * expires |
|
16 | + * * or Nginx |
|
17 | + * * PHP 5.5+ |
|
18 | + * PHP libraries MUST be present: |
|
19 | + * * cURL |
|
20 | + * Optional PHP libraries: |
|
21 | + * * APCu, Memcached |
|
22 | + * * or HHVM 3.3.2+ LTS or HHVM 3.4.1+ |
|
23 | + * * MySQL 5.6+ |
|
24 | + * * or MariaDB 10.0.5+ |
|
25 | + */ |
|
26 | 26 | if (version_compare(PHP_VERSION, '5.5', '<')) { |
27 | 27 | echo 'CleverStyle CMS require PHP 5.5 or higher'; |
28 | 28 | return; |
29 | 29 | } |
30 | 30 | /** |
31 | - * Time of start of execution, is used as current time |
|
32 | - */ |
|
31 | + * Time of start of execution, is used as current time |
|
32 | + */ |
|
33 | 33 | define('MICROTIME', microtime(true)); //Time in seconds (float) |
34 | 34 | define('TIME', floor(MICROTIME)); //Time in seconds (integer) |
35 | 35 | define('DIR', __DIR__); //Root directory |
@@ -20,7 +20,7 @@ |
||
20 | 20 | define('DIR', __DIR__); |
21 | 21 | } |
22 | 22 | mb_internal_encoding('utf-8'); |
23 | -define('ROOT', getcwd()); //Path to site root |
|
23 | +define('ROOT', getcwd()); //Path to site root |
|
24 | 24 | $fs = json_decode(file_get_contents(DIR.'/fs.json'), true); |
25 | 25 | require DIR.'/fs/'.$fs['core/thirdparty/upf.php']; |
26 | 26 | require DIR.'/fs/'.$fs['core/functions.php']; |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @package CleverStyle CMS |
|
4 | - * @subpackage Installer |
|
5 | - * @author Nazar Mokrynskyi <[email protected]> |
|
6 | - * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
7 | - * @license MIT License, see license.txt |
|
8 | - */ |
|
3 | + * @package CleverStyle CMS |
|
4 | + * @subpackage Installer |
|
5 | + * @author Nazar Mokrynskyi <[email protected]> |
|
6 | + * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
7 | + * @license MIT License, see license.txt |
|
8 | + */ |
|
9 | 9 | if (version_compare(PHP_VERSION, '5.5', '<')) { |
10 | 10 | echo 'CleverStyle CMS require PHP 5.5 or higher'; |
11 | 11 | return; |
12 | 12 | } |
13 | 13 | $cli = PHP_SAPI == 'cli'; |
14 | 14 | /** |
15 | - * Path to installer dir |
|
16 | - */ |
|
15 | + * Path to installer dir |
|
16 | + */ |
|
17 | 17 | if ($cli) { |
18 | 18 | define('DIR', 'phar://cleverstyle_cms.phar'); |
19 | 19 | } else { |
@@ -144,7 +144,7 @@ |
||
144 | 144 | $url = $_POST['site_url']; |
145 | 145 | } else { |
146 | 146 | $url = "$_SERVER->protocol://$_SERVER->host$_SERVER->request_uri"; |
147 | - $url = implode('/', array_slice(explode('/', $url), 0, -2)); //Remove 2 last items |
|
147 | + $url = implode('/', array_slice(explode('/', $url), 0, -2)); //Remove 2 last items |
|
148 | 148 | } |
149 | 149 | preg_match('#//([^/]+)#', $url, $domain); |
150 | 150 | $domain = $domain[1]; |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @package CleverStyle CMS |
|
4 | - * @subpackage Installer |
|
5 | - * @author Nazar Mokrynskyi <[email protected]> |
|
6 | - * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
7 | - * @license MIT License, see license.txt |
|
8 | - */ |
|
3 | + * @package CleverStyle CMS |
|
4 | + * @subpackage Installer |
|
5 | + * @author Nazar Mokrynskyi <[email protected]> |
|
6 | + * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
7 | + * @license MIT License, see license.txt |
|
8 | + */ |
|
9 | 9 | function install_form () { |
10 | 10 | $timezones = get_timezones_list(); |
11 | 11 | return h::{'form[method=post]'}( |
@@ -11,5 +11,5 @@ |
||
11 | 11 | * @var _SERVER $_SERVER |
12 | 12 | */ |
13 | 13 | if (preg_match('/msie|trident/i', $_SERVER->user_agent)) { |
14 | - Page::instance()->Head .= '<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">'; |
|
14 | + Page::instance()->Head .= '<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">'; |
|
15 | 15 | } |
@@ -1,15 +1,15 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @package CleverStyle CMS |
|
4 | - * @subpackage CleverStyle theme |
|
5 | - * @author Nazar Mokrynskyi <[email protected]> |
|
6 | - * @copyright Copyright (c) 2013-2016, Nazar Mokrynskyi |
|
7 | - * @license MIT License, see license.txt |
|
8 | - */ |
|
3 | + * @package CleverStyle CMS |
|
4 | + * @subpackage CleverStyle theme |
|
5 | + * @author Nazar Mokrynskyi <[email protected]> |
|
6 | + * @copyright Copyright (c) 2013-2016, Nazar Mokrynskyi |
|
7 | + * @license MIT License, see license.txt |
|
8 | + */ |
|
9 | 9 | namespace cs; |
10 | 10 | /** |
11 | - * @var _SERVER $_SERVER |
|
12 | - */ |
|
11 | + * @var _SERVER $_SERVER |
|
12 | + */ |
|
13 | 13 | if (preg_match('/msie|trident/i', $_SERVER->user_agent)) { |
14 | 14 | Page::instance()->Head .= '<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">'; |
15 | 15 | } |