@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | */ |
10 | 10 | |
11 | 11 | $allow_anonymous = true; |
12 | -include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
12 | +include('common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
13 | 13 | |
14 | 14 | global $config; |
15 | 15 | |
@@ -23,40 +23,40 @@ discard block |
||
23 | 23 | $mode = sys_get_param_str('mode'); |
24 | 24 | |
25 | 25 | $announce = array(); |
26 | -if($user['authlevel'] >= 3) { |
|
27 | - if(!empty($text)) { |
|
26 | +if ($user['authlevel'] >= 3) { |
|
27 | + if (!empty($text)) { |
|
28 | 28 | $announce_time = strtotime($announce_time, SN_TIME_NOW); |
29 | 29 | $announce_time = $announce_time ? $announce_time : SN_TIME_NOW; |
30 | 30 | |
31 | - if($mode == 'edit') { |
|
31 | + if ($mode == 'edit') { |
|
32 | 32 | DBStaticNews::db_news_update_set($announce_time, $text, $detail_url, $announce_id); |
33 | 33 | DBStaticSurvey::db_survey_delete_by_id($announce_id); |
34 | 34 | } else { |
35 | 35 | DBStaticNews::db_news_insert_set($announce_time, $text, $detail_url, $user); |
36 | 36 | $announce_id = db_insert_id(); |
37 | 37 | } |
38 | - if(($survey_question = sys_get_param_str('survey_question')) && ($survey_answers = sys_get_param('survey_answers'))) { |
|
38 | + if (($survey_question = sys_get_param_str('survey_question')) && ($survey_answers = sys_get_param('survey_answers'))) { |
|
39 | 39 | $survey_answers = explode("\r\n", $survey_answers); |
40 | 40 | $survey_until = strtotime($survey_until = sys_get_param_str('survey_until'), SN_TIME_NOW); |
41 | 41 | $survey_until = date(FMT_DATE_TIME_SQL, $survey_until ? $survey_until : SN_TIME_NOW + PERIOD_DAY * 1); |
42 | 42 | DBStaticSurvey::db_survey_insert($announce_id, $survey_question, $survey_until); |
43 | 43 | $survey_id = db_insert_id(); |
44 | - foreach($survey_answers as $survey_answer) { |
|
44 | + foreach ($survey_answers as $survey_answer) { |
|
45 | 45 | $survey_answer = db_escape(trim($survey_answer)); |
46 | - if(empty($survey_answer)) { |
|
46 | + if (empty($survey_answer)) { |
|
47 | 47 | continue; |
48 | 48 | } |
49 | 49 | DBStaticSurveyAnswer::db_survey_answer_insert($survey_id, $survey_answer); |
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
53 | - if($announce_time <= SN_TIME_NOW) { |
|
54 | - if($announce_time > $config->var_news_last && $announce_time == SN_TIME_NOW) { |
|
53 | + if ($announce_time <= SN_TIME_NOW) { |
|
54 | + if ($announce_time > $config->var_news_last && $announce_time == SN_TIME_NOW) { |
|
55 | 55 | $config->db_saveItem('var_news_last', $announce_time); |
56 | 56 | } |
57 | 57 | |
58 | - if(sys_get_param_int('news_mass_mail')) { |
|
59 | - $text = sys_get_param('text') . ($detail_url ? " <a href=\"{$detail_url}\"><span class=\"positive\">{$lang['news_more']}</span></a>" : ''); |
|
58 | + if (sys_get_param_int('news_mass_mail')) { |
|
59 | + $text = sys_get_param('text').($detail_url ? " <a href=\"{$detail_url}\"><span class=\"positive\">{$lang['news_more']}</span></a>" : ''); |
|
60 | 60 | msg_send_simple_message('*', 0, 0, MSG_TYPE_ADMIN, $lang['sys_administration'], $lang['news_title'], $text); |
61 | 61 | } |
62 | 62 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | $survey_answers = ''; |
69 | - switch($mode) { |
|
69 | + switch ($mode) { |
|
70 | 70 | case 'del': |
71 | 71 | DBStaticNews::db_news_delete_by_id($announce_id); |
72 | 72 | $mode = ''; |
@@ -76,9 +76,9 @@ discard block |
||
76 | 76 | $template->assign_var('ID', $announce_id); |
77 | 77 | case 'copy': |
78 | 78 | $announce = DBStaticNews::db_news_with_survey_select_by_id($announce_id); |
79 | - if($announce['survey_id']) { |
|
79 | + if ($announce['survey_id']) { |
|
80 | 80 | $query = DBStaticSurveyAnswer::db_survey_answer_text_select_by_news($announce); |
81 | - while($row = db_fetch($query)) { |
|
81 | + while ($row = db_fetch($query)) { |
|
82 | 82 | $survey_answers[] = $row['survey_answer_text']; |
83 | 83 | } |
84 | 84 | $survey_answers = implode("\r\n", $survey_answers); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | break; |
87 | 87 | } |
88 | 88 | } else { |
89 | - $annQuery = 'WHERE UNIX_TIMESTAMP(`tsTimeStamp`) <= ' . SN_TIME_NOW; |
|
89 | + $annQuery = 'WHERE UNIX_TIMESTAMP(`tsTimeStamp`) <= '.SN_TIME_NOW; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | nws_render($template, $annQuery, 20); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | public function load_db_settings() { |
66 | 66 | $dbsettings = array(); |
67 | 67 | |
68 | - require(SN_ROOT_PHYSICAL . "config" . DOT_PHP_EX); |
|
68 | + require(SN_ROOT_PHYSICAL."config".DOT_PHP_EX); |
|
69 | 69 | |
70 | 70 | $this->dbsettings = $dbsettings; |
71 | 71 | } |
@@ -73,23 +73,23 @@ discard block |
||
73 | 73 | public function sn_db_connect($external_db_settings = null) { |
74 | 74 | $this->db_disconnect(); |
75 | 75 | |
76 | - if(!empty($external_db_settings) && is_array($external_db_settings)) { |
|
76 | + if (!empty($external_db_settings) && is_array($external_db_settings)) { |
|
77 | 77 | $this->dbsettings = $external_db_settings; |
78 | 78 | } |
79 | 79 | |
80 | - if(empty($this->dbsettings)) { |
|
80 | + if (empty($this->dbsettings)) { |
|
81 | 81 | $this->load_db_settings(); |
82 | 82 | } |
83 | 83 | |
84 | 84 | // TODO - фатальные (?) ошибки на каждом шагу. Хотя - скорее Эксепшны |
85 | - if(!empty($this->dbsettings)) { |
|
85 | + if (!empty($this->dbsettings)) { |
|
86 | 86 | $driver_name = empty($this->dbsettings['sn_driver']) ? 'db_mysql_v5' : $this->dbsettings['sn_driver']; |
87 | 87 | $this->driver = new $driver_name(); |
88 | 88 | $this->db_prefix = $this->dbsettings['prefix']; |
89 | 89 | |
90 | 90 | $this->connected = $this->connected || $this->driver_connect(); |
91 | 91 | |
92 | - if($this->connected) { |
|
92 | + if ($this->connected) { |
|
93 | 93 | $this->table_list = $this->db_get_table_list(); |
94 | 94 | // TODO Проверка на пустоту |
95 | 95 | } |
@@ -101,11 +101,11 @@ discard block |
||
101 | 101 | } |
102 | 102 | |
103 | 103 | protected function driver_connect() { |
104 | - if(!is_object($this->driver)) { |
|
104 | + if (!is_object($this->driver)) { |
|
105 | 105 | classSupernova::$debug->error_fatal('DB Error - No driver for MySQL found!'); |
106 | 106 | } |
107 | 107 | |
108 | - if(!method_exists($this->driver, 'mysql_connect')) { |
|
108 | + if (!method_exists($this->driver, 'mysql_connect')) { |
|
109 | 109 | classSupernova::$debug->error_fatal('DB Error - WRONG MySQL driver!'); |
110 | 110 | } |
111 | 111 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | } |
114 | 114 | |
115 | 115 | public function db_disconnect() { |
116 | - if($this->connected) { |
|
116 | + if ($this->connected) { |
|
117 | 117 | $this->connected = !$this->driver_disconnect(); |
118 | 118 | $this->connected = false; |
119 | 119 | } |
@@ -128,9 +128,9 @@ discard block |
||
128 | 128 | */ |
129 | 129 | public function replaceTablePlaceholders($query) { |
130 | 130 | $sql = $query; |
131 | - if(strpos($sql, '{{') !== false) { |
|
132 | - foreach($this->table_list as $tableName) { |
|
133 | - $sql = str_replace("{{{$tableName}}}", $this->db_prefix . $tableName, $sql); |
|
131 | + if (strpos($sql, '{{') !== false) { |
|
132 | + foreach ($this->table_list as $tableName) { |
|
133 | + $sql = str_replace("{{{$tableName}}}", $this->db_prefix.$tableName, $sql); |
|
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | * @param $fetch |
143 | 143 | */ |
144 | 144 | protected function logQuery($query, $fetch) { |
145 | - if(!classSupernova::$config->debug) { |
|
145 | + if (!classSupernova::$config->debug) { |
|
146 | 146 | return; |
147 | 147 | } |
148 | 148 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $arr = debug_backtrace(); |
151 | 151 | $file = end(explode('/', $arr[0]['file'])); |
152 | 152 | $line = $arr[0]['line']; |
153 | - classSupernova::$debug->add("<tr><th>Query {$this->queryCount}: </th><th>$query</th><th>{$file} @ {$line}</th><th> </th><th> " . ($fetch ? '+' : ' ') . " </th></tr>"); |
|
153 | + classSupernova::$debug->add("<tr><th>Query {$this->queryCount}: </th><th>$query</th><th>{$file} @ {$line}</th><th> </th><th> ".($fetch ? '+' : ' ')." </th></tr>"); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | |
@@ -160,18 +160,18 @@ discard block |
||
160 | 160 | * @return void |
161 | 161 | */ |
162 | 162 | protected function commentQuery(&$sql) { |
163 | - if(!defined('DEBUG_SQL_COMMENT')) { |
|
163 | + if (!defined('DEBUG_SQL_COMMENT')) { |
|
164 | 164 | return; |
165 | 165 | } |
166 | 166 | $backtrace = debug_backtrace(); |
167 | 167 | $sql_comment = classSupernova::$debug->compact_backtrace($backtrace, defined('DEBUG_SQL_COMMENT_LONG')); |
168 | 168 | |
169 | - $sql_commented = '/* ' . implode("<br />", $sql_comment) . '<br /> */ ' . preg_replace("/\s+/", ' ', $sql); |
|
170 | - if(defined('DEBUG_SQL_ONLINE')) { |
|
169 | + $sql_commented = '/* '.implode("<br />", $sql_comment).'<br /> */ '.preg_replace("/\s+/", ' ', $sql); |
|
170 | + if (defined('DEBUG_SQL_ONLINE')) { |
|
171 | 171 | classSupernova::$debug->warning($sql_commented, 'SQL Debug', LOG_DEBUG_SQL); |
172 | 172 | } |
173 | 173 | |
174 | - if(defined('DEBUG_SQL_ERROR')) { |
|
174 | + if (defined('DEBUG_SQL_ERROR')) { |
|
175 | 175 | array_unshift($sql_comment, preg_replace("/\s+/", ' ', $sql)); |
176 | 176 | classSupernova::$debug->add_to_array($sql_comment); |
177 | 177 | } |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | * @return array|bool|mysqli_result|null |
186 | 186 | */ |
187 | 187 | public function execute($statement) { |
188 | - return $this->doquery((string)$statement); |
|
188 | + return $this->doquery((string) $statement); |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | /** |
@@ -199,11 +199,11 @@ discard block |
||
199 | 199 | } |
200 | 200 | |
201 | 201 | public function doquery($query, $table = '', $fetch = false, $skip_query_check = false) { |
202 | - if(!is_string($table)) { |
|
202 | + if (!is_string($table)) { |
|
203 | 203 | $fetch = $table; |
204 | 204 | } |
205 | 205 | |
206 | - if(!$this->connected) { |
|
206 | + if (!$this->connected) { |
|
207 | 207 | $this->sn_db_connect(); |
208 | 208 | } |
209 | 209 | |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | |
215 | 215 | $sql = $this->replaceTablePlaceholders($query); |
216 | 216 | $this->commentQuery($sql); |
217 | - !($sqlquery = $this->db_sql_query($sql)) ? classSupernova::$debug->error(db_error() . "<br />$sql<br />", 'SQL Error') : false; |
|
217 | + !($sqlquery = $this->db_sql_query($sql)) ? classSupernova::$debug->error(db_error()."<br />$sql<br />", 'SQL Error') : false; |
|
218 | 218 | |
219 | 219 | return $fetch ? $this->db_fetch($sqlquery) : $sqlquery; |
220 | 220 | } |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | protected function security_watch_user_queries($query) { |
225 | 225 | global $user; |
226 | 226 | |
227 | - if( |
|
227 | + if ( |
|
228 | 228 | !$this->isWatching // Not already watching |
229 | 229 | && !empty(classSupernova::$config->game_watchlist_array) // There is some players in watchlist |
230 | 230 | && in_array($user['id'], classSupernova::$config->game_watchlist_array) // Current player is in watchlist |
@@ -232,11 +232,11 @@ discard block |
||
232 | 232 | ) { |
233 | 233 | $this->isWatching = true; |
234 | 234 | $msg = "\$query = \"{$query}\"\n\r"; |
235 | - if(!empty($_POST)) { |
|
236 | - $msg .= "\n\r" . dump($_POST, '$_POST'); |
|
235 | + if (!empty($_POST)) { |
|
236 | + $msg .= "\n\r".dump($_POST, '$_POST'); |
|
237 | 237 | } |
238 | - if(!empty($_GET)) { |
|
239 | - $msg .= "\n\r" . dump($_GET, '$_GET'); |
|
238 | + if (!empty($_GET)) { |
|
239 | + $msg .= "\n\r".dump($_GET, '$_GET'); |
|
240 | 240 | } |
241 | 241 | classSupernova::$debug->warning($msg, "Watching user {$user['id']}", 399, array('base_dump' => true)); |
242 | 242 | $this->isWatching = false; |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | public function security_query_check_bad_words($query) { |
248 | 248 | global $user, $dm_change_legit, $mm_change_legit; |
249 | 249 | |
250 | - switch(true) { |
|
250 | + switch (true) { |
|
251 | 251 | case stripos($query, 'RUNCATE TABL') != false: |
252 | 252 | case stripos($query, 'ROP TABL') != false: |
253 | 253 | case stripos($query, 'ENAME TABL') != false: |
@@ -258,37 +258,37 @@ discard block |
||
258 | 258 | case stripos($query, 'RPG_POINTS') != false && stripos(trim($query), 'UPDATE ') === 0 && !$dm_change_legit: |
259 | 259 | case stripos($query, 'METAMATTER') != false && stripos(trim($query), 'UPDATE ') === 0 && !$mm_change_legit: |
260 | 260 | case stripos($query, 'AUTHLEVEL') != false && $user['authlevel'] < 3 && stripos($query, 'SELECT') !== 0: |
261 | - $report = "Hacking attempt (" . date("d.m.Y H:i:s") . " - [" . time() . "]):\n"; |
|
261 | + $report = "Hacking attempt (".date("d.m.Y H:i:s")." - [".time()."]):\n"; |
|
262 | 262 | $report .= ">Database Inforamation\n"; |
263 | - $report .= "\tID - " . $user['id'] . "\n"; |
|
264 | - $report .= "\tUser - " . $user['username'] . "\n"; |
|
265 | - $report .= "\tAuth level - " . $user['authlevel'] . "\n"; |
|
266 | - $report .= "\tAdmin Notes - " . $user['adminNotes'] . "\n"; |
|
267 | - $report .= "\tCurrent Planet - " . $user['current_planet'] . "\n"; |
|
268 | - $report .= "\tUser IP - " . $user['user_lastip'] . "\n"; |
|
269 | - $report .= "\tUser IP at Reg - " . $user['ip_at_reg'] . "\n"; |
|
270 | - $report .= "\tUser Agent- " . $_SERVER['HTTP_USER_AGENT'] . "\n"; |
|
271 | - $report .= "\tCurrent Page - " . $user['current_page'] . "\n"; |
|
272 | - $report .= "\tRegister Time - " . $user['register_time'] . "\n"; |
|
263 | + $report .= "\tID - ".$user['id']."\n"; |
|
264 | + $report .= "\tUser - ".$user['username']."\n"; |
|
265 | + $report .= "\tAuth level - ".$user['authlevel']."\n"; |
|
266 | + $report .= "\tAdmin Notes - ".$user['adminNotes']."\n"; |
|
267 | + $report .= "\tCurrent Planet - ".$user['current_planet']."\n"; |
|
268 | + $report .= "\tUser IP - ".$user['user_lastip']."\n"; |
|
269 | + $report .= "\tUser IP at Reg - ".$user['ip_at_reg']."\n"; |
|
270 | + $report .= "\tUser Agent- ".$_SERVER['HTTP_USER_AGENT']."\n"; |
|
271 | + $report .= "\tCurrent Page - ".$user['current_page']."\n"; |
|
272 | + $report .= "\tRegister Time - ".$user['register_time']."\n"; |
|
273 | 273 | $report .= "\n"; |
274 | 274 | |
275 | 275 | $report .= ">Query Information\n"; |
276 | - $report .= "\tQuery - " . $query . "\n"; |
|
276 | + $report .= "\tQuery - ".$query."\n"; |
|
277 | 277 | $report .= "\n"; |
278 | 278 | |
279 | 279 | $report .= ">\$_SERVER Information\n"; |
280 | - $report .= "\tIP - " . $_SERVER['REMOTE_ADDR'] . "\n"; |
|
281 | - $report .= "\tHost Name - " . $_SERVER['HTTP_HOST'] . "\n"; |
|
282 | - $report .= "\tUser Agent - " . $_SERVER['HTTP_USER_AGENT'] . "\n"; |
|
283 | - $report .= "\tRequest Method - " . $_SERVER['REQUEST_METHOD'] . "\n"; |
|
284 | - $report .= "\tCame From - " . $_SERVER['HTTP_REFERER'] . "\n"; |
|
285 | - $report .= "\tPage is - " . $_SERVER['SCRIPT_NAME'] . "\n"; |
|
286 | - $report .= "\tUses Port - " . $_SERVER['REMOTE_PORT'] . "\n"; |
|
287 | - $report .= "\tServer Protocol - " . $_SERVER['SERVER_PROTOCOL'] . "\n"; |
|
280 | + $report .= "\tIP - ".$_SERVER['REMOTE_ADDR']."\n"; |
|
281 | + $report .= "\tHost Name - ".$_SERVER['HTTP_HOST']."\n"; |
|
282 | + $report .= "\tUser Agent - ".$_SERVER['HTTP_USER_AGENT']."\n"; |
|
283 | + $report .= "\tRequest Method - ".$_SERVER['REQUEST_METHOD']."\n"; |
|
284 | + $report .= "\tCame From - ".$_SERVER['HTTP_REFERER']."\n"; |
|
285 | + $report .= "\tPage is - ".$_SERVER['SCRIPT_NAME']."\n"; |
|
286 | + $report .= "\tUses Port - ".$_SERVER['REMOTE_PORT']."\n"; |
|
287 | + $report .= "\tServer Protocol - ".$_SERVER['SERVER_PROTOCOL']."\n"; |
|
288 | 288 | |
289 | 289 | $report .= "\n--------------------------------------------------------------------------------------------------\n"; |
290 | 290 | |
291 | - $fp = fopen(SN_ROOT_PHYSICAL . 'badqrys.txt', 'a'); |
|
291 | + $fp = fopen(SN_ROOT_PHYSICAL.'badqrys.txt', 'a'); |
|
292 | 292 | fwrite($fp, $report); |
293 | 293 | fclose($fp); |
294 | 294 | |
@@ -309,11 +309,11 @@ discard block |
||
309 | 309 | $prefix_length = strlen($this->db_prefix); |
310 | 310 | |
311 | 311 | $tl = array(); |
312 | - while($row = $this->db_fetch($query)) { |
|
313 | - foreach($row as $table_name) { |
|
314 | - if(strpos($table_name, $this->db_prefix) === 0) { |
|
312 | + while ($row = $this->db_fetch($query)) { |
|
313 | + foreach ($row as $table_name) { |
|
314 | + if (strpos($table_name, $this->db_prefix) === 0) { |
|
315 | 315 | $table_name = substr($table_name, $prefix_length); |
316 | - } elseif($prefixed_only) { |
|
316 | + } elseif ($prefixed_only) { |
|
317 | 317 | continue; |
318 | 318 | } |
319 | 319 | // $table_name = str_replace($db_prefix, '', $table_name); |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | $result = array(); |
409 | 409 | |
410 | 410 | $status = explode(' ', $this->driver->mysql_stat()); |
411 | - foreach($status as $value) { |
|
411 | + foreach ($status as $value) { |
|
412 | 412 | $row = explode(': ', $value); |
413 | 413 | $result[$row[0]] = $row[1]; |
414 | 414 | } |
@@ -424,10 +424,10 @@ discard block |
||
424 | 424 | $result = array(); |
425 | 425 | |
426 | 426 | $query = $this->db_sql_query('SHOW STATUS;'); |
427 | - if(is_bool($query)) { |
|
427 | + if (is_bool($query)) { |
|
428 | 428 | throw new Exception('Result of SHOW STATUS command is boolean - which should never happen. Connection to DB is lost?'); |
429 | 429 | } |
430 | - while($row = db_fetch($query)) { |
|
430 | + while ($row = db_fetch($query)) { |
|
431 | 431 | $result[$row['Variable_name']] = $row['Value']; |
432 | 432 | } |
433 | 433 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * @param $note_id_edit |
37 | 37 | */ |
38 | 38 | public static function db_note_update_by_id($note_priority, $note_title, $note_text, $note_galaxy, $note_system, $note_planet, $note_planet_type, $note_sticky, $note_id_edit) { |
39 | - doquery("UPDATE {{notes}} SET `time` = " . SN_TIME_NOW . ", `priority` = {$note_priority}, `title` = '{$note_title}', `text` = '{$note_text}', |
|
39 | + doquery("UPDATE {{notes}} SET `time` = ".SN_TIME_NOW.", `priority` = {$note_priority}, `title` = '{$note_title}', `text` = '{$note_text}', |
|
40 | 40 | `galaxy` = {$note_galaxy}, `system` = {$note_system}, `planet` = {$note_planet}, `planet_type` = {$note_planet_type}, `sticky` = {$note_sticky} |
41 | 41 | WHERE `id` = {$note_id_edit} LIMIT 1;"); |
42 | 42 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * @param $note_sticky |
54 | 54 | */ |
55 | 55 | public static function db_note_insert($user, $note_priority, $note_title, $note_text, $note_galaxy, $note_system, $note_planet, $note_planet_type, $note_sticky) { |
56 | - doquery("INSERT INTO {{notes}} SET `owner` = {$user['id']}, `time` = " . SN_TIME_NOW . ", `priority` = {$note_priority}, `title` = '{$note_title}', `text` = '{$note_text}', |
|
56 | + doquery("INSERT INTO {{notes}} SET `owner` = {$user['id']}, `time` = ".SN_TIME_NOW.", `priority` = {$note_priority}, `title` = '{$note_title}', `text` = '{$note_text}', |
|
57 | 57 | `galaxy` = {$note_galaxy}, `system` = {$note_system}, `planet` = {$note_planet}, `planet_type` = {$note_planet_type}, `sticky` = {$note_sticky};"); |
58 | 58 | } |
59 | 59 |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public static function getRecordById($recordId, $fieldList = '*', $forUpdate = false) { |
65 | 65 | // return static::getRecord(array(static::$_idField => $recordId), $fieldList, $forUpdate); |
66 | - return static::getRecord(array(static::$_idField . '=' . $recordId), $fieldList, $forUpdate); |
|
66 | + return static::getRecord(array(static::$_idField.'='.$recordId), $fieldList, $forUpdate); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | DbSqlStatement::build(null, get_called_class()) |
85 | 85 | ->select() |
86 | 86 | ->fields(static::$_idField) |
87 | - ->where(array("`" . static::$_idField . "` IN (" . implode(',', $idList) . ")")) |
|
87 | + ->where(array("`".static::$_idField."` IN (".implode(',', $idList).")")) |
|
88 | 88 | ); |
89 | 89 | } |
90 | 90 |
@@ -19,15 +19,11 @@ discard block |
||
19 | 19 | // ------------------------------------------------------------------ |
20 | 20 | function flt_flyingFleetsSort($a, $b) { |
21 | 21 | // Сравниваем время флотов - кто раньше, тот и первый обрабатывается |
22 | - return $a['fleet_time'] > $b['fleet_time'] ? 1 : ($a['fleet_time'] < $b['fleet_time'] ? -1 : |
|
23 | - // Если время - одинаковое, сравниваем события флотов |
|
22 | + return $a['fleet_time'] > $b['fleet_time'] ? 1 : ($a['fleet_time'] < $b['fleet_time'] ? -1 : // Если время - одинаковое, сравниваем события флотов |
|
24 | 23 | // Если события - одинаковые, то флоты равны |
25 | - ($a['fleet_event'] == $b['fleet_event'] ? 0 : |
|
26 | - // Если события разные - первыми считаем прибывающие флоты |
|
27 | - ($a['fleet_event'] == EVENT_FLT_ARRIVE ? 1 : ($b['fleet_event'] == EVENT_FLT_ARRIVE ? -1 : |
|
28 | - // Если нет прибывающих флотов - дальше считаем флоты, которые закончили миссию |
|
29 | - ($a['fleet_event'] == EVENT_FLT_ACOMPLISH ? 1 : ($b['fleet_event'] == EVENT_FLT_ACOMPLISH ? -1 : |
|
30 | - // Если нет флотов, закончивших задание - остались возвращающиеся флоты, которые равны между собой |
|
24 | + ($a['fleet_event'] == $b['fleet_event'] ? 0 : // Если события разные - первыми считаем прибывающие флоты |
|
25 | + ($a['fleet_event'] == EVENT_FLT_ARRIVE ? 1 : ($b['fleet_event'] == EVENT_FLT_ARRIVE ? -1 : // Если нет прибывающих флотов - дальше считаем флоты, которые закончили миссию |
|
26 | + ($a['fleet_event'] == EVENT_FLT_ACOMPLISH ? 1 : ($b['fleet_event'] == EVENT_FLT_ACOMPLISH ? -1 : // Если нет флотов, закончивших задание - остались возвращающиеся флоты, которые равны между собой |
|
31 | 27 | // TODO: Добавить еще проверку по ID флота и/или времени запуска - что бы обсчитывать их в порядке запуска |
32 | 28 | ( |
33 | 29 | 0 // Вообще сюда доходить не должно - будет отсекаться на равенстве событий |
@@ -45,13 +41,13 @@ discard block |
||
45 | 41 | $handler = fopen('event.log', 'a+'); |
46 | 42 | } |
47 | 43 | |
48 | - fwrite($handler, date(FMT_DATE_TIME_SQL, time()) . ' ' . $msg . "\r\n"); |
|
44 | + fwrite($handler, date(FMT_DATE_TIME_SQL, time()).' '.$msg."\r\n"); |
|
49 | 45 | } |
50 | 46 | |
51 | 47 | // ------------------------------------------------------------------ |
52 | 48 | function flt_flying_fleet_handler($skip_fleet_update = false) { |
53 | 49 | if (true) { |
54 | - if(!defined('IN_AJAX')) { |
|
50 | + if (!defined('IN_AJAX')) { |
|
55 | 51 | print('<div style="color: red; font-size: 300%">Fleet handler is disabled</div>'); |
56 | 52 | pdump('Fleet handler is disabled'); |
57 | 53 | } |
@@ -177,7 +173,7 @@ discard block |
||
177 | 173 | MT_EXPLORE => 'flt_mission_explore', |
178 | 174 | ); |
179 | 175 | foreach ($missions_used as $mission_id => $cork) { |
180 | - require_once(SN_ROOT_PHYSICAL . "includes/includes/{$mission_files[$mission_id]}" . DOT_PHP_EX); |
|
176 | + require_once(SN_ROOT_PHYSICAL."includes/includes/{$mission_files[$mission_id]}".DOT_PHP_EX); |
|
181 | 177 | } |
182 | 178 | |
183 | 179 | //log_file('Обработка миссий'); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | static::buildSelect() |
50 | 50 | ->fields('id') |
51 | 51 | ->where(array( |
52 | - "`user_as_ally` IS NULL AND `user_bot` = " . USER_BOT_PLAYER . " FOR UPDATE;" |
|
52 | + "`user_as_ally` IS NULL AND `user_bot` = ".USER_BOT_PLAYER." FOR UPDATE;" |
|
53 | 53 | )) |
54 | 54 | ); |
55 | 55 | |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | public static function db_user_lock_with_target_owner_and_acs($user, $planet = array()) { |
62 | 62 | static::$dbStatic->execute( |
63 | 63 | static::buildSelectLock() |
64 | - ->where(array("`id` = " . idval($user['id']) . |
|
65 | - (isset($planet['id_owner']) ? ' OR `id` = ' . idval($planet['id_owner']) : ''))) |
|
64 | + ->where(array("`id` = ".idval($user['id']). |
|
65 | + (isset($planet['id_owner']) ? ' OR `id` = '.idval($planet['id_owner']) : ''))) |
|
66 | 66 | ); |
67 | 67 | |
68 | 68 | // doquery("SELECT 1 FROM {{users}} WHERE `id` = " . idval($user['id']) . |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | } |
73 | 73 | |
74 | 74 | public static function db_user_count($online = false) { |
75 | - $result = doquery('SELECT COUNT(id) AS user_count FROM `{{users}}` WHERE user_as_ally IS NULL' . ($online ? ' AND onlinetime > ' . (SN_TIME_NOW - classSupernova::$config->game_users_online_timeout) : ''), true); |
|
75 | + $result = doquery('SELECT COUNT(id) AS user_count FROM `{{users}}` WHERE user_as_ally IS NULL'.($online ? ' AND onlinetime > '.(SN_TIME_NOW - classSupernova::$config->game_users_online_timeout) : ''), true); |
|
76 | 76 | |
77 | 77 | return isset($result['user_count']) ? $result['user_count'] : 0; |
78 | 78 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | return doquery("SELECT u.*, COUNT(r.id) AS referral_count, SUM(r.dark_matter) AS referral_dm FROM {{users}} as u |
113 | 113 | LEFT JOIN {{referrals}} as r on r.id_partner = u.id |
114 | 114 | WHERE" . |
115 | - ($online ? " `onlinetime` >= " . (SN_TIME_NOW - classSupernova::$config->game_users_online_timeout) : ' user_as_ally IS NULL') . |
|
115 | + ($online ? " `onlinetime` >= ".(SN_TIME_NOW - classSupernova::$config->game_users_online_timeout) : ' user_as_ally IS NULL'). |
|
116 | 116 | " GROUP BY u.id |
117 | 117 | ORDER BY user_as_ally, {$sort} ASC"); |
118 | 118 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | } |
169 | 169 | |
170 | 170 | public static function db_user_list_set_mass_mail(&$owners_list, $set) { |
171 | - return classSupernova::db_upd_record_list(LOC_USER, !empty($owners_list) ? '`id` IN (' . implode(',', $owners_list) . ');' : '', $set); |
|
171 | + return classSupernova::db_upd_record_list(LOC_USER, !empty($owners_list) ? '`id` IN ('.implode(',', $owners_list).');' : '', $set); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | public static function db_user_list_set_by_ally_and_rank($ally_id, $ally_rank_id, $set) { |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | public static function cache_clear($location_type, $hard = true) { |
237 | 237 | if ($hard && !empty(static::$data[$location_type])) { |
238 | 238 | // Здесь нельзя делать unset - надо записывать NULL, что бы это отразилось на зависимых записях |
239 | - array_walk(static::$data[$location_type], function (&$item) { $item = null; }); |
|
239 | + array_walk(static::$data[$location_type], function(&$item) { $item = null; }); |
|
240 | 240 | } |
241 | 241 | static::$locator[$location_type] = array(); |
242 | 242 | static::$queries[$location_type] = array(); |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | |
355 | 355 | if (!empty($error_msg)) { |
356 | 356 | // TODO - Убрать позже |
357 | - print('<h1>СООБЩИТЕ ЭТО АДМИНУ: sn_db_transaction_check() - ' . $error_msg . '</h1>'); |
|
357 | + print('<h1>СООБЩИТЕ ЭТО АДМИНУ: sn_db_transaction_check() - '.$error_msg.'</h1>'); |
|
358 | 358 | $backtrace = debug_backtrace(); |
359 | 359 | array_shift($backtrace); |
360 | 360 | pdump($backtrace); |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | public static function db_transaction_start($level = '') { |
368 | 368 | static::db_transaction_check(null); |
369 | 369 | |
370 | - $level ? doquery('SET TRANSACTION ISOLATION LEVEL ' . $level) : false; |
|
370 | + $level ? doquery('SET TRANSACTION ISOLATION LEVEL '.$level) : false; |
|
371 | 371 | |
372 | 372 | static::$transaction_id++; |
373 | 373 | doquery('START TRANSACTION'); |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | public static function db_lock_tables($tables) { |
428 | 428 | $tables = is_array($tables) ? $tables : array($tables => ''); |
429 | 429 | foreach ($tables as $table_name => $condition) { |
430 | - self::$db->doquery("SELECT 1 FROM {{{$table_name}}}" . ($condition ? ' WHERE ' . $condition : '')); |
|
430 | + self::$db->doquery("SELECT 1 FROM {{{$table_name}}}".($condition ? ' WHERE '.$condition : '')); |
|
431 | 431 | } |
432 | 432 | } |
433 | 433 | |
@@ -503,8 +503,8 @@ discard block |
||
503 | 503 | $query = static::db_query( |
504 | 504 | "SELECT |
505 | 505 | distinct({{{$location_info[P_TABLE_NAME]}}}.{$owner_data[P_OWNER_FIELD]}) AS parent_id |
506 | - FROM {{{$location_info[P_TABLE_NAME]}}}" . |
|
507 | - ($filter ? ' WHERE ' . $filter : '') . |
|
506 | + FROM {{{$location_info[P_TABLE_NAME]}}}". |
|
507 | + ($filter ? ' WHERE '.$filter : ''). |
|
508 | 508 | ($fetch ? ' LIMIT 1' : ''), false, true); |
509 | 509 | |
510 | 510 | while ($row = db_fetch($query)) { |
@@ -517,13 +517,13 @@ discard block |
||
517 | 517 | if ($indexes_str = implode(',', $parent_id_list)) { |
518 | 518 | $parent_id_field = static::$location_info[$owner_location_type][P_ID]; |
519 | 519 | static::db_get_record_list($owner_location_type, |
520 | - $parent_id_field . (count($parent_id_list) > 1 ? " IN ({$indexes_str})" : " = {$indexes_str}"), $fetch, true); |
|
520 | + $parent_id_field.(count($parent_id_list) > 1 ? " IN ({$indexes_str})" : " = {$indexes_str}"), $fetch, true); |
|
521 | 521 | } |
522 | 522 | } |
523 | 523 | } |
524 | 524 | |
525 | 525 | $query = static::db_query( |
526 | - "SELECT * FROM {{{$location_info[P_TABLE_NAME]}}}" . |
|
526 | + "SELECT * FROM {{{$location_info[P_TABLE_NAME]}}}". |
|
527 | 527 | (($filter = trim($filter)) ? " WHERE {$filter}" : '') |
528 | 528 | ); |
529 | 529 | while ($row = db_fetch($query)) { |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | $condition = trim($condition); |
590 | 590 | $table_name = static::$location_info[$location_type][P_TABLE_NAME]; |
591 | 591 | |
592 | - if ($result = static::db_query("UPDATE {{{$table_name}}} SET " . $set . ($condition ? ' WHERE ' . $condition : ''))) { |
|
592 | + if ($result = static::db_query("UPDATE {{{$table_name}}} SET ".$set.($condition ? ' WHERE '.$condition : ''))) { |
|
593 | 593 | |
594 | 594 | if (static::$db->db_affected_rows()) { // Обновляем данные только если ряд был затронут |
595 | 595 | // Поскольку нам неизвестно, что и как обновилось - сбрасываем кэш этого типа полностью |
@@ -751,7 +751,7 @@ discard block |
||
751 | 751 | // TODO переписать |
752 | 752 | $user = static::dbFetchOne( |
753 | 753 | DBStaticUser::buildSelect() |
754 | - ->where(array("`username` " . ($like ? 'LIKE' : '=') . " '{$username_safe}'")) |
|
754 | + ->where(array("`username` ".($like ? 'LIKE' : '=')." '{$username_safe}'")) |
|
755 | 755 | ); |
756 | 756 | |
757 | 757 | // $user = static::db_query( |
@@ -844,7 +844,7 @@ discard block |
||
844 | 844 | |
845 | 845 | $query_cache = &static::$locator[LOC_UNIT][$location_type][$location_id]; |
846 | 846 | if (!isset($query_cache)) { |
847 | - $got_data = static::db_get_record_list(LOC_UNIT, "unit_location_type = {$location_type} AND unit_location_id = {$location_id} AND " . static::db_unit_time_restrictions()); |
|
847 | + $got_data = static::db_get_record_list(LOC_UNIT, "unit_location_type = {$location_type} AND unit_location_id = {$location_id} AND ".static::db_unit_time_restrictions()); |
|
848 | 848 | if (is_array($got_data)) { |
849 | 849 | foreach ($got_data as $unit_id => $unit_data) { |
850 | 850 | $query_cache[$unit_data['unit_snid']] = &static::$data[LOC_UNIT][$unit_id]; |
@@ -905,7 +905,7 @@ discard block |
||
905 | 905 | if ($que_type == QUE_RESEARCH || $planet_id === null) { |
906 | 906 | $query[] = "`que_planet_id` IS NULL"; |
907 | 907 | } elseif ($planet_id) { |
908 | - $query[] = "(`que_planet_id` = {$planet_id}" . ($que_type ? '' : ' OR que_planet_id IS NULL') . ")"; |
|
908 | + $query[] = "(`que_planet_id` = {$planet_id}".($que_type ? '' : ' OR que_planet_id IS NULL').")"; |
|
909 | 909 | } |
910 | 910 | if ($que_type) { |
911 | 911 | $query[] = "`que_type` = {$que_type}"; |
@@ -1026,13 +1026,13 @@ discard block |
||
1026 | 1026 | $condition = "`{$field_name}` = "; |
1027 | 1027 | $value = ''; |
1028 | 1028 | if ($field_data['delta']) { |
1029 | - $value = "`{$field_name}`" . ($field_data['delta'] >= 0 ? '+' : '') . $field_data['delta']; |
|
1029 | + $value = "`{$field_name}`".($field_data['delta'] >= 0 ? '+' : '').$field_data['delta']; |
|
1030 | 1030 | } elseif ($field_data['set']) { |
1031 | 1031 | $value = (is_string($field_data['set']) ? "'{$field_data['set']}'" : $field_data['set']); |
1032 | 1032 | } |
1033 | 1033 | |
1034 | 1034 | if ($value) { |
1035 | - $fields[] = $condition . $value; |
|
1035 | + $fields[] = $condition.$value; |
|
1036 | 1036 | } |
1037 | 1037 | } |
1038 | 1038 | $conditions[P_FIELDS_STR] = implode(',', $fields); |
@@ -1046,9 +1046,7 @@ discard block |
||
1046 | 1046 | // Простое условие - $field_id = $field_value |
1047 | 1047 | if (is_string($field_id)) { |
1048 | 1048 | $field_value = |
1049 | - $field_value === null ? 'NULL' : |
|
1050 | - (is_string($field_value) ? "'" . db_escape($field_value) . "'" : |
|
1051 | - (is_bool($field_value) ? intval($field_value) : $field_value)); |
|
1049 | + $field_value === null ? 'NULL' : (is_string($field_value) ? "'".db_escape($field_value)."'" : (is_bool($field_value) ? intval($field_value) : $field_value)); |
|
1052 | 1050 | $the_conditions[] = "`{$field_id}` = {$field_value}"; |
1053 | 1051 | } else { |
1054 | 1052 | die('Неподдерживаемый тип условия'); |
@@ -1075,7 +1073,7 @@ discard block |
||
1075 | 1073 | die('Неподдерживаемая операция в classSupernova::db_changeset_condition_compile'); |
1076 | 1074 | } |
1077 | 1075 | |
1078 | - $conditions[P_QUERY_STR] = $conditions[P_ACTION_STR] . ' ' . $conditions[P_FIELDS_STR] . (' WHERE ' . $conditions[P_WHERE_STR]); |
|
1076 | + $conditions[P_QUERY_STR] = $conditions[P_ACTION_STR].' '.$conditions[P_FIELDS_STR].(' WHERE '.$conditions[P_WHERE_STR]); |
|
1079 | 1077 | } |
1080 | 1078 | |
1081 | 1079 | public static function db_changeset_apply($db_changeset, $flush_delayed = false) { |
@@ -1173,7 +1171,7 @@ discard block |
||
1173 | 1171 | ini_get('magic_quotes_sybase') ? die('SN is incompatible with \'magic_quotes_sybase\' turned on. Disable it in php.ini or .htaccess...') : false; |
1174 | 1172 | if (@get_magic_quotes_gpc()) { |
1175 | 1173 | $gpcr = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST); |
1176 | - array_walk_recursive($gpcr, function (&$value, $key) { |
|
1174 | + array_walk_recursive($gpcr, function(&$value, $key) { |
|
1177 | 1175 | $value = stripslashes($value); |
1178 | 1176 | }); |
1179 | 1177 | } |
@@ -1187,7 +1185,7 @@ discard block |
||
1187 | 1185 | public static function init_3_load_config_file() { |
1188 | 1186 | $dbsettings = array(); |
1189 | 1187 | |
1190 | - require(SN_ROOT_PHYSICAL . "config" . DOT_PHP_EX); |
|
1188 | + require(SN_ROOT_PHYSICAL."config".DOT_PHP_EX); |
|
1191 | 1189 | self::$cache_prefix = !empty($dbsettings['cache_prefix']) ? $dbsettings['cache_prefix'] : $dbsettings['prefix']; |
1192 | 1190 | self::$db_name = $dbsettings['name']; |
1193 | 1191 | self::$sn_secret_word = $dbsettings['secretword']; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | define('INSTALL', false); |
11 | 11 | define('IN_ADMIN', true); |
12 | 12 | |
13 | -require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
13 | +require('../common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
14 | 14 | |
15 | 15 | if ($user['authlevel'] < 3) { |
16 | 16 | AdminMessage(classLocale::$lang['adm_err_denied']); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | foreach ($value as $interval_data) { |
112 | 112 | print("<tr>"); |
113 | 113 | print("<td>{$user_id}</td><td>{$user_record['username']}</td><td>{$interval_data[0]}</td><td>{$interval_data[1]}</td><td>{$interval_data[2]}</td>"); |
114 | - print("<td>" . date(FMT_DATE_TIME_SQL, $user_record['onlinetime']) . "</td>"); |
|
114 | + print("<td>".date(FMT_DATE_TIME_SQL, $user_record['onlinetime'])."</td>"); |
|
115 | 115 | print("</tr>"); |
116 | 116 | } |
117 | 117 | } |
@@ -243,9 +243,9 @@ discard block |
||
243 | 243 | } |
244 | 244 | |
245 | 245 | protected function compileFrom() { |
246 | - $this->_compiledQuery[] = 'FROM `{{' . $this->stringEscape($this->table) . '}}`'; |
|
246 | + $this->_compiledQuery[] = 'FROM `{{'.$this->stringEscape($this->table).'}}`'; |
|
247 | 247 | if (!empty($this->alias)) { |
248 | - $this->_compiledQuery[] = 'AS `' . $this->stringEscape($this->alias) . '`'; |
|
248 | + $this->_compiledQuery[] = 'AS `'.$this->stringEscape($this->alias).'`'; |
|
249 | 249 | } |
250 | 250 | } |
251 | 251 | |
@@ -254,28 +254,28 @@ discard block |
||
254 | 254 | |
255 | 255 | protected function compileWhere() { |
256 | 256 | // TODO - fields should be escaped !! |
257 | - !empty($this->where) ? $this->_compiledQuery[] = 'WHERE ' . implode(' AND ', $this->where) : false; |
|
257 | + !empty($this->where) ? $this->_compiledQuery[] = 'WHERE '.implode(' AND ', $this->where) : false; |
|
258 | 258 | } |
259 | 259 | |
260 | 260 | protected function compileGroupBy() { |
261 | 261 | // TODO - fields should be escaped !! |
262 | - !empty($this->groupBy) ? $this->_compiledQuery[] = 'GROUP BY ' . implode(',', $this->arrayEscape($this->groupBy)) : false; |
|
262 | + !empty($this->groupBy) ? $this->_compiledQuery[] = 'GROUP BY '.implode(',', $this->arrayEscape($this->groupBy)) : false; |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | protected function compileOrderBy() { |
266 | 266 | // TODO - fields should be escaped !! |
267 | - !empty($this->orderBy) ? $this->_compiledQuery[] = 'ORDER BY ' . implode(',', $this->arrayEscape($this->orderBy)) : false; |
|
267 | + !empty($this->orderBy) ? $this->_compiledQuery[] = 'ORDER BY '.implode(',', $this->arrayEscape($this->orderBy)) : false; |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | protected function compileHaving() { |
271 | 271 | // TODO - fields should be escaped !! |
272 | - !empty($this->having) ? $this->_compiledQuery[] = 'HAVING ' . implode(' AND ', $this->having) : false; |
|
272 | + !empty($this->having) ? $this->_compiledQuery[] = 'HAVING '.implode(' AND ', $this->having) : false; |
|
273 | 273 | } |
274 | 274 | |
275 | 275 | protected function compileLimit() { |
276 | 276 | // TODO - fields should be escaped !! |
277 | 277 | if ($limit = $this->fetchOne ? 1 : $this->limit) { |
278 | - $this->_compiledQuery[] = 'LIMIT ' . $limit . (!empty($this->offset) ? ' OFFSET ' . $this->offset : ''); |
|
278 | + $this->_compiledQuery[] = 'LIMIT '.$limit.(!empty($this->offset) ? ' OFFSET '.$this->offset : ''); |
|
279 | 279 | } |
280 | 280 | } |
281 | 281 | |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | * @return string |
350 | 350 | */ |
351 | 351 | protected function processFieldString($fieldName) { |
352 | - $result = (string)$fieldName; |
|
352 | + $result = (string) $fieldName; |
|
353 | 353 | if ( |
354 | 354 | $result != '' |
355 | 355 | && |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | !($fieldName instanceof DbSqlLiteral) |
358 | 358 | ) { |
359 | 359 | // Other should be formatted |
360 | - $result = '`' . $this->stringEscape($result) . '`'; |
|
360 | + $result = '`'.$this->stringEscape($result).'`'; |
|
361 | 361 | } |
362 | 362 | |
363 | 363 | return $result; |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | */ |
371 | 371 | protected function processField($fieldName) { |
372 | 372 | if (is_bool($fieldName)) { |
373 | - $result = (string)intval($fieldName); |
|
373 | + $result = (string) intval($fieldName); |
|
374 | 374 | } elseif (is_numeric($fieldName)) { |
375 | 375 | $result = $fieldName; |
376 | 376 | } elseif (is_null($fieldName)) { |