@@ -16,17 +16,17 @@ |
||
16 | 16 | |
17 | 17 | $_PATH = $deepness > 0 ? implode('', array_fill(0, $deepness, '../')) : './'; |
18 | 18 | |
19 | -require_once $_PATH.'vendor/autoload.php'; |
|
20 | -spl_autoload_register(function ($className) { |
|
19 | +require_once $_PATH . 'vendor/autoload.php'; |
|
20 | +spl_autoload_register(function($className) { |
|
21 | 21 | global $_PATH; |
22 | 22 | |
23 | 23 | $path = explode('\\', $className); |
24 | 24 | if (in_array($path[0], ['conf'])) { |
25 | - $includePath = $_PATH.str_replace('\\', '/', $className.'.php'); |
|
25 | + $includePath = $_PATH . str_replace('\\', '/', $className . '.php'); |
|
26 | 26 | } else { |
27 | - $includePath = $_PATH.'classes/'.str_replace('\\', '/', $className.'.php'); |
|
27 | + $includePath = $_PATH . 'classes/' . str_replace('\\', '/', $className . '.php'); |
|
28 | 28 | } |
29 | 29 | require_once $includePath; |
30 | 30 | }); |
31 | 31 | |
32 | -require_once $_PATH.'modules/error_log.php'; |
|
32 | +require_once $_PATH . 'modules/error_log.php'; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | return $this->sendNotification( |
35 | 35 | Config::EMAIL_ADMIN, |
36 | - "New user signup: '".$user->username."'", |
|
36 | + "New user signup: '" . $user->username . "'", |
|
37 | 37 | $_LANG->code, |
38 | 38 | 'signup_admin_email', |
39 | 39 | [ |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | global $_LANG; |
62 | 62 | |
63 | 63 | if (!Validator::isEmail($user->email)) { |
64 | - throw new \Exception("Invalid email: '".$user->email."'"); |
|
64 | + throw new \Exception("Invalid email: '" . $user->email . "'"); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | return $this->sendNotification( |
@@ -23,7 +23,7 @@ |
||
23 | 23 | |
24 | 24 | public function save() |
25 | 25 | { |
26 | - $query = 'INSERT INTO '.self::TABLE_NAME.' (setting_id, value) VALUES (?, ?) |
|
26 | + $query = 'INSERT INTO ' . self::TABLE_NAME . ' (setting_id, value) VALUES (?, ?) |
|
27 | 27 | ON DUPLICATE KEY UPDATE value = ?'; |
28 | 28 | |
29 | 29 | return DBCore::doUpdateQuery($query, 'sss', [ |
@@ -120,9 +120,9 @@ discard block |
||
120 | 120 | */ |
121 | 121 | public function updateLoginTime() |
122 | 122 | { |
123 | - $query = 'UPDATE '.self::TABLE_NAME.' |
|
123 | + $query = 'UPDATE ' . self::TABLE_NAME . ' |
|
124 | 124 | SET last_login_time = NOW() |
125 | - WHERE '.self::ID_FIELD_NAME.' = ?'; |
|
125 | + WHERE '.self::ID_FIELD_NAME . ' = ?'; |
|
126 | 126 | DBCore::doUpdateQuery($query, 'i', [$this->id]); |
127 | 127 | } |
128 | 128 | |
@@ -196,8 +196,8 @@ discard block |
||
196 | 196 | public function getAvatarPath($icon = false) |
197 | 197 | { |
198 | 198 | $currentAvatarFileName = $this->avatar; |
199 | - if (!empty($currentAvatarFileName) && file_exists(Config::DIR_AVATARS.$currentAvatarFileName)) { |
|
200 | - return Config::DIR_AVATARS.$currentAvatarFileName; |
|
199 | + if (!empty($currentAvatarFileName) && file_exists(Config::DIR_AVATARS . $currentAvatarFileName)) { |
|
200 | + return Config::DIR_AVATARS . $currentAvatarFileName; |
|
201 | 201 | } |
202 | 202 | if ($icon) { |
203 | 203 | return 'img/user_avatar.png'; |
@@ -216,14 +216,14 @@ discard block |
||
216 | 216 | public function updateAvatar($newAvatarFileName) |
217 | 217 | { |
218 | 218 | $currentAvatarFileName = $this->avatar; |
219 | - if (!empty($currentAvatarFileName) && file_exists(Config::DIR_AVATARS.$currentAvatarFileName)) { |
|
220 | - unlink(Config::DIR_AVATARS.$currentAvatarFileName); |
|
219 | + if (!empty($currentAvatarFileName) && file_exists(Config::DIR_AVATARS . $currentAvatarFileName)) { |
|
220 | + unlink(Config::DIR_AVATARS . $currentAvatarFileName); |
|
221 | 221 | } |
222 | 222 | |
223 | - if (file_exists(Config::DIR_AVATARS.$newAvatarFileName)) { |
|
224 | - $query = 'UPDATE '.self::TABLE_NAME |
|
223 | + if (file_exists(Config::DIR_AVATARS . $newAvatarFileName)) { |
|
224 | + $query = 'UPDATE ' . self::TABLE_NAME |
|
225 | 225 | .' SET avatar = ?' |
226 | - .' WHERE '.self::ID_FIELD_NAME.' = ?'; |
|
226 | + .' WHERE ' . self::ID_FIELD_NAME . ' = ?'; |
|
227 | 227 | if (DBCore::doUpdateQuery($query, 'si', [ |
228 | 228 | $newAvatarFileName, |
229 | 229 | $this->id, |
@@ -47,7 +47,7 @@ |
||
47 | 47 | } |
48 | 48 | } |
49 | 49 | |
50 | - $query = 'INSERT INTO '.self::TABLE_NAME.' (type, error_type, called, script, line, message, count, last_seen) VALUES (?, ?, ?, ?, ?, ?, 1, ?) |
|
50 | + $query = 'INSERT INTO ' . self::TABLE_NAME . ' (type, error_type, called, script, line, message, count, last_seen) VALUES (?, ?, ?, ?, ?, ?, 1, ?) |
|
51 | 51 | ON DUPLICATE KEY UPDATE count = count + 1, last_seen = ?'; |
52 | 52 | try { |
53 | 53 | return DBCore::doUpdateQuery($query, 'isssisss', [ |
@@ -34,10 +34,10 @@ |
||
34 | 34 | |
35 | 35 | protected function init() |
36 | 36 | { |
37 | - $action = 'action'.ucfirst( |
|
37 | + $action = 'action' . ucfirst( |
|
38 | 38 | preg_replace_callback( |
39 | 39 | '#_([a-z])#', |
40 | - function ($matches) { |
|
40 | + function($matches) { |
|
41 | 41 | return strtoupper($matches[1]); |
42 | 42 | }, |
43 | 43 | $this->route->action |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $this->_tpl = $tpl; |
34 | 34 | } elseif (Tools::isInstanceOf($tpl, new Route())) { |
35 | 35 | $this->_route = $tpl; |
36 | - $this->_tpl = $this->_route->controller.'/'.$this->_route->controller.'_'.$this->_route->action; |
|
36 | + $this->_tpl = $this->_route->controller . '/' . $this->_route->controller . '_' . $this->_route->action; |
|
37 | 37 | } else { |
38 | 38 | throw new \Exception('Invalid view template'); |
39 | 39 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | throw new \Exception('View object was not initialized with template'); |
49 | 49 | } |
50 | 50 | |
51 | - require_once $path.$this->_tpl.$suffix; |
|
51 | + require_once $path . $this->_tpl . $suffix; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | public function setTpl($_tpl) |
@@ -29,7 +29,7 @@ |
||
29 | 29 | public function __construct($attribs = [], $template = null, $show = false) |
30 | 30 | { |
31 | 31 | if (empty($template)) { |
32 | - $template = __DIR__.self::DEFAULT_TEMPLATE; |
|
32 | + $template = __DIR__ . self::DEFAULT_TEMPLATE; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | if ($show) { |
@@ -38,7 +38,7 @@ |
||
38 | 38 | $this->buttons = $buttons; |
39 | 39 | |
40 | 40 | if (empty($template)) { |
41 | - $template = __DIR__.self::DEFAULT_TEMPLATE; |
|
41 | + $template = __DIR__ . self::DEFAULT_TEMPLATE; |
|
42 | 42 | } |
43 | 43 | parent::__construct($attributesList, $template); |
44 | 44 | } |