@@ -23,7 +23,9 @@ discard block |
||
23 | 23 | function DBMysqli_innodb($auto_connect = TRUE) |
24 | 24 | { |
25 | 25 | $this->_setDBInfo(); |
26 | - if($auto_connect) $this->_connect(); |
|
26 | + if($auto_connect) { |
|
27 | + $this->_connect(); |
|
28 | + } |
|
27 | 29 | } |
28 | 30 | |
29 | 31 | /** |
@@ -51,8 +53,7 @@ discard block |
||
51 | 53 | , $connection["db_password"] |
52 | 54 | , $connection["db_database"] |
53 | 55 | , $connection["db_port"]); |
54 | - } |
|
55 | - else |
|
56 | + } else |
|
56 | 57 | { |
57 | 58 | $result = @mysqli_connect($connection["db_hostname"] |
58 | 59 | , $connection["db_userid"] |
@@ -92,8 +93,7 @@ discard block |
||
92 | 93 | if(!$transactionLevel) |
93 | 94 | { |
94 | 95 | $this->_query("begin"); |
95 | - } |
|
96 | - else |
|
96 | + } else |
|
97 | 97 | { |
98 | 98 | $this->_query("SAVEPOINT SP" . $transactionLevel, $connection); |
99 | 99 | } |
@@ -114,8 +114,7 @@ discard block |
||
114 | 114 | if($point) |
115 | 115 | { |
116 | 116 | $this->_query("ROLLBACK TO SP" . $point, $connection); |
117 | - } |
|
118 | - else |
|
117 | + } else |
|
119 | 118 | { |
120 | 119 | mysqli_rollback($connection); |
121 | 120 | $this->setQueryLog( array("query"=>"rollback") ); |
@@ -267,8 +266,7 @@ discard block |
||
267 | 266 | $params[] = $v; |
268 | 267 | $types .= $type; |
269 | 268 | } |
270 | - } |
|
271 | - else |
|
269 | + } else |
|
272 | 270 | { |
273 | 271 | $params[] = $value; |
274 | 272 | $types .= $type; |
@@ -307,10 +305,12 @@ discard block |
||
307 | 305 | $longtext_exists = false; |
308 | 306 | foreach($fields as $field) |
309 | 307 | { |
310 | - if(isset($resultArray[$field->name])) // When joined tables are used and the same column name appears twice, we should add it separately, otherwise bind_result fails |
|
308 | + if(isset($resultArray[$field->name])) { |
|
309 | + // When joined tables are used and the same column name appears twice, we should add it separately, otherwise bind_result fails |
|
311 | 310 | { |
312 | 311 | $field->name = 'repeat_' . $field->name; |
313 | 312 | } |
313 | + } |
|
314 | 314 | |
315 | 315 | // Array passed needs to contain references, not values |
316 | 316 | $row[$field->name] = ""; |
@@ -359,8 +359,7 @@ discard block |
||
359 | 359 | { |
360 | 360 | $output[$arrayIndexEndValue--] = $row; |
361 | 361 | } |
362 | - } |
|
363 | - else |
|
362 | + } else |
|
364 | 363 | { |
365 | 364 | $output = $rows; |
366 | 365 | } |
@@ -370,8 +369,7 @@ discard block |
||
370 | 369 | if(isset($arrayIndexEndValue)) |
371 | 370 | { |
372 | 371 | return $output; |
373 | - } |
|
374 | - else |
|
372 | + } else |
|
375 | 373 | { |
376 | 374 | return $output[0]; |
377 | 375 | } |
@@ -512,8 +510,7 @@ discard block |
||
512 | 510 | if(!is_array($xml_obj->table->column)) |
513 | 511 | { |
514 | 512 | $columns[] = $xml_obj->table->column; |
515 | - } |
|
516 | - else |
|
513 | + } else |
|
517 | 514 | { |
518 | 515 | $columns = $xml_obj->table->column; |
519 | 516 | } |
@@ -535,12 +532,10 @@ discard block |
||
535 | 532 | if($primary_key) |
536 | 533 | { |
537 | 534 | $primary_list[] = $name; |
538 | - } |
|
539 | - else if($unique) |
|
535 | + } else if($unique) |
|
540 | 536 | { |
541 | 537 | $unique_list[$unique][] = $name; |
542 | - } |
|
543 | - else if($index) |
|
538 | + } else if($index) |
|
544 | 539 | { |
545 | 540 | $index_list[$index][] = $name; |
546 | 541 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | function DBMysqli_innodb($auto_connect = TRUE) |
24 | 24 | { |
25 | 25 | $this->_setDBInfo(); |
26 | - if($auto_connect) $this->_connect(); |
|
26 | + if ($auto_connect) $this->_connect(); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | function __connect($connection) |
45 | 45 | { |
46 | 46 | // Attempt to connect |
47 | - if($connection["db_port"]) |
|
47 | + if ($connection["db_port"]) |
|
48 | 48 | { |
49 | 49 | $result = @mysqli_connect($connection["db_hostname"] |
50 | 50 | , $connection["db_userid"] |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | , $connection["db_database"]); |
61 | 61 | } |
62 | 62 | $error = mysqli_connect_errno(); |
63 | - if($error) |
|
63 | + if ($error) |
|
64 | 64 | { |
65 | 65 | $this->setError($error, mysqli_connect_error()); |
66 | 66 | return; |
@@ -89,13 +89,13 @@ discard block |
||
89 | 89 | { |
90 | 90 | $connection = $this->_getConnection('master'); |
91 | 91 | |
92 | - if(!$transactionLevel) |
|
92 | + if (!$transactionLevel) |
|
93 | 93 | { |
94 | 94 | $this->_query("begin"); |
95 | 95 | } |
96 | 96 | else |
97 | 97 | { |
98 | - $this->_query("SAVEPOINT SP" . $transactionLevel, $connection); |
|
98 | + $this->_query("SAVEPOINT SP".$transactionLevel, $connection); |
|
99 | 99 | } |
100 | 100 | return true; |
101 | 101 | } |
@@ -111,14 +111,14 @@ discard block |
||
111 | 111 | |
112 | 112 | $point = $transactionLevel - 1; |
113 | 113 | |
114 | - if($point) |
|
114 | + if ($point) |
|
115 | 115 | { |
116 | - $this->_query("ROLLBACK TO SP" . $point, $connection); |
|
116 | + $this->_query("ROLLBACK TO SP".$point, $connection); |
|
117 | 117 | } |
118 | 118 | else |
119 | 119 | { |
120 | 120 | mysqli_rollback($connection); |
121 | - $this->setQueryLog( array("query"=>"rollback") ); |
|
121 | + $this->setQueryLog(array("query"=>"rollback")); |
|
122 | 122 | } |
123 | 123 | return true; |
124 | 124 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | { |
133 | 133 | $connection = $this->_getConnection('master'); |
134 | 134 | mysqli_commit($connection); |
135 | - $this->setQueryLog( array("query"=>"commit") ); |
|
135 | + $this->setQueryLog(array("query"=>"commit")); |
|
136 | 136 | return true; |
137 | 137 | } |
138 | 138 | |
@@ -145,11 +145,11 @@ discard block |
||
145 | 145 | */ |
146 | 146 | function addQuotes($string) |
147 | 147 | { |
148 | - if(version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc()) |
|
148 | + if (version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc()) |
|
149 | 149 | { |
150 | 150 | $string = stripslashes(str_replace("\\", "\\\\", $string)); |
151 | 151 | } |
152 | - if(!is_numeric($string)) |
|
152 | + if (!is_numeric($string)) |
|
153 | 153 | { |
154 | 154 | $connection = $this->_getConnection('master'); |
155 | 155 | $string = mysqli_escape_string($connection, $string); |
@@ -166,23 +166,23 @@ discard block |
||
166 | 166 | */ |
167 | 167 | function __query($query, $connection) |
168 | 168 | { |
169 | - if($this->use_prepared_statements == 'Y') |
|
169 | + if ($this->use_prepared_statements == 'Y') |
|
170 | 170 | { |
171 | 171 | // 1. Prepare query |
172 | 172 | $stmt = mysqli_prepare($connection, $query); |
173 | - if($stmt) |
|
173 | + if ($stmt) |
|
174 | 174 | { |
175 | 175 | $types = ''; |
176 | 176 | $params = array(); |
177 | 177 | $this->_prepareQueryParameters($types, $params); |
178 | 178 | |
179 | - if(!empty($params)) |
|
179 | + if (!empty($params)) |
|
180 | 180 | { |
181 | 181 | $args[0] = $stmt; |
182 | 182 | $args[1] = $types; |
183 | 183 | |
184 | 184 | $i = 2; |
185 | - foreach($params as $key => $param) |
|
185 | + foreach ($params as $key => $param) |
|
186 | 186 | { |
187 | 187 | $copy[$key] = $param; |
188 | 188 | $args[$i++] = &$copy[$key]; |
@@ -190,18 +190,18 @@ discard block |
||
190 | 190 | |
191 | 191 | // 2. Bind parameters |
192 | 192 | $status = call_user_func_array('mysqli_stmt_bind_param', $args); |
193 | - if(!$status) |
|
193 | + if (!$status) |
|
194 | 194 | { |
195 | - $this->setError(-1, "Invalid arguments: $query" . mysqli_error($connection)); |
|
195 | + $this->setError(-1, "Invalid arguments: $query".mysqli_error($connection)); |
|
196 | 196 | } |
197 | 197 | } |
198 | 198 | |
199 | 199 | // 3. Execute query |
200 | 200 | $status = mysqli_stmt_execute($stmt); |
201 | 201 | |
202 | - if(!$status) |
|
202 | + if (!$status) |
|
203 | 203 | { |
204 | - $this->setError(-1, "Prepared statement failed: $query" . mysqli_error($connection)); |
|
204 | + $this->setError(-1, "Prepared statement failed: $query".mysqli_error($connection)); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | // Return stmt for other processing - like retrieving resultset (_fetch) |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | $result = mysqli_query($connection, $query); |
214 | 214 | // Error Check |
215 | 215 | $error = mysqli_error($connection); |
216 | - if($error) |
|
216 | + if ($error) |
|
217 | 217 | { |
218 | 218 | $this->setError(mysqli_errno($connection), $error); |
219 | 219 | } |
@@ -232,23 +232,23 @@ discard block |
||
232 | 232 | { |
233 | 233 | $types = ''; |
234 | 234 | $params = array(); |
235 | - if(!$this->param) |
|
235 | + if (!$this->param) |
|
236 | 236 | { |
237 | 237 | return; |
238 | 238 | } |
239 | 239 | |
240 | - foreach($this->param as $k => $o) |
|
240 | + foreach ($this->param as $k => $o) |
|
241 | 241 | { |
242 | 242 | $value = $o->getUnescapedValue(); |
243 | 243 | $type = $o->getType(); |
244 | 244 | |
245 | 245 | // Skip column names -> this should be concatenated to query string |
246 | - if($o->isColumnName()) |
|
246 | + if ($o->isColumnName()) |
|
247 | 247 | { |
248 | 248 | continue; |
249 | 249 | } |
250 | 250 | |
251 | - switch($type) |
|
251 | + switch ($type) |
|
252 | 252 | { |
253 | 253 | case 'number' : |
254 | 254 | $type = 'i'; |
@@ -260,9 +260,9 @@ discard block |
||
260 | 260 | $type = 's'; |
261 | 261 | } |
262 | 262 | |
263 | - if(is_array($value)) |
|
263 | + if (is_array($value)) |
|
264 | 264 | { |
265 | - foreach($value as $v) |
|
265 | + foreach ($value as $v) |
|
266 | 266 | { |
267 | 267 | $params[] = $v; |
268 | 268 | $types .= $type; |
@@ -284,12 +284,12 @@ discard block |
||
284 | 284 | */ |
285 | 285 | function _fetch($result, $arrayIndexEndValue = NULL) |
286 | 286 | { |
287 | - if($this->use_prepared_statements != 'Y') |
|
287 | + if ($this->use_prepared_statements != 'Y') |
|
288 | 288 | { |
289 | 289 | return parent::_fetch($result, $arrayIndexEndValue); |
290 | 290 | } |
291 | 291 | $output = array(); |
292 | - if(!$this->isConnected() || $this->isError() || !$result) |
|
292 | + if (!$this->isConnected() || $this->isError() || !$result) |
|
293 | 293 | { |
294 | 294 | return $output; |
295 | 295 | } |
@@ -305,25 +305,25 @@ discard block |
||
305 | 305 | * MYSQLI_TYPE for longtext is 252 |
306 | 306 | */ |
307 | 307 | $longtext_exists = false; |
308 | - foreach($fields as $field) |
|
308 | + foreach ($fields as $field) |
|
309 | 309 | { |
310 | - if(isset($resultArray[$field->name])) // When joined tables are used and the same column name appears twice, we should add it separately, otherwise bind_result fails |
|
310 | + if (isset($resultArray[$field->name])) // When joined tables are used and the same column name appears twice, we should add it separately, otherwise bind_result fails |
|
311 | 311 | { |
312 | - $field->name = 'repeat_' . $field->name; |
|
312 | + $field->name = 'repeat_'.$field->name; |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | // Array passed needs to contain references, not values |
316 | 316 | $row[$field->name] = ""; |
317 | 317 | $resultArray[$field->name] = &$row[$field->name]; |
318 | 318 | |
319 | - if($field->type == 252) |
|
319 | + if ($field->type == 252) |
|
320 | 320 | { |
321 | 321 | $longtext_exists = true; |
322 | 322 | } |
323 | 323 | } |
324 | 324 | $resultArray = array_merge(array($stmt), $resultArray); |
325 | 325 | |
326 | - if($longtext_exists) |
|
326 | + if ($longtext_exists) |
|
327 | 327 | { |
328 | 328 | mysqli_stmt_store_result($stmt); |
329 | 329 | } |
@@ -331,17 +331,17 @@ discard block |
||
331 | 331 | call_user_func_array('mysqli_stmt_bind_result', $resultArray); |
332 | 332 | |
333 | 333 | $rows = array(); |
334 | - while(mysqli_stmt_fetch($stmt)) |
|
334 | + while (mysqli_stmt_fetch($stmt)) |
|
335 | 335 | { |
336 | 336 | $resultObject = new stdClass(); |
337 | 337 | |
338 | - foreach($resultArray as $key => $value) |
|
338 | + foreach ($resultArray as $key => $value) |
|
339 | 339 | { |
340 | - if($key === 0) |
|
340 | + if ($key === 0) |
|
341 | 341 | { |
342 | 342 | continue; // Skip stmt object |
343 | 343 | } |
344 | - if(strpos($key, 'repeat_')) |
|
344 | + if (strpos($key, 'repeat_')) |
|
345 | 345 | { |
346 | 346 | $key = substr($key, 6); |
347 | 347 | } |
@@ -353,9 +353,9 @@ discard block |
||
353 | 353 | |
354 | 354 | mysqli_stmt_close($stmt); |
355 | 355 | |
356 | - if($arrayIndexEndValue) |
|
356 | + if ($arrayIndexEndValue) |
|
357 | 357 | { |
358 | - foreach($rows as $row) |
|
358 | + foreach ($rows as $row) |
|
359 | 359 | { |
360 | 360 | $output[$arrayIndexEndValue--] = $row; |
361 | 361 | } |
@@ -365,9 +365,9 @@ discard block |
||
365 | 365 | $output = $rows; |
366 | 366 | } |
367 | 367 | |
368 | - if(count($output) == 1) |
|
368 | + if (count($output) == 1) |
|
369 | 369 | { |
370 | - if(isset($arrayIndexEndValue)) |
|
370 | + if (isset($arrayIndexEndValue)) |
|
371 | 371 | { |
372 | 372 | return $output; |
373 | 373 | } |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | */ |
389 | 389 | function _executeInsertAct($queryObject, $with_values = false) |
390 | 390 | { |
391 | - if($this->use_prepared_statements != 'Y') |
|
391 | + if ($this->use_prepared_statements != 'Y') |
|
392 | 392 | { |
393 | 393 | return parent::_executeInsertAct($queryObject); |
394 | 394 | } |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | */ |
407 | 407 | function _executeUpdateAct($queryObject, $with_values = false) |
408 | 408 | { |
409 | - if($this->use_prepared_statements != 'Y') |
|
409 | + if ($this->use_prepared_statements != 'Y') |
|
410 | 410 | { |
411 | 411 | return parent::_executeUpdateAct($queryObject); |
412 | 412 | } |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | */ |
425 | 425 | function _executeDeleteAct($queryObject, $with_values = false) |
426 | 426 | { |
427 | - if($this->use_prepared_statements != 'Y') |
|
427 | + if ($this->use_prepared_statements != 'Y') |
|
428 | 428 | { |
429 | 429 | return parent::_executeDeleteAct($queryObject); |
430 | 430 | } |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | */ |
446 | 446 | function _executeSelectAct($queryObject, $connection = null, $with_values = false) |
447 | 447 | { |
448 | - if($this->use_prepared_statements != 'Y') |
|
448 | + if ($this->use_prepared_statements != 'Y') |
|
449 | 449 | { |
450 | 450 | return parent::_executeSelectAct($queryObject, $connection); |
451 | 451 | } |
@@ -503,13 +503,13 @@ discard block |
||
503 | 503 | $xml_obj = $oXml->parse($xml_doc); |
504 | 504 | // Create a table schema |
505 | 505 | $table_name = $xml_obj->table->attrs->name; |
506 | - if($this->isTableExists($table_name)) |
|
506 | + if ($this->isTableExists($table_name)) |
|
507 | 507 | { |
508 | 508 | return; |
509 | 509 | } |
510 | - $table_name = $this->prefix . $table_name; |
|
510 | + $table_name = $this->prefix.$table_name; |
|
511 | 511 | |
512 | - if(!is_array($xml_obj->table->column)) |
|
512 | + if (!is_array($xml_obj->table->column)) |
|
513 | 513 | { |
514 | 514 | $columns[] = $xml_obj->table->column; |
515 | 515 | } |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | $columns = $xml_obj->table->column; |
519 | 519 | } |
520 | 520 | |
521 | - foreach($columns as $column) |
|
521 | + foreach ($columns as $column) |
|
522 | 522 | { |
523 | 523 | $name = $column->attrs->name; |
524 | 524 | $type = $column->attrs->type; |
@@ -530,47 +530,47 @@ discard block |
||
530 | 530 | $default = $column->attrs->default; |
531 | 531 | $auto_increment = $column->attrs->auto_increment; |
532 | 532 | |
533 | - $column_schema[] = sprintf('`%s` %s%s %s %s %s', $name, $this->column_type[$type], $size ? '(' . $size . ')' : '', isset($default) ? "default '" . $default . "'" : '', $notnull ? 'not null' : '', $auto_increment ? 'auto_increment' : ''); |
|
533 | + $column_schema[] = sprintf('`%s` %s%s %s %s %s', $name, $this->column_type[$type], $size ? '('.$size.')' : '', isset($default) ? "default '".$default."'" : '', $notnull ? 'not null' : '', $auto_increment ? 'auto_increment' : ''); |
|
534 | 534 | |
535 | - if($primary_key) |
|
535 | + if ($primary_key) |
|
536 | 536 | { |
537 | 537 | $primary_list[] = $name; |
538 | 538 | } |
539 | - else if($unique) |
|
539 | + else if ($unique) |
|
540 | 540 | { |
541 | 541 | $unique_list[$unique][] = $name; |
542 | 542 | } |
543 | - else if($index) |
|
543 | + else if ($index) |
|
544 | 544 | { |
545 | 545 | $index_list[$index][] = $name; |
546 | 546 | } |
547 | 547 | } |
548 | 548 | |
549 | - if(count($primary_list)) |
|
549 | + if (count($primary_list)) |
|
550 | 550 | { |
551 | - $column_schema[] = sprintf("primary key (%s)", '`' . implode($primary_list, '`,`') . '`'); |
|
551 | + $column_schema[] = sprintf("primary key (%s)", '`'.implode($primary_list, '`,`').'`'); |
|
552 | 552 | } |
553 | 553 | |
554 | - if(count($unique_list)) |
|
554 | + if (count($unique_list)) |
|
555 | 555 | { |
556 | - foreach($unique_list as $key => $val) |
|
556 | + foreach ($unique_list as $key => $val) |
|
557 | 557 | { |
558 | - $column_schema[] = sprintf("unique %s (%s)", $key, '`' . implode($val, '`,`') . '`'); |
|
558 | + $column_schema[] = sprintf("unique %s (%s)", $key, '`'.implode($val, '`,`').'`'); |
|
559 | 559 | } |
560 | 560 | } |
561 | 561 | |
562 | - if(count($index_list)) |
|
562 | + if (count($index_list)) |
|
563 | 563 | { |
564 | - foreach($index_list as $key => $val) |
|
564 | + foreach ($index_list as $key => $val) |
|
565 | 565 | { |
566 | - $column_schema[] = sprintf("index %s (%s)", $key, '`' . implode($val, '`,`') . '`'); |
|
566 | + $column_schema[] = sprintf("index %s (%s)", $key, '`'.implode($val, '`,`').'`'); |
|
567 | 567 | } |
568 | 568 | } |
569 | 569 | |
570 | 570 | $schema = sprintf('create table `%s` (%s%s) %s;', $this->addQuotes($table_name), "\n", implode($column_schema, ",\n"), "ENGINE = INNODB CHARACTER SET utf8 COLLATE utf8_general_ci"); |
571 | 571 | |
572 | 572 | $output = $this->_query($schema); |
573 | - if(!$output) |
|
573 | + if (!$output) |
|
574 | 574 | { |
575 | 575 | return false; |
576 | 576 | } |
@@ -131,7 +131,7 @@ |
||
131 | 131 | * opt : notnull, default, size\n |
132 | 132 | * index : primary key, index, unique\n |
133 | 133 | * @param string $xml_doc xml schema contents |
134 | - * @return void|object |
|
134 | + * @return null|false |
|
135 | 135 | */ |
136 | 136 | function _createTable($xml_doc) |
137 | 137 | { |
@@ -394,7 +394,7 @@ |
||
394 | 394 | * Arrage css index |
395 | 395 | * |
396 | 396 | * @param string $dirName First directory name of css path |
397 | - * @param array $file file info. |
|
397 | + * @param stdClass $file file info. |
|
398 | 398 | * @return void |
399 | 399 | */ |
400 | 400 | function _arrangeCssIndex($dirName, &$file) |
@@ -50,7 +50,7 @@ |
||
50 | 50 | * Check SSL |
51 | 51 | * |
52 | 52 | * @return bool If using ssl returns true, otherwise returns false. |
53 | - * @deprecated |
|
53 | + * @deprecated |
|
54 | 54 | */ |
55 | 55 | function isSsl() |
56 | 56 | { |
@@ -108,15 +108,13 @@ discard block |
||
108 | 108 | $mapIndex = &$this->cssMapIndex; |
109 | 109 | |
110 | 110 | $this->_arrangeCssIndex($pathInfo['dirname'], $file); |
111 | - } |
|
112 | - else if($file->fileExtension == 'js') |
|
111 | + } else if($file->fileExtension == 'js') |
|
113 | 112 | { |
114 | 113 | if($args[1] == 'body') |
115 | 114 | { |
116 | 115 | $map = &$this->jsBodyMap; |
117 | 116 | $mapIndex = &$this->jsBodyMapIndex; |
118 | - } |
|
119 | - else |
|
117 | + } else |
|
120 | 118 | { |
121 | 119 | $map = &$this->jsHeadMap; |
122 | 120 | $mapIndex = &$this->jsHeadMapIndex; |
@@ -174,8 +172,7 @@ discard block |
||
174 | 172 | { |
175 | 173 | $file->fileName = $minifiedFileName; |
176 | 174 | } |
177 | - } |
|
178 | - else |
|
175 | + } else |
|
179 | 176 | { |
180 | 177 | // Remove .min |
181 | 178 | if(file_exists(implode('/', array($file->fileRealPath, $file->keyName)))) |
@@ -195,8 +192,7 @@ discard block |
||
195 | 192 | $file->media = 'all'; |
196 | 193 | } |
197 | 194 | $file->key = $file->filePath . $file->keyName . "\t" . $file->targetIe . "\t" . $file->media; |
198 | - } |
|
199 | - else if($file->fileExtension == 'js') |
|
195 | + } else if($file->fileExtension == 'js') |
|
200 | 196 | { |
201 | 197 | $file->key = $file->filePath . $file->keyName . "\t" . $file->targetIe; |
202 | 198 | } |
@@ -223,8 +219,7 @@ discard block |
||
223 | 219 | $index = $this->cssMapIndex[$file->key]; |
224 | 220 | unset($this->cssMap[$index][$file->key], $this->cssMapIndex[$file->key]); |
225 | 221 | } |
226 | - } |
|
227 | - else |
|
222 | + } else |
|
228 | 223 | { |
229 | 224 | if(isset($this->jsHeadMapIndex[$file->key])) |
230 | 225 | { |
@@ -286,7 +281,9 @@ discard block |
||
286 | 281 | } |
287 | 282 | if($file->query) |
288 | 283 | { |
289 | - if($query) $query .= '&'; |
|
284 | + if($query) { |
|
285 | + $query .= '&'; |
|
286 | + } |
|
290 | 287 | $query .= $file->query; |
291 | 288 | } |
292 | 289 | $query = ($query) ? '?' . $query : ''; |
@@ -315,8 +312,7 @@ discard block |
||
315 | 312 | { |
316 | 313 | $map = &$this->jsHeadMap; |
317 | 314 | $mapIndex = &$this->jsHeadMapIndex; |
318 | - } |
|
319 | - else |
|
315 | + } else |
|
320 | 316 | { |
321 | 317 | $map = &$this->jsBodyMap; |
322 | 318 | $mapIndex = &$this->jsBodyMapIndex; |
@@ -336,7 +332,9 @@ discard block |
||
336 | 332 | } |
337 | 333 | if($file->query) |
338 | 334 | { |
339 | - if($query) $query .= '&'; |
|
335 | + if($query) { |
|
336 | + $query .= '&'; |
|
337 | + } |
|
340 | 338 | $query .= $file->query; |
341 | 339 | } |
342 | 340 | $query = ($query) ? '?' . $query : ''; |
@@ -375,8 +373,7 @@ discard block |
||
375 | 373 | if(strpos($path, '://') === FALSE && $path{0} != '/' && $path{0} != '.') |
376 | 374 | { |
377 | 375 | $path = './' . $path; |
378 | - } |
|
379 | - elseif(!strncmp($path, '//', 2)) |
|
376 | + } elseif(!strncmp($path, '//', 2)) |
|
380 | 377 | { |
381 | 378 | return preg_replace('#^//+#', '//', $path); |
382 | 379 | } |
@@ -407,13 +404,11 @@ discard block |
||
407 | 404 | if($script_path == '/' || $script_path == '\\') |
408 | 405 | { |
409 | 406 | $path = '/' . substr($path, 2); |
410 | - } |
|
411 | - else |
|
407 | + } else |
|
412 | 408 | { |
413 | 409 | $path = $script_path . substr($path, 2); |
414 | 410 | } |
415 | - } |
|
416 | - else if(strpos($file, '../') === 0) |
|
411 | + } else if(strpos($file, '../') === 0) |
|
417 | 412 | { |
418 | 413 | $path = $this->_normalizeFilePath($script_path . $path); |
419 | 414 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | function isSsl() |
56 | 56 | { |
57 | - if(!is_null(self::$isSSL)) |
|
57 | + if (!is_null(self::$isSSL)) |
|
58 | 58 | { |
59 | 59 | return self::$isSSL; |
60 | 60 | } |
@@ -88,30 +88,30 @@ discard block |
||
88 | 88 | * */ |
89 | 89 | function loadFile($args) |
90 | 90 | { |
91 | - if(!is_array($args)) |
|
91 | + if (!is_array($args)) |
|
92 | 92 | { |
93 | 93 | $args = array($args); |
94 | 94 | } |
95 | 95 | $file = $this->getFileInfo($args[0], $args[2], $args[1]); |
96 | 96 | |
97 | 97 | $availableExtension = array('css' => 1, 'js' => 1); |
98 | - if(!isset($availableExtension[$file->fileExtension])) |
|
98 | + if (!isset($availableExtension[$file->fileExtension])) |
|
99 | 99 | { |
100 | 100 | return; |
101 | 101 | } |
102 | 102 | |
103 | 103 | $file->index = (int) $args[3]; |
104 | 104 | |
105 | - if($file->fileExtension == 'css') |
|
105 | + if ($file->fileExtension == 'css') |
|
106 | 106 | { |
107 | 107 | $map = &$this->cssMap; |
108 | 108 | $mapIndex = &$this->cssMapIndex; |
109 | 109 | |
110 | 110 | $this->_arrangeCssIndex($pathInfo['dirname'], $file); |
111 | 111 | } |
112 | - else if($file->fileExtension == 'js') |
|
112 | + else if ($file->fileExtension == 'js') |
|
113 | 113 | { |
114 | - if($args[1] == 'body') |
|
114 | + if ($args[1] == 'body') |
|
115 | 115 | { |
116 | 116 | $map = &$this->jsBodyMap; |
117 | 117 | $mapIndex = &$this->jsBodyMapIndex; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | } |
125 | 125 | |
126 | 126 | (is_null($file->index)) ? $file->index = 0 : $file->index = $file->index; |
127 | - if(!isset($mapIndex[$file->key]) || $mapIndex[$file->key] > $file->index) |
|
127 | + if (!isset($mapIndex[$file->key]) || $mapIndex[$file->key] > $file->index) |
|
128 | 128 | { |
129 | 129 | $this->unloadFile($args[0], $args[2], $args[1]); |
130 | 130 | $map[$file->index][$file->key] = $file; |
@@ -144,14 +144,14 @@ discard block |
||
144 | 144 | { |
145 | 145 | static $existsInfo = array(); |
146 | 146 | |
147 | - if(isset($existsInfo[$existsKey])) |
|
147 | + if (isset($existsInfo[$existsKey])) |
|
148 | 148 | { |
149 | 149 | return $existsInfo[$existsKey]; |
150 | 150 | } |
151 | 151 | |
152 | 152 | $fileName = preg_replace('/(?:[\/]{3,})(.*)/', '//$1', $fileName); |
153 | 153 | $url_info = parse_url($fileName); |
154 | - $pathInfo = pathinfo(str_replace('?' . $url_info['query'], '', $fileName)); |
|
154 | + $pathInfo = pathinfo(str_replace('?'.$url_info['query'], '', $fileName)); |
|
155 | 155 | |
156 | 156 | $file = new stdClass(); |
157 | 157 | $file->fileName = basename($url_info['path']); |
@@ -164,14 +164,14 @@ discard block |
||
164 | 164 | $file->keyName = implode('.', array($file->fileNameNoExt, $file->fileExtension)); |
165 | 165 | $file->cdnPath = $this->_normalizeFilePath($pathInfo['dirname']); |
166 | 166 | |
167 | - if(!$file->external) |
|
167 | + if (!$file->external) |
|
168 | 168 | { |
169 | - if(!__DEBUG__ && __XE_VERSION_STABLE__) |
|
169 | + if (!__DEBUG__ && __XE_VERSION_STABLE__) |
|
170 | 170 | { |
171 | 171 | // if no debug mode, load minifed file |
172 | 172 | $minifiedFileName = implode('.', array($file->fileNameNoExt, 'min', $file->fileExtension)); |
173 | 173 | $minifiedRealPath = implode('/', array($file->fileRealPath, $minifiedFileName)); |
174 | - if(file_exists($minifiedRealPath)) |
|
174 | + if (file_exists($minifiedRealPath)) |
|
175 | 175 | { |
176 | 176 | $file->fileName = $minifiedFileName; |
177 | 177 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | else |
180 | 180 | { |
181 | 181 | // Remove .min |
182 | - if(file_exists(implode('/', array($file->fileRealPath, $file->keyName)))) |
|
182 | + if (file_exists(implode('/', array($file->fileRealPath, $file->keyName)))) |
|
183 | 183 | { |
184 | 184 | $file->fileName = $file->keyName; |
185 | 185 | } |
@@ -188,18 +188,18 @@ discard block |
||
188 | 188 | |
189 | 189 | $file->targetIe = $targetIe; |
190 | 190 | |
191 | - if($file->fileExtension == 'css') |
|
191 | + if ($file->fileExtension == 'css') |
|
192 | 192 | { |
193 | 193 | $file->media = $media; |
194 | - if(!$file->media) |
|
194 | + if (!$file->media) |
|
195 | 195 | { |
196 | 196 | $file->media = 'all'; |
197 | 197 | } |
198 | - $file->key = $file->filePath . $file->keyName . "\t" . $file->targetIe . "\t" . $file->media; |
|
198 | + $file->key = $file->filePath.$file->keyName."\t".$file->targetIe."\t".$file->media; |
|
199 | 199 | } |
200 | - else if($file->fileExtension == 'js') |
|
200 | + else if ($file->fileExtension == 'js') |
|
201 | 201 | { |
202 | - $file->key = $file->filePath . $file->keyName . "\t" . $file->targetIe; |
|
202 | + $file->key = $file->filePath.$file->keyName."\t".$file->targetIe; |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | return $file; |
@@ -217,9 +217,9 @@ discard block |
||
217 | 217 | { |
218 | 218 | $file = $this->getFileInfo($fileName, $targetIe, $media); |
219 | 219 | |
220 | - if($file->fileExtension == 'css') |
|
220 | + if ($file->fileExtension == 'css') |
|
221 | 221 | { |
222 | - if(isset($this->cssMapIndex[$file->key])) |
|
222 | + if (isset($this->cssMapIndex[$file->key])) |
|
223 | 223 | { |
224 | 224 | $index = $this->cssMapIndex[$file->key]; |
225 | 225 | unset($this->cssMap[$index][$file->key], $this->cssMapIndex[$file->key]); |
@@ -227,12 +227,12 @@ discard block |
||
227 | 227 | } |
228 | 228 | else |
229 | 229 | { |
230 | - if(isset($this->jsHeadMapIndex[$file->key])) |
|
230 | + if (isset($this->jsHeadMapIndex[$file->key])) |
|
231 | 231 | { |
232 | 232 | $index = $this->jsHeadMapIndex[$file->key]; |
233 | 233 | unset($this->jsHeadMap[$index][$file->key], $this->jsHeadMapIndex[$file->key]); |
234 | 234 | } |
235 | - if(isset($this->jsBodyMapIndex[$file->key])) |
|
235 | + if (isset($this->jsBodyMapIndex[$file->key])) |
|
236 | 236 | { |
237 | 237 | $index = $this->jsBodyMapIndex[$file->key]; |
238 | 238 | unset($this->jsBodyMap[$index][$file->key], $this->jsBodyMapIndex[$file->key]); |
@@ -248,13 +248,13 @@ discard block |
||
248 | 248 | */ |
249 | 249 | function unloadAllFiles($type = 'all') |
250 | 250 | { |
251 | - if($type == 'css' || $type == 'all') |
|
251 | + if ($type == 'css' || $type == 'all') |
|
252 | 252 | { |
253 | 253 | $this->cssMap = array(); |
254 | 254 | $this->cssMapIndex = array(); |
255 | 255 | } |
256 | 256 | |
257 | - if($type == 'js' || $type == 'all') |
|
257 | + if ($type == 'js' || $type == 'all') |
|
258 | 258 | { |
259 | 259 | $this->jsHeadMap = array(); |
260 | 260 | $this->jsBodyMap = array(); |
@@ -276,23 +276,23 @@ discard block |
||
276 | 276 | $this->_sortMap($map, $mapIndex); |
277 | 277 | |
278 | 278 | $result = array(); |
279 | - foreach($map as $indexedMap) |
|
279 | + foreach ($map as $indexedMap) |
|
280 | 280 | { |
281 | - foreach($indexedMap as $file) |
|
281 | + foreach ($indexedMap as $file) |
|
282 | 282 | { |
283 | 283 | $query = ''; |
284 | - if(!$file->external && is_readable($file->cdnPath . '/' . $file->fileName)) |
|
284 | + if (!$file->external && is_readable($file->cdnPath.'/'.$file->fileName)) |
|
285 | 285 | { |
286 | - $query = date('YmdHis', filemtime($file->cdnPath . '/' . $file->fileName)); |
|
286 | + $query = date('YmdHis', filemtime($file->cdnPath.'/'.$file->fileName)); |
|
287 | 287 | } |
288 | - if($file->query) |
|
288 | + if ($file->query) |
|
289 | 289 | { |
290 | - if($query) $query .= '&'; |
|
290 | + if ($query) $query .= '&'; |
|
291 | 291 | $query .= $file->query; |
292 | 292 | } |
293 | - $query = ($query) ? '?' . $query : ''; |
|
293 | + $query = ($query) ? '?'.$query : ''; |
|
294 | 294 | |
295 | - $fullFilePath = $file->filePath . '/' . $file->fileName . $query; |
|
295 | + $fullFilePath = $file->filePath.'/'.$file->fileName.$query; |
|
296 | 296 | $result[] = array( |
297 | 297 | 'file' => $fullFilePath, |
298 | 298 | 'media' => $file->media, |
@@ -313,9 +313,9 @@ discard block |
||
313 | 313 | function getJsFileList($type = 'head') |
314 | 314 | { |
315 | 315 | $ignore = array('modernizr.js', 'common.js', 'js_app.js', 'xml2json.js', 'xml_handler.js', 'xml_js_filter.js'); |
316 | - $pathCommonJs = getScriptPath() . 'common/js'; |
|
316 | + $pathCommonJs = getScriptPath().'common/js'; |
|
317 | 317 | |
318 | - if($type == 'head') |
|
318 | + if ($type == 'head') |
|
319 | 319 | { |
320 | 320 | $map = &$this->jsHeadMap; |
321 | 321 | $mapIndex = &$this->jsHeadMapIndex; |
@@ -329,31 +329,31 @@ discard block |
||
329 | 329 | $this->_sortMap($map, $mapIndex); |
330 | 330 | |
331 | 331 | $result = array(); |
332 | - foreach($map as $indexedMap) |
|
332 | + foreach ($map as $indexedMap) |
|
333 | 333 | { |
334 | - foreach($indexedMap as $file) |
|
334 | + foreach ($indexedMap as $file) |
|
335 | 335 | { |
336 | - if((!__DEBUG__ && __XE_VERSION_STABLE__) && $file->filePath === $pathCommonJs) |
|
336 | + if ((!__DEBUG__ && __XE_VERSION_STABLE__) && $file->filePath === $pathCommonJs) |
|
337 | 337 | { |
338 | - if(in_array($file->fileName, $ignore)) |
|
338 | + if (in_array($file->fileName, $ignore)) |
|
339 | 339 | { |
340 | 340 | continue; |
341 | 341 | } |
342 | 342 | } |
343 | 343 | |
344 | 344 | $query = ''; |
345 | - if(!$file->external && is_readable($file->cdnPath . '/' . $file->fileName)) |
|
345 | + if (!$file->external && is_readable($file->cdnPath.'/'.$file->fileName)) |
|
346 | 346 | { |
347 | - $query = date('YmdHis', filemtime($file->cdnPath . '/' . $file->fileName)); |
|
347 | + $query = date('YmdHis', filemtime($file->cdnPath.'/'.$file->fileName)); |
|
348 | 348 | } |
349 | - if($file->query) |
|
349 | + if ($file->query) |
|
350 | 350 | { |
351 | - if($query) $query .= '&'; |
|
351 | + if ($query) $query .= '&'; |
|
352 | 352 | $query .= $file->query; |
353 | 353 | } |
354 | - $query = ($query) ? '?' . $query : ''; |
|
354 | + $query = ($query) ? '?'.$query : ''; |
|
355 | 355 | |
356 | - $fullFilePath = $file->filePath . '/' . $file->fileName . $query; |
|
356 | + $fullFilePath = $file->filePath.'/'.$file->fileName.$query; |
|
357 | 357 | $result[] = array( |
358 | 358 | 'file' => $fullFilePath, |
359 | 359 | 'targetie' => $file->targetIe |
@@ -384,18 +384,18 @@ discard block |
||
384 | 384 | */ |
385 | 385 | function _normalizeFilePath($path) |
386 | 386 | { |
387 | - if(strpos($path, '://') === FALSE && $path{0} != '/' && $path{0} != '.') |
|
387 | + if (strpos($path, '://') === FALSE && $path{0} != '/' && $path{0} != '.') |
|
388 | 388 | { |
389 | - $path = './' . $path; |
|
389 | + $path = './'.$path; |
|
390 | 390 | } |
391 | - elseif(!strncmp($path, '//', 2)) |
|
391 | + elseif (!strncmp($path, '//', 2)) |
|
392 | 392 | { |
393 | 393 | return preg_replace('#^//+#', '//', $path); |
394 | 394 | } |
395 | 395 | |
396 | 396 | $path = preg_replace('@/\./|(?<!:)\/\/@', '/', $path); |
397 | 397 | |
398 | - while(strpos($path, '/../')) |
|
398 | + while (strpos($path, '/../')) |
|
399 | 399 | { |
400 | 400 | $path = preg_replace('/\/([^\/]+)\/\.\.\//s', '/', $path, 1); |
401 | 401 | } |
@@ -414,20 +414,20 @@ discard block |
||
414 | 414 | $path = $this->_normalizeFilePath($path); |
415 | 415 | $script_path = getScriptPath(); |
416 | 416 | |
417 | - if(strpos($path, './') === 0) |
|
417 | + if (strpos($path, './') === 0) |
|
418 | 418 | { |
419 | - if($script_path == '/' || $script_path == '\\') |
|
419 | + if ($script_path == '/' || $script_path == '\\') |
|
420 | 420 | { |
421 | - $path = '/' . substr($path, 2); |
|
421 | + $path = '/'.substr($path, 2); |
|
422 | 422 | } |
423 | 423 | else |
424 | 424 | { |
425 | - $path = $script_path . substr($path, 2); |
|
425 | + $path = $script_path.substr($path, 2); |
|
426 | 426 | } |
427 | 427 | } |
428 | - else if(strpos($file, '../') === 0) |
|
428 | + else if (strpos($file, '../') === 0) |
|
429 | 429 | { |
430 | - $path = $this->_normalizeFilePath($script_path . $path); |
|
430 | + $path = $this->_normalizeFilePath($script_path.$path); |
|
431 | 431 | } |
432 | 432 | |
433 | 433 | return $path; |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | */ |
443 | 443 | function _arrangeCssIndex($dirName, &$file) |
444 | 444 | { |
445 | - if($file->index !== 0) |
|
445 | + if ($file->index !== 0) |
|
446 | 446 | { |
447 | 447 | return; |
448 | 448 | } |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | function init() |
18 | 18 | { |
19 | 19 | // set the template path |
20 | - $this->setTemplatePath($this->module_path . 'tpl'); |
|
20 | + $this->setTemplatePath($this->module_path.'tpl'); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | /** |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | function dispCounterAdminIndex() |
29 | 29 | { |
30 | 30 | // set today's if no date is given |
31 | - $selected_date = (int)Context::get('selected_date'); |
|
31 | + $selected_date = (int) Context::get('selected_date'); |
|
32 | 32 | |
33 | - if(!$selected_date) |
|
33 | + if (!$selected_date) |
|
34 | 34 | { |
35 | 35 | $selected_date = date("Ymd"); |
36 | 36 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | // get data by time, day, month, and year |
51 | 51 | $type = Context::get('type'); |
52 | 52 | |
53 | - if(!$type) |
|
53 | + if (!$type) |
|
54 | 54 | { |
55 | 55 | $type = 'day'; |
56 | 56 | Context::set('type', $type); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | // get a list by using comment->getCommentList. |
53 | 53 | $oCommentModel = getModel('comment'); |
54 | 54 | $secretNameList = $oCommentModel->getSecretNameList(); |
55 | - $columnList = array('comment_srl', 'document_srl','module_srl','is_secret', 'status', 'content', 'comments.member_srl', 'comments.nick_name', 'comments.regdate', 'ipaddress', 'voted_count', 'blamed_count'); |
|
55 | + $columnList = array('comment_srl', 'document_srl', 'module_srl', 'is_secret', 'status', 'content', 'comments.member_srl', 'comments.nick_name', 'comments.regdate', 'ipaddress', 'voted_count', 'blamed_count'); |
|
56 | 56 | $output = $oCommentModel->getTotalCommentList($args, $columnList); |
57 | 57 | |
58 | 58 | // $modules = $oCommentModel->getDistinctModules(); |
@@ -70,20 +70,20 @@ discard block |
||
70 | 70 | $oModuleModel = getModel('module'); |
71 | 71 | $module_list = array(); |
72 | 72 | $mod_srls = array(); |
73 | - foreach($output->data as $val) |
|
73 | + foreach ($output->data as $val) |
|
74 | 74 | { |
75 | 75 | $mod_srls[] = $val->module_srl; |
76 | 76 | } |
77 | 77 | $mod_srls = array_unique($mod_srls); |
78 | 78 | // Module List |
79 | 79 | $mod_srls_count = count($mod_srls); |
80 | - if($mod_srls_count) |
|
80 | + if ($mod_srls_count) |
|
81 | 81 | { |
82 | 82 | $columnList = array('module_srl', 'mid', 'browser_title'); |
83 | 83 | $module_output = $oModuleModel->getModulesInfo($mod_srls, $columnList); |
84 | - if($module_output && is_array($module_output)) |
|
84 | + if ($module_output && is_array($module_output)) |
|
85 | 85 | { |
86 | - foreach($module_output as $module) |
|
86 | + foreach ($module_output as $module) |
|
87 | 87 | { |
88 | 88 | $module_list[$module->module_srl] = $module; |
89 | 89 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $security->encodeHTML('search_target', 'search_keyword'); |
96 | 96 | |
97 | 97 | // set the template |
98 | - $this->setTemplatePath($this->module_path . 'tpl'); |
|
98 | + $this->setTemplatePath($this->module_path.'tpl'); |
|
99 | 99 | $this->setTemplateFile('comment_list'); |
100 | 100 | } |
101 | 101 | |
@@ -117,11 +117,11 @@ discard block |
||
117 | 117 | $declared_output = executeQuery('comment.getDeclaredList', $args); |
118 | 118 | $oCommentModel = getModel('comment'); |
119 | 119 | |
120 | - if($declared_output->data && count($declared_output->data)) |
|
120 | + if ($declared_output->data && count($declared_output->data)) |
|
121 | 121 | { |
122 | 122 | $comment_list = array(); |
123 | 123 | |
124 | - foreach($declared_output->data as $key => $comment) |
|
124 | + foreach ($declared_output->data as $key => $comment) |
|
125 | 125 | { |
126 | 126 | $comment_list[$key] = new commentItem(); |
127 | 127 | $comment_list[$key]->setAttribute($comment); |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | Context::set('page_navigation', $declared_output->page_navigation); |
140 | 140 | Context::set('secret_name_list', $secretNameList); |
141 | 141 | // set the template |
142 | - $this->setTemplatePath($this->module_path . 'tpl'); |
|
142 | + $this->setTemplatePath($this->module_path.'tpl'); |
|
143 | 143 | $this->setTemplateFile('declared_list'); |
144 | 144 | } |
145 | 145 |
@@ -18,28 +18,28 @@ |
||
18 | 18 | } |
19 | 19 | |
20 | 20 | public function getResponseCode() { |
21 | - if($this->response) |
|
21 | + if ($this->response) |
|
22 | 22 | { |
23 | 23 | return $this->response->getStatus(); |
24 | 24 | } |
25 | 25 | } |
26 | 26 | |
27 | 27 | public function getResponseHeader() { |
28 | - if($this->response) |
|
28 | + if ($this->response) |
|
29 | 29 | { |
30 | 30 | return $this->response->getHeader(); |
31 | 31 | } |
32 | 32 | } |
33 | 33 | |
34 | 34 | public function getResponseBody() { |
35 | - if($this->response) |
|
35 | + if ($this->response) |
|
36 | 36 | { |
37 | 37 | return $this->response->getBody(); |
38 | 38 | } |
39 | 39 | } |
40 | 40 | |
41 | 41 | public function getResponseCookies() { |
42 | - if($this->response) |
|
42 | + if ($this->response) |
|
43 | 43 | { |
44 | 44 | return $this->response->getCookies(); |
45 | 45 | } |
@@ -21,14 +21,14 @@ discard block |
||
21 | 21 | |
22 | 22 | function read($session_key) |
23 | 23 | { |
24 | - if(!$session_key || !$this->session_started) return; |
|
24 | + if (!$session_key || !$this->session_started) return; |
|
25 | 25 | |
26 | 26 | $args = new stdClass(); |
27 | 27 | $args->session_key = $session_key; |
28 | 28 | $columnList = array('session_key', 'cur_mid', 'val'); |
29 | 29 | $output = executeQuery('session.getSession', $args, $columnList); |
30 | 30 | |
31 | - if(!$output->data) |
|
31 | + if (!$output->data) |
|
32 | 32 | { |
33 | 33 | return ''; |
34 | 34 | } |
@@ -46,47 +46,47 @@ discard block |
||
46 | 46 | */ |
47 | 47 | function getLoggedMembers($args) |
48 | 48 | { |
49 | - if(!$args->site_srl) |
|
49 | + if (!$args->site_srl) |
|
50 | 50 | { |
51 | 51 | $site_module_info = Context::get('site_module_info'); |
52 | - $args->site_srl = (int)$site_module_info->site_srl; |
|
52 | + $args->site_srl = (int) $site_module_info->site_srl; |
|
53 | 53 | } |
54 | - if(!$args->list_count) $args->list_count = 20; |
|
55 | - if(!$args->page) $args->page = 1; |
|
56 | - if(!$args->period_time) $args->period_time = 3; |
|
57 | - $args->last_update = date("YmdHis", $_SERVER['REQUEST_TIME'] - $args->period_time*60); |
|
54 | + if (!$args->list_count) $args->list_count = 20; |
|
55 | + if (!$args->page) $args->page = 1; |
|
56 | + if (!$args->period_time) $args->period_time = 3; |
|
57 | + $args->last_update = date("YmdHis", $_SERVER['REQUEST_TIME'] - $args->period_time * 60); |
|
58 | 58 | |
59 | 59 | $output = executeQueryArray('session.getLoggedMembers', $args); |
60 | - if(!$output->toBool()) return $output; |
|
60 | + if (!$output->toBool()) return $output; |
|
61 | 61 | |
62 | 62 | $member_srls = array(); |
63 | 63 | $member_keys = array(); |
64 | - if(count($output->data)) |
|
64 | + if (count($output->data)) |
|
65 | 65 | { |
66 | - foreach($output->data as $key => $val) |
|
66 | + foreach ($output->data as $key => $val) |
|
67 | 67 | { |
68 | 68 | $member_srls[$key] = $val->member_srl; |
69 | 69 | $member_keys[$val->member_srl] = $key; |
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
73 | - if(Context::get('is_logged')) |
|
73 | + if (Context::get('is_logged')) |
|
74 | 74 | { |
75 | 75 | $logged_info = Context::get('logged_info'); |
76 | - if(!in_array($logged_info->member_srl, $member_srls)) |
|
76 | + if (!in_array($logged_info->member_srl, $member_srls)) |
|
77 | 77 | { |
78 | 78 | $member_srls[0] = $logged_info->member_srl; |
79 | 79 | $member_keys[$logged_info->member_srl] = 0; |
80 | 80 | } |
81 | 81 | } |
82 | 82 | |
83 | - if(!count($member_srls)) return $output; |
|
83 | + if (!count($member_srls)) return $output; |
|
84 | 84 | |
85 | - $member_args->member_srl = implode(',',$member_srls); |
|
85 | + $member_args->member_srl = implode(',', $member_srls); |
|
86 | 86 | $member_output = executeQueryArray('member.getMembers', $member_args); |
87 | - if($member_output->data) |
|
87 | + if ($member_output->data) |
|
88 | 88 | { |
89 | - foreach($member_output->data as $key => $val) |
|
89 | + foreach ($member_output->data as $key => $val) |
|
90 | 90 | { |
91 | 91 | $output->data[$member_keys[$val->member_srl]] = $val; |
92 | 92 | } |
@@ -21,7 +21,9 @@ discard block |
||
21 | 21 | |
22 | 22 | function read($session_key) |
23 | 23 | { |
24 | - if(!$session_key || !$this->session_started) return; |
|
24 | + if(!$session_key || !$this->session_started) { |
|
25 | + return; |
|
26 | + } |
|
25 | 27 | |
26 | 28 | $args = new stdClass(); |
27 | 29 | $args->session_key = $session_key; |
@@ -51,13 +53,21 @@ discard block |
||
51 | 53 | $site_module_info = Context::get('site_module_info'); |
52 | 54 | $args->site_srl = (int)$site_module_info->site_srl; |
53 | 55 | } |
54 | - if(!$args->list_count) $args->list_count = 20; |
|
55 | - if(!$args->page) $args->page = 1; |
|
56 | - if(!$args->period_time) $args->period_time = 3; |
|
56 | + if(!$args->list_count) { |
|
57 | + $args->list_count = 20; |
|
58 | + } |
|
59 | + if(!$args->page) { |
|
60 | + $args->page = 1; |
|
61 | + } |
|
62 | + if(!$args->period_time) { |
|
63 | + $args->period_time = 3; |
|
64 | + } |
|
57 | 65 | $args->last_update = date("YmdHis", $_SERVER['REQUEST_TIME'] - $args->period_time*60); |
58 | 66 | |
59 | 67 | $output = executeQueryArray('session.getLoggedMembers', $args); |
60 | - if(!$output->toBool()) return $output; |
|
68 | + if(!$output->toBool()) { |
|
69 | + return $output; |
|
70 | + } |
|
61 | 71 | |
62 | 72 | $member_srls = array(); |
63 | 73 | $member_keys = array(); |
@@ -80,7 +90,9 @@ discard block |
||
80 | 90 | } |
81 | 91 | } |
82 | 92 | |
83 | - if(!count($member_srls)) return $output; |
|
93 | + if(!count($member_srls)) { |
|
94 | + return $output; |
|
95 | + } |
|
84 | 96 | |
85 | 97 | $member_args->member_srl = implode(',',$member_srls); |
86 | 98 | $member_output = executeQueryArray('member.getMembers', $member_args); |
@@ -24,28 +24,28 @@ discard block |
||
24 | 24 | $member_srl = abs($member_srl); |
25 | 25 | |
26 | 26 | // Get from instance memory |
27 | - if($this->pointList[$member_srl]) return true; |
|
27 | + if ($this->pointList[$member_srl]) return true; |
|
28 | 28 | |
29 | 29 | // Get from file cache |
30 | - $path = sprintf(_XE_PATH_ . 'files/member_extra_info/point/%s',getNumberingPath($member_srl)); |
|
30 | + $path = sprintf(_XE_PATH_.'files/member_extra_info/point/%s', getNumberingPath($member_srl)); |
|
31 | 31 | $cache_filename = sprintf('%s%d.cache.txt', $path, $member_srl); |
32 | - if(file_exists($cache_filename)) |
|
32 | + if (file_exists($cache_filename)) |
|
33 | 33 | { |
34 | - if(!$this->pointList[$member_srl]) |
|
34 | + if (!$this->pointList[$member_srl]) |
|
35 | 35 | $this->pointList[$member_srl] = trim(FileHandler::readFile($cache_filename)); |
36 | 36 | return true; |
37 | 37 | } |
38 | 38 | |
39 | - $args =new stdClass(); |
|
39 | + $args = new stdClass(); |
|
40 | 40 | $args->member_srl = $member_srl; |
41 | 41 | $output = executeQuery('point.getPoint', $args); |
42 | - if($output->data->member_srl == $member_srl) |
|
42 | + if ($output->data->member_srl == $member_srl) |
|
43 | 43 | { |
44 | - if(!$this->pointList[$member_srl]) |
|
44 | + if (!$this->pointList[$member_srl]) |
|
45 | 45 | { |
46 | - $this->pointList[$member_srl] = (int)$output->data->point; |
|
46 | + $this->pointList[$member_srl] = (int) $output->data->point; |
|
47 | 47 | FileHandler::makeDir($path); |
48 | - FileHandler::writeFile($cache_filename, (int)$output->data->point); |
|
48 | + FileHandler::writeFile($cache_filename, (int) $output->data->point); |
|
49 | 49 | } |
50 | 50 | return true; |
51 | 51 | } |
@@ -60,25 +60,25 @@ discard block |
||
60 | 60 | $member_srl = abs($member_srl); |
61 | 61 | |
62 | 62 | // Get from instance memory |
63 | - if(!$from_db && $this->pointList[$member_srl]) return $this->pointList[$member_srl]; |
|
63 | + if (!$from_db && $this->pointList[$member_srl]) return $this->pointList[$member_srl]; |
|
64 | 64 | |
65 | 65 | // Get from file cache |
66 | - $path = sprintf(_XE_PATH_ . 'files/member_extra_info/point/%s',getNumberingPath($member_srl)); |
|
66 | + $path = sprintf(_XE_PATH_.'files/member_extra_info/point/%s', getNumberingPath($member_srl)); |
|
67 | 67 | $cache_filename = sprintf('%s%d.cache.txt', $path, $member_srl); |
68 | 68 | |
69 | - if(!$from_db && file_exists($cache_filename)) |
|
69 | + if (!$from_db && file_exists($cache_filename)) |
|
70 | 70 | return $this->pointList[$member_srl] = trim(FileHandler::readFile($cache_filename)); |
71 | 71 | |
72 | 72 | // Get from the DB |
73 | - $args =new stdClass(); |
|
73 | + $args = new stdClass(); |
|
74 | 74 | $args->member_srl = $member_srl; |
75 | 75 | $output = executeQuery('point.getPoint', $args); |
76 | 76 | |
77 | - if(isset($output->data->member_srl)) |
|
77 | + if (isset($output->data->member_srl)) |
|
78 | 78 | { |
79 | - $point = (int)$output->data->point; |
|
79 | + $point = (int) $output->data->point; |
|
80 | 80 | $this->pointList[$member_srl] = $point; |
81 | - if(!is_dir($path)) FileHandler::makeDir($path); |
|
81 | + if (!is_dir($path)) FileHandler::makeDir($path); |
|
82 | 82 | FileHandler::writeFile($cache_filename, $point); |
83 | 83 | return $point; |
84 | 84 | } |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | function getLevel($point, $level_step) |
92 | 92 | { |
93 | 93 | $level_count = count($level_step); |
94 | - for($level=0;$level<=$level_count;$level++) if($point < $level_step[$level]) break; |
|
95 | - $level --; |
|
94 | + for ($level = 0; $level <= $level_count; $level++) if ($point < $level_step[$level]) break; |
|
95 | + $level--; |
|
96 | 96 | return $level; |
97 | 97 | } |
98 | 98 | |
@@ -103,20 +103,20 @@ discard block |
||
103 | 103 | { |
104 | 104 | $member_srls = Context::get('member_srls'); |
105 | 105 | $member_srls = array_unique(explode(',', $member_srls)); |
106 | - if(!count($member_srls)) |
|
106 | + if (!count($member_srls)) |
|
107 | 107 | { |
108 | 108 | return; |
109 | 109 | } |
110 | 110 | |
111 | 111 | $logged_info = Context::get('logged_info'); |
112 | - if(!$logged_info->member_srl) |
|
112 | + if (!$logged_info->member_srl) |
|
113 | 113 | { |
114 | 114 | return; |
115 | 115 | } |
116 | 116 | |
117 | - if(!getModel('module')->isSiteAdmin($logged_info)) |
|
117 | + if (!getModel('module')->isSiteAdmin($logged_info)) |
|
118 | 118 | { |
119 | - if(in_array($logged_info->member_srl, $member_srls)) |
|
119 | + if (in_array($logged_info->member_srl, $member_srls)) |
|
120 | 120 | { |
121 | 121 | $member_srls = array($logged_info->member_srl); |
122 | 122 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | $config = $oModuleModel->getModuleConfig('point'); |
131 | 131 | |
132 | 132 | $info = array(); |
133 | - foreach($member_srls as $v) |
|
133 | + foreach ($member_srls as $v) |
|
134 | 134 | { |
135 | 135 | $obj = new stdClass; |
136 | 136 | $obj->point = $this->getPoint($v); |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $info[] = $obj; |
140 | 140 | } |
141 | 141 | |
142 | - $this->add('point_info',$info); |
|
142 | + $this->add('point_info', $info); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | |
@@ -149,37 +149,37 @@ discard block |
||
149 | 149 | function getMemberList($args = null, $columnList = array()) |
150 | 150 | { |
151 | 151 | // Arrange the search options |
152 | - $args->is_admin = Context::get('is_admin')=='Y'?'Y':''; |
|
153 | - $args->is_denied = Context::get('is_denied')=='Y'?'Y':''; |
|
152 | + $args->is_admin = Context::get('is_admin') == 'Y' ? 'Y' : ''; |
|
153 | + $args->is_denied = Context::get('is_denied') == 'Y' ? 'Y' : ''; |
|
154 | 154 | $args->selected_group_srl = Context::get('selected_group_srl'); |
155 | 155 | |
156 | 156 | $search_target = trim(Context::get('search_target')); |
157 | 157 | $search_keyword = trim(Context::get('search_keyword')); |
158 | 158 | |
159 | 159 | // if search keyword is emtpy, show all list |
160 | - if(!$search_keyword) |
|
160 | + if (!$search_keyword) |
|
161 | 161 | { |
162 | 162 | unset($args->is_admin, $args->is_denied, $args->selected_group_srl, $search_target); |
163 | 163 | } |
164 | 164 | |
165 | - if($search_target && $search_keyword) |
|
165 | + if ($search_target && $search_keyword) |
|
166 | 166 | { |
167 | - switch($search_target) |
|
167 | + switch ($search_target) |
|
168 | 168 | { |
169 | 169 | case 'user_id' : |
170 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
170 | + if ($search_keyword) $search_keyword = str_replace(' ', '%', $search_keyword); |
|
171 | 171 | $args->s_user_id = $search_keyword; |
172 | 172 | break; |
173 | 173 | case 'user_name' : |
174 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
174 | + if ($search_keyword) $search_keyword = str_replace(' ', '%', $search_keyword); |
|
175 | 175 | $args->s_user_name = $search_keyword; |
176 | 176 | break; |
177 | 177 | case 'nick_name' : |
178 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
178 | + if ($search_keyword) $search_keyword = str_replace(' ', '%', $search_keyword); |
|
179 | 179 | $args->s_nick_name = $search_keyword; |
180 | 180 | break; |
181 | 181 | case 'email_address' : |
182 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
182 | + if ($search_keyword) $search_keyword = str_replace(' ', '%', $search_keyword); |
|
183 | 183 | $args->s_email_address = $search_keyword; |
184 | 184 | break; |
185 | 185 | case 'regdate' : |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | } |
195 | 195 | } |
196 | 196 | // If there is a selected_group_srl, change the "query id" (for table join) |
197 | - if($args->selected_group_srl) |
|
197 | + if ($args->selected_group_srl) |
|
198 | 198 | { |
199 | 199 | $query_id = 'point.getMemberListWithinGroup'; |
200 | 200 | } |
@@ -205,12 +205,12 @@ discard block |
||
205 | 205 | |
206 | 206 | $output = executeQuery($query_id, $args, $columnList); |
207 | 207 | |
208 | - if($output->total_count) |
|
208 | + if ($output->total_count) |
|
209 | 209 | { |
210 | 210 | $oModuleModel = getModel('module'); |
211 | 211 | $config = $oModuleModel->getModuleConfig('point'); |
212 | 212 | |
213 | - foreach($output->data as $key => $val) |
|
213 | + foreach ($output->data as $key => $val) |
|
214 | 214 | { |
215 | 215 | $output->data[$key]->level = $this->getLevel($val->point, $config->level_step); |
216 | 216 | } |
@@ -24,15 +24,18 @@ discard block |
||
24 | 24 | $member_srl = abs($member_srl); |
25 | 25 | |
26 | 26 | // Get from instance memory |
27 | - if($this->pointList[$member_srl]) return true; |
|
27 | + if($this->pointList[$member_srl]) { |
|
28 | + return true; |
|
29 | + } |
|
28 | 30 | |
29 | 31 | // Get from file cache |
30 | 32 | $path = sprintf(_XE_PATH_ . 'files/member_extra_info/point/%s',getNumberingPath($member_srl)); |
31 | 33 | $cache_filename = sprintf('%s%d.cache.txt', $path, $member_srl); |
32 | 34 | if(file_exists($cache_filename)) |
33 | 35 | { |
34 | - if(!$this->pointList[$member_srl]) |
|
35 | - $this->pointList[$member_srl] = trim(FileHandler::readFile($cache_filename)); |
|
36 | + if(!$this->pointList[$member_srl]) { |
|
37 | + $this->pointList[$member_srl] = trim(FileHandler::readFile($cache_filename)); |
|
38 | + } |
|
36 | 39 | return true; |
37 | 40 | } |
38 | 41 | |
@@ -60,14 +63,17 @@ discard block |
||
60 | 63 | $member_srl = abs($member_srl); |
61 | 64 | |
62 | 65 | // Get from instance memory |
63 | - if(!$from_db && $this->pointList[$member_srl]) return $this->pointList[$member_srl]; |
|
66 | + if(!$from_db && $this->pointList[$member_srl]) { |
|
67 | + return $this->pointList[$member_srl]; |
|
68 | + } |
|
64 | 69 | |
65 | 70 | // Get from file cache |
66 | 71 | $path = sprintf(_XE_PATH_ . 'files/member_extra_info/point/%s',getNumberingPath($member_srl)); |
67 | 72 | $cache_filename = sprintf('%s%d.cache.txt', $path, $member_srl); |
68 | 73 | |
69 | - if(!$from_db && file_exists($cache_filename)) |
|
70 | - return $this->pointList[$member_srl] = trim(FileHandler::readFile($cache_filename)); |
|
74 | + if(!$from_db && file_exists($cache_filename)) { |
|
75 | + return $this->pointList[$member_srl] = trim(FileHandler::readFile($cache_filename)); |
|
76 | + } |
|
71 | 77 | |
72 | 78 | // Get from the DB |
73 | 79 | $args =new stdClass(); |
@@ -78,7 +84,9 @@ discard block |
||
78 | 84 | { |
79 | 85 | $point = (int)$output->data->point; |
80 | 86 | $this->pointList[$member_srl] = $point; |
81 | - if(!is_dir($path)) FileHandler::makeDir($path); |
|
87 | + if(!is_dir($path)) { |
|
88 | + FileHandler::makeDir($path); |
|
89 | + } |
|
82 | 90 | FileHandler::writeFile($cache_filename, $point); |
83 | 91 | return $point; |
84 | 92 | } |
@@ -91,7 +99,9 @@ discard block |
||
91 | 99 | function getLevel($point, $level_step) |
92 | 100 | { |
93 | 101 | $level_count = count($level_step); |
94 | - for($level=0;$level<=$level_count;$level++) if($point < $level_step[$level]) break; |
|
102 | + for($level=0;$level<=$level_count;$level++) { |
|
103 | + if($point < $level_step[$level]) break; |
|
104 | + } |
|
95 | 105 | $level --; |
96 | 106 | return $level; |
97 | 107 | } |
@@ -119,8 +129,7 @@ discard block |
||
119 | 129 | if(in_array($logged_info->member_srl, $member_srls)) |
120 | 130 | { |
121 | 131 | $member_srls = array($logged_info->member_srl); |
122 | - } |
|
123 | - else |
|
132 | + } else |
|
124 | 133 | { |
125 | 134 | return; |
126 | 135 | } |
@@ -167,19 +176,27 @@ discard block |
||
167 | 176 | switch($search_target) |
168 | 177 | { |
169 | 178 | case 'user_id' : |
170 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
179 | + if($search_keyword) { |
|
180 | + $search_keyword = str_replace(' ','%',$search_keyword); |
|
181 | + } |
|
171 | 182 | $args->s_user_id = $search_keyword; |
172 | 183 | break; |
173 | 184 | case 'user_name' : |
174 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
185 | + if($search_keyword) { |
|
186 | + $search_keyword = str_replace(' ','%',$search_keyword); |
|
187 | + } |
|
175 | 188 | $args->s_user_name = $search_keyword; |
176 | 189 | break; |
177 | 190 | case 'nick_name' : |
178 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
191 | + if($search_keyword) { |
|
192 | + $search_keyword = str_replace(' ','%',$search_keyword); |
|
193 | + } |
|
179 | 194 | $args->s_nick_name = $search_keyword; |
180 | 195 | break; |
181 | 196 | case 'email_address' : |
182 | - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); |
|
197 | + if($search_keyword) { |
|
198 | + $search_keyword = str_replace(' ','%',$search_keyword); |
|
199 | + } |
|
183 | 200 | $args->s_email_address = $search_keyword; |
184 | 201 | break; |
185 | 202 | case 'regdate' : |
@@ -197,8 +214,7 @@ discard block |
||
197 | 214 | if($args->selected_group_srl) |
198 | 215 | { |
199 | 216 | $query_id = 'point.getMemberListWithinGroup'; |
200 | - } |
|
201 | - else |
|
217 | + } else |
|
202 | 218 | { |
203 | 219 | $query_id = 'point.getMemberList'; |
204 | 220 | } |
@@ -31,25 +31,25 @@ |
||
31 | 31 | */ |
32 | 32 | function _makeXmlDoc($obj) |
33 | 33 | { |
34 | - if(!count($obj)) |
|
34 | + if (!count($obj)) |
|
35 | 35 | { |
36 | 36 | return; |
37 | 37 | } |
38 | 38 | |
39 | 39 | $xmlDoc = ''; |
40 | 40 | |
41 | - foreach($obj as $key => $val) |
|
41 | + foreach ($obj as $key => $val) |
|
42 | 42 | { |
43 | - if(is_numeric($key)) |
|
43 | + if (is_numeric($key)) |
|
44 | 44 | { |
45 | 45 | $key = 'item'; |
46 | 46 | } |
47 | 47 | |
48 | - if(is_string($val)) |
|
48 | + if (is_string($val)) |
|
49 | 49 | { |
50 | 50 | $xmlDoc .= sprintf('<%s>%s</%s>%s', $key, htmlspecialchars($val, ENT_COMPAT, 'UTF-8', true), $key, "\n"); |
51 | 51 | } |
52 | - else if(!is_array($val) && !is_object($val)) |
|
52 | + else if (!is_array($val) && !is_object($val)) |
|
53 | 53 | { |
54 | 54 | $xmlDoc .= sprintf('<%s>%s</%s>%s', $key, $val, $key, "\n"); |
55 | 55 | } |
@@ -48,12 +48,10 @@ |
||
48 | 48 | if(is_string($val)) |
49 | 49 | { |
50 | 50 | $xmlDoc .= sprintf('<%s>%s</%s>%s', $key, htmlspecialchars($val, ENT_COMPAT, 'UTF-8', true), $key, "\n"); |
51 | - } |
|
52 | - else if(!is_array($val) && !is_object($val)) |
|
51 | + } else if(!is_array($val) && !is_object($val)) |
|
53 | 52 | { |
54 | 53 | $xmlDoc .= sprintf('<%s>%s</%s>%s', $key, $val, $key, "\n"); |
55 | - } |
|
56 | - else |
|
54 | + } else |
|
57 | 55 | { |
58 | 56 | $xmlDoc .= sprintf('<%s>%s%s</%s>%s', $key, "\n", $this->_makeXmlDoc($val), $key, "\n"); |
59 | 57 | } |
@@ -17,35 +17,35 @@ |
||
17 | 17 | $request_url = Context::getRequestUri(); |
18 | 18 | $output = new stdClass(); |
19 | 19 | |
20 | - if(substr_compare($request_url, '/', -1) !== 0) |
|
20 | + if (substr_compare($request_url, '/', -1) !== 0) |
|
21 | 21 | { |
22 | 22 | $request_url .= '/'; |
23 | 23 | } |
24 | 24 | |
25 | - if($error === 0) |
|
25 | + if ($error === 0) |
|
26 | 26 | { |
27 | - if($message != 'success') $output->message = $message; |
|
27 | + if ($message != 'success') $output->message = $message; |
|
28 | 28 | |
29 | 29 | $output->url = ($redirect_url) ? $redirect_url : $request_uri; |
30 | 30 | } |
31 | 31 | else |
32 | 32 | { |
33 | - if($message != 'fail') $output->message = $message; |
|
33 | + if ($message != 'fail') $output->message = $message; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | $html = array(); |
37 | 37 | $html[] = '<!DOCTYPE html><html><head><title>Moved...</title><meta charset="utf-8" /><script>'; |
38 | 38 | |
39 | - if($output->message) |
|
39 | + if ($output->message) |
|
40 | 40 | { |
41 | - $html[] = 'alert(' . json_encode($output->message, JSON_UNESCAPED_SLASHES) . ');'; |
|
41 | + $html[] = 'alert('.json_encode($output->message, JSON_UNESCAPED_SLASHES).');'; |
|
42 | 42 | } |
43 | 43 | |
44 | - if($output->url) |
|
44 | + if ($output->url) |
|
45 | 45 | { |
46 | 46 | $url = json_encode(preg_replace('/#(.+)$/i', '', $output->url), JSON_UNESCAPED_SLASHES); |
47 | 47 | $html[] = 'var win = (window.opener) ? window.opener : window.parent;'; |
48 | - $html[] = 'win.location.href = ' . $url; |
|
48 | + $html[] = 'win.location.href = '.$url; |
|
49 | 49 | $html[] = 'if(window.opener) self.close();'; |
50 | 50 | } |
51 | 51 |
@@ -24,13 +24,16 @@ |
||
24 | 24 | |
25 | 25 | if($error === 0) |
26 | 26 | { |
27 | - if($message != 'success') $output->message = $message; |
|
27 | + if($message != 'success') { |
|
28 | + $output->message = $message; |
|
29 | + } |
|
28 | 30 | |
29 | 31 | $output->url = ($redirect_url) ? $redirect_url : $request_uri; |
30 | - } |
|
31 | - else |
|
32 | + } else |
|
32 | 33 | { |
33 | - if($message != 'fail') $output->message = $message; |
|
34 | + if($message != 'fail') { |
|
35 | + $output->message = $message; |
|
36 | + } |
|
34 | 37 | } |
35 | 38 | |
36 | 39 | $html = array(); |