@@ -292,7 +292,6 @@ discard block |
||
292 | 292 | * Return parameters from the statment with dynamic number of parameters. |
293 | 293 | * |
294 | 294 | * @param resource $stmt Statement. |
295 | - * @param array $params Parameters. |
|
296 | 295 | */ |
297 | 296 | public static function bindResults($stmt) |
298 | 297 | { |
@@ -495,7 +494,7 @@ discard block |
||
495 | 494 | * Returns printable field description string for table fields list generator. |
496 | 495 | * |
497 | 496 | * @param string $field Field name. |
498 | - * @param array $attributes List of field attributes. |
|
497 | + * @param string $attributes List of field attributes. |
|
499 | 498 | * |
500 | 499 | * @return string |
501 | 500 | */ |
@@ -818,7 +817,7 @@ discard block |
||
818 | 817 | /** |
819 | 818 | * Executes SQL query with single record and value result and return this value. |
820 | 819 | * |
821 | - * @param mixed $query SQL query template string or DBPreparedQuery object |
|
820 | + * @param string $query SQL query template string or DBPreparedQuery object |
|
822 | 821 | * if single parameter. |
823 | 822 | * @param string $types Types string (ex: "isdb"). |
824 | 823 | * @param array $params Parameters in the same order like types string. |
@@ -639,7 +639,7 @@ |
||
639 | 639 | { |
640 | 640 | if (!empty($dbObject) && is_object($dbObject)) { |
641 | 641 | $query = 'DELETE FROM '.$dbObject->getTableName(). |
642 | - ' WHERE '.$dbObject->getIdFieldName().' = ? LIMIT 1'; |
|
642 | + ' WHERE '.$dbObject->getIdFieldName().' = ? LIMIT 1'; |
|
643 | 643 | if (Tools::isInteger($dbObject->getId())) { |
644 | 644 | $typesString = 'i'; |
645 | 645 | } else { |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | public function openConnection($connResource, $connName = null) |
116 | 116 | { |
117 | 117 | if ($connName !== null) { |
118 | - $connName = (string) $connName; |
|
118 | + $connName = (string)$connName; |
|
119 | 119 | if (isset($this->connections[$connName])) { |
120 | 120 | throw new DBCoreException('You trying to save a connection with an existing name'); |
121 | 121 | } |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | public function getConnection($connName) |
140 | 140 | { |
141 | 141 | if (!isset($this->connections[$connName])) { |
142 | - throw new DBCoreException('Unknown connection: '.$connName); |
|
142 | + throw new DBCoreException('Unknown connection: ' . $connName); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | return $this->connections[$connName]; |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | $resultSet[$field->table] = []; |
305 | 305 | } |
306 | 306 | $resultSet[$field->table][$field->name] = $fieldsCounter++; |
307 | - $parameterName = 'variable'.$fieldsCounter; //$field->name; |
|
307 | + $parameterName = 'variable' . $fieldsCounter; //$field->name; |
|
308 | 308 | $$parameterName = null; |
309 | 309 | $parameters[] = &$$parameterName; |
310 | 310 | } |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | public static function getTableFieldsList($tableName) |
421 | 421 | { |
422 | 422 | if (!empty($tableName)) { |
423 | - $query = 'SHOW FULL COLUMNS FROM '.$tableName; |
|
423 | + $query = 'SHOW FULL COLUMNS FROM ' . $tableName; |
|
424 | 424 | $stmt = self::doSelectQuery($query); |
425 | 425 | if ($stmt !== false) { |
426 | 426 | $stmt->bind_result( |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | || strpos($type, 'datetime') === 0 |
468 | 468 | || strpos($type, 'timestamp') === 0 |
469 | 469 | || strpos($type, 'date') === 0) { |
470 | - return '"'.$value.'"'; |
|
470 | + return '"' . $value . '"'; |
|
471 | 471 | } elseif (strpos($type, 'int') === 0 |
472 | 472 | || strpos($type, 'tinyint') === 0 |
473 | 473 | || strpos($type, 'smallint') === 0 |
@@ -504,17 +504,17 @@ discard block |
||
504 | 504 | $extra = trim($attributes['extra']); |
505 | 505 | $comment = trim($attributes['comment']); |
506 | 506 | |
507 | - $fieldStr = "'".$field."' => "; |
|
507 | + $fieldStr = "'" . $field . "' => "; |
|
508 | 508 | if ($attributes['null'] === 'YES' && is_null($attributes['default'])) { |
509 | 509 | $fieldStr .= 'null'; |
510 | 510 | } else { |
511 | 511 | $fieldStr .= self::getPrintableSQLValue($attributes['type'], $attributes['default']); |
512 | 512 | } |
513 | - $fieldStr .= ', // '.$attributes['type']. |
|
514 | - ', '.(($attributes['null'] == 'NO') ? 'not null' : 'null') |
|
515 | - .", default '".$attributes['default']."'". |
|
516 | - ($extra ? ', '.$extra : ''). |
|
517 | - ($comment ? ' ('.$comment.')' : '')."\n"; |
|
513 | + $fieldStr .= ', // ' . $attributes['type'] . |
|
514 | + ', ' . (($attributes['null'] == 'NO') ? 'not null' : 'null') |
|
515 | + .", default '" . $attributes['default'] . "'" . |
|
516 | + ($extra ? ', ' . $extra : '') . |
|
517 | + ($comment ? ' (' . $comment . ')' : '') . "\n"; |
|
518 | 518 | |
519 | 519 | return $fieldStr; |
520 | 520 | } |
@@ -572,12 +572,12 @@ discard block |
||
572 | 572 | $idFieldName = $dbObject->getIdFieldName(); |
573 | 573 | |
574 | 574 | if (Tools::isInteger($fieldsList[$idFieldName])) { |
575 | - $query = 'INSERT INTO '.$dbObject->getTableName().' |
|
575 | + $query = 'INSERT INTO ' . $dbObject->getTableName() . ' |
|
576 | 576 | SET '.DBPreparedQuery::sqlQMValuesString($fieldsList, $idFieldName); |
577 | 577 | $typesString = DBPreparedQuery::sqlTypesString($fieldsList, $idFieldName); |
578 | 578 | $valuesList = self::createValuesList($fieldsList, $idFieldName); |
579 | 579 | } else { |
580 | - $query = 'INSERT INTO '.$dbObject->getTableName().' |
|
580 | + $query = 'INSERT INTO ' . $dbObject->getTableName() . ' |
|
581 | 581 | SET '.DBPreparedQuery::sqlQMValuesString($fieldsList); |
582 | 582 | $typesString = DBPreparedQuery::sqlTypesString($fieldsList); |
583 | 583 | $valuesList = self::createValuesList($fieldsList); |
@@ -607,9 +607,9 @@ discard block |
||
607 | 607 | $fieldsList = $dbObject->getFieldsList(); |
608 | 608 | $idFieldName = $dbObject->getIdFieldName(); |
609 | 609 | |
610 | - $query = 'UPDATE '.$dbObject->getTableName().' |
|
611 | - SET '.DBPreparedQuery::sqlQMValuesString($fieldsList, $idFieldName).' |
|
612 | - WHERE '.$idFieldName.' = ? |
|
610 | + $query = 'UPDATE ' . $dbObject->getTableName() . ' |
|
611 | + SET '.DBPreparedQuery::sqlQMValuesString($fieldsList, $idFieldName) . ' |
|
612 | + WHERE '.$idFieldName . ' = ? |
|
613 | 613 | LIMIT 1'; |
614 | 614 | $typesString = DBPreparedQuery::sqlTypesString($fieldsList, $idFieldName); |
615 | 615 | if (Tools::isInteger($fieldsList[$idFieldName])) { |
@@ -638,8 +638,8 @@ discard block |
||
638 | 638 | public static function deleteDBObject($dbObject) |
639 | 639 | { |
640 | 640 | if (!empty($dbObject) && is_object($dbObject)) { |
641 | - $query = 'DELETE FROM '.$dbObject->getTableName(). |
|
642 | - ' WHERE '.$dbObject->getIdFieldName().' = ? LIMIT 1'; |
|
641 | + $query = 'DELETE FROM ' . $dbObject->getTableName() . |
|
642 | + ' WHERE ' . $dbObject->getIdFieldName() . ' = ? LIMIT 1'; |
|
643 | 643 | if (Tools::isInteger($dbObject->getId())) { |
644 | 644 | $typesString = 'i'; |
645 | 645 | } else { |
@@ -694,7 +694,7 @@ discard block |
||
694 | 694 | return; |
695 | 695 | } |
696 | 696 | } elseif ($stmt->num_rows > 1) { |
697 | - throw new DBCoreException("More than single record of '".$className."' entity selected"); |
|
697 | + throw new DBCoreException("More than single record of '" . $className . "' entity selected"); |
|
698 | 698 | } |
699 | 699 | } |
700 | 700 | |
@@ -871,7 +871,7 @@ discard block |
||
871 | 871 | public static function __callStatic($methodName, $methodParams) |
872 | 872 | { |
873 | 873 | if (strrpos($methodName, 'ies') == strlen($methodName) - 3) { |
874 | - $methodName = substr($methodName, 0, strlen($methodName) - 3).'ys'; |
|
874 | + $methodName = substr($methodName, 0, strlen($methodName) - 3) . 'ys'; |
|
875 | 875 | } |
876 | 876 | |
877 | 877 | /* |
@@ -918,12 +918,12 @@ discard block |
||
918 | 918 | $dbObject = new $className(); |
919 | 919 | |
920 | 920 | if (!isInstanceOf($dbObject, $className)) { |
921 | - throw new DBCoreException("Class with name '".$className."' is not exists"); |
|
921 | + throw new DBCoreException("Class with name '" . $className . "' is not exists"); |
|
922 | 922 | } |
923 | 923 | |
924 | - $query = 'DELETE FROM '.$dbObject->getTableName().' |
|
925 | - WHERE '.$dbObject->getIdFieldName().' |
|
926 | - IN ('.DBPreparedQuery::sqlQMString($itemsNumber).')'; |
|
924 | + $query = 'DELETE FROM ' . $dbObject->getTableName() . ' |
|
925 | + WHERE '.$dbObject->getIdFieldName() . ' |
|
926 | + IN ('.DBPreparedQuery::sqlQMString($itemsNumber) . ')'; |
|
927 | 927 | |
928 | 928 | return self::doUpdateQuery($query, $types, $idsList); |
929 | 929 | } |
@@ -936,7 +936,7 @@ discard block |
||
936 | 936 | */ |
937 | 937 | if (preg_match('#delete([a-zA-Z]+)#', $methodName, $matches)) { |
938 | 938 | return call_user_func( |
939 | - [self::getInstance(), $methodName.'s'], |
|
939 | + [self::getInstance(), $methodName . 's'], |
|
940 | 940 | [$methodParams[0]] |
941 | 941 | ); |
942 | 942 | } |
@@ -947,7 +947,7 @@ discard block |
||
947 | 947 | if (preg_match('#set([a-zA-Z]+)Activation#', $methodName, $matches)) { |
948 | 948 | $className = $matches[1]; |
949 | 949 | if (strrpos($className, 'ies') == strlen($className) - 3) { |
950 | - $className = substr($className, 0, strlen($className) - 3).'y'; |
|
950 | + $className = substr($className, 0, strlen($className) - 3) . 'y'; |
|
951 | 951 | } else { |
952 | 952 | $className = substr($className, 0, strlen($className) - 1); |
953 | 953 | } |
@@ -967,17 +967,17 @@ discard block |
||
967 | 967 | $dbObject = new $className(); |
968 | 968 | |
969 | 969 | if (!isInstanceOf($dbObject, $className)) { |
970 | - throw new DBCoreException("Class with name '".$className."' is not exists"); |
|
970 | + throw new DBCoreException("Class with name '" . $className . "' is not exists"); |
|
971 | 971 | } |
972 | 972 | |
973 | - $query = 'UPDATE '.$dbObject->getTableName().' SET `'.$activationFieldName."` = '".$activationValue."' |
|
974 | - WHERE ".$dbObject->getIdFieldName().' IN ('.DBPreparedQuery::sqlQMString($itemsNumber).')'; |
|
973 | + $query = 'UPDATE ' . $dbObject->getTableName() . ' SET `' . $activationFieldName . "` = '" . $activationValue . "' |
|
974 | + WHERE ".$dbObject->getIdFieldName() . ' IN (' . DBPreparedQuery::sqlQMString($itemsNumber) . ')'; |
|
975 | 975 | |
976 | 976 | return self::doUpdateQuery($query, $types, $idsList); |
977 | 977 | } |
978 | 978 | } |
979 | 979 | |
980 | - throw new DBCoreException('No such method "'.$methodName.'"'); |
|
980 | + throw new DBCoreException('No such method "' . $methodName . '"'); |
|
981 | 981 | } |
982 | 982 | } |
983 | 983 |
@@ -58,11 +58,11 @@ discard block |
||
58 | 58 | /** |
59 | 59 | * Sets primary key value. |
60 | 60 | * |
61 | - * @param mixed $recordId Key vaue. |
|
61 | + * @param integer $recordId Key vaue. |
|
62 | 62 | * |
63 | 63 | * @throws DBCoreException If object has no field with such name. |
64 | 64 | * |
65 | - * @return bool Success flag. |
|
65 | + * @return DBObject Success flag. |
|
66 | 66 | */ |
67 | 67 | public function setId($recordId) |
68 | 68 | { |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | /** |
533 | 533 | * Deletes DB record for current DBObject. |
534 | 534 | * |
535 | - * @return mixed Number of affected rows (1 if some record was deleted, |
|
535 | + * @return integer Number of affected rows (1 if some record was deleted, |
|
536 | 536 | * 0 - if no) or FALSE if some error occurred. |
537 | 537 | */ |
538 | 538 | public function delete() |
@@ -98,9 +98,9 @@ discard block |
||
98 | 98 | public function saveActivationFlag() |
99 | 99 | { |
100 | 100 | return DBCore::doUpdateQuery( |
101 | - 'UPDATE '.static::TABLE_NAME.' |
|
101 | + 'UPDATE ' . static::TABLE_NAME . ' |
|
102 | 102 | SET activation = ? |
103 | - WHERE '.static::ID_FIELD_NAME.' = ? |
|
103 | + WHERE '.static::ID_FIELD_NAME . ' = ? |
|
104 | 104 | LIMIT 1', |
105 | 105 | 'ii', |
106 | 106 | [$this->activation, $this->id] |
@@ -169,9 +169,9 @@ discard block |
||
169 | 169 | public function saveRemovementFlag() |
170 | 170 | { |
171 | 171 | return DBCore::doUpdateQuery( |
172 | - 'UPDATE '.static::TABLE_NAME.' |
|
172 | + 'UPDATE ' . static::TABLE_NAME . ' |
|
173 | 173 | SET removed = ? |
174 | - WHERE '.static::ID_FIELD_NAME.' = ? |
|
174 | + WHERE '.static::ID_FIELD_NAME . ' = ? |
|
175 | 175 | LIMIT 1', |
176 | 176 | 'ii', |
177 | 177 | [$this->removed, $this->id] |
@@ -434,14 +434,14 @@ discard block |
||
434 | 434 | { |
435 | 435 | switch ($this->dbQuery->getType()) { |
436 | 436 | case DBQueryType::SELECT: |
437 | - $this->dbQuery->query = 'SELECT * FROM '.static::TABLE_NAME; |
|
437 | + $this->dbQuery->query = 'SELECT * FROM ' . static::TABLE_NAME; |
|
438 | 438 | break; |
439 | 439 | case DBQueryType::UPDATE: |
440 | - $this->dbQuery->query = 'UPDATE '.static::TABLE_NAME.' SET '; |
|
440 | + $this->dbQuery->query = 'UPDATE ' . static::TABLE_NAME . ' SET '; |
|
441 | 441 | $this->dbQuery->sqlPushValues($this->dbQuery->fields); |
442 | 442 | break; |
443 | 443 | case DBQueryType::DELETE: |
444 | - $this->dbQuery->query = 'DELETE FROM '.static::TABLE_NAME; |
|
444 | + $this->dbQuery->query = 'DELETE FROM ' . static::TABLE_NAME; |
|
445 | 445 | break; |
446 | 446 | } |
447 | 447 | |
@@ -466,11 +466,11 @@ discard block |
||
466 | 466 | $this->dbQuery->query .= ' ORDER BY'; |
467 | 467 | if (is_array($this->dbQuery->order)) { |
468 | 468 | foreach ($this->dbQuery->order as $fieldName => $ord) { |
469 | - $this->dbQuery->query .= ' '.$fieldName.' '.$ord.','; |
|
469 | + $this->dbQuery->query .= ' ' . $fieldName . ' ' . $ord . ','; |
|
470 | 470 | } |
471 | 471 | $this->dbQuery->query = substr($this->dbQuery->query, 0, strlen($this->dbQuery->query) - 1); |
472 | 472 | } elseif (is_string($this->dbQuery->order)) { |
473 | - $this->dbQuery->query .= ' '.$this->dbQuery->order; |
|
473 | + $this->dbQuery->query .= ' ' . $this->dbQuery->order; |
|
474 | 474 | } |
475 | 475 | } |
476 | 476 | } |
@@ -482,13 +482,13 @@ discard block |
||
482 | 482 | if ($this->isNewRecord()) { |
483 | 483 | if (!is_null($this->dbQuery->limit)) { |
484 | 484 | if (Tools::isInteger($this->dbQuery->limit)) { |
485 | - $this->dbQuery->query .= ' LIMIT '.$this->dbQuery->limit; |
|
485 | + $this->dbQuery->query .= ' LIMIT ' . $this->dbQuery->limit; |
|
486 | 486 | $count = $this->dbQuery->limit; |
487 | 487 | } elseif (is_array($this->dbQuery->limit) && count($this->dbQuery->limit) == 2) { |
488 | 488 | $offset = $this->dbQuery->limit[0]; |
489 | 489 | $count = $this->dbQuery->limit[1]; |
490 | 490 | if (Tools::isInteger($offset) && Tools::isInteger($count)) { |
491 | - $this->dbQuery->query .= ' LIMIT '.$offset.', '.$count; |
|
491 | + $this->dbQuery->query .= ' LIMIT ' . $offset . ', ' . $count; |
|
492 | 492 | } else { |
493 | 493 | throw new DBCoreException('Invalid LIMIT param in select() method.'); |
494 | 494 | } |
@@ -143,7 +143,7 @@ |
||
143 | 143 | * css($propertyName, $propertyValue) Set the value of a CSS property. |
144 | 144 | * |
145 | 145 | * @param string $propertyName Name of a CSS property. |
146 | - * @param mixed $propertyValue Value of a CSS property. |
|
146 | + * @param string $propertyValue Value of a CSS property. |
|
147 | 147 | * |
148 | 148 | * @return Value of the CSS property or NULL if property is not exists. |
149 | 149 | */ |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | if (isset($this->$attributeName)) { |
118 | 118 | $this->$attributeName = $attributeValue; |
119 | 119 | } else { |
120 | - throw new \Exception("Wrong attribute '".$attributeName."' for ".get_class($this).' component'); |
|
120 | + throw new \Exception("Wrong attribute '" . $attributeName . "' for " . get_class($this) . ' component'); |
|
121 | 121 | } |
122 | 122 | } |
123 | 123 | } |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | { |
171 | 171 | $style = ''; |
172 | 172 | foreach ($this->style as $propertyName => $propertyValue) { |
173 | - $style .= $propertyName.':'.$propertyValue.';'; |
|
173 | + $style .= $propertyName . ':' . $propertyValue . ';'; |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | return $style; |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | OutputStream::start(); |
16 | 16 | |
17 | 17 | if (!file_exists(RESULTS_PATH) || is_file(RESULTS_PATH)) { |
18 | - OutputStream::msg(OutputStream::MSG_ERROR, "Destination directory '".RESULTS_PATH."' doesn't exists."); |
|
18 | + OutputStream::msg(OutputStream::MSG_ERROR, "Destination directory '" . RESULTS_PATH . "' doesn't exists."); |
|
19 | 19 | OutputStream::close(); |
20 | 20 | exit(); |
21 | 21 | } |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | if ($stmt !== false) { |
27 | 27 | $tpl = file_get_contents(CLASS_TPL); |
28 | 28 | while ($resultSet = DBCore::bindResults($stmt)) { |
29 | - $tableName = $resultSet['TABLE_NAMES']['Tables_in_'.conf\Config::getDBConfigParam('DBNAME')]; |
|
29 | + $tableName = $resultSet['TABLE_NAMES']['Tables_in_' . conf\Config::getDBConfigParam('DBNAME')]; |
|
30 | 30 | |
31 | - OutputStream::msg(OutputStream::MSG_INFO, "Reading structure for table '".$tableName."'..."); |
|
31 | + OutputStream::msg(OutputStream::MSG_INFO, "Reading structure for table '" . $tableName . "'..."); |
|
32 | 32 | |
33 | 33 | $idFieldName = 'id'; |
34 | 34 | $fieldsListStr = ''; |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | if ($attributes['key'] === 'PRI') { |
39 | 39 | $idFieldName = $field; |
40 | 40 | } |
41 | - $fieldsListStr .= ' '.DBCore::getPrintableFieldString($field, $attributes); |
|
41 | + $fieldsListStr .= ' ' . DBCore::getPrintableFieldString($field, $attributes); |
|
42 | 42 | } |
43 | 43 | $fieldsListStr = substr($fieldsListStr, 0, strlen($fieldsListStr) - 1); |
44 | 44 | |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | date('Y'), AUTHOR, EMAIL, |
53 | 53 | ], $tpl); |
54 | 54 | |
55 | - file_put_contents(RESULTS_PATH.$className.'.php', $content); |
|
55 | + file_put_contents(RESULTS_PATH . $className . '.php', $content); |
|
56 | 56 | |
57 | - OutputStream::msg(OutputStream::MSG_SUCCESS, "Class '".RESULTS_PATH.$className.".php' generated."); |
|
57 | + OutputStream::msg(OutputStream::MSG_SUCCESS, "Class '" . RESULTS_PATH . $className . ".php' generated."); |
|
58 | 58 | } else { |
59 | - OutputStream::msg(OutputStream::MSG_ERROR, "Can't read structure for table '".$tableName."'."); |
|
59 | + OutputStream::msg(OutputStream::MSG_ERROR, "Can't read structure for table '" . $tableName . "'."); |
|
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | { |
71 | 71 | $underlinesReplaced = preg_replace_callback( |
72 | 72 | '/_([a-zA-Z]{1})/', |
73 | - function ($matches) { |
|
73 | + function($matches) { |
|
74 | 74 | return strtoupper($matches[1]); |
75 | 75 | }, |
76 | 76 | $tableName |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | session_start(); |
4 | -header('X-Powered-By: Asymptix PHP Framework, PHP/'.phpversion()); |
|
4 | +header('X-Powered-By: Asymptix PHP Framework, PHP/' . phpversion()); |
|
5 | 5 | |
6 | 6 | require_once 'modules/autoload.php'; |
7 | 7 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * Pagination |
40 | 40 | */ |
41 | 41 | if (isset($_ARGS['pn'])) { |
42 | - $_REQUEST['pn'] = (int) $_ARGS['pn']; |
|
42 | + $_REQUEST['pn'] = (int)$_ARGS['pn']; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | $_ROUTE = new Route($request); |
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | if ($_ROUTE->isBackend) { |
71 | - require_once 'controllers/backend/'.$_ROUTE->controller.'.php'; |
|
71 | + require_once 'controllers/backend/' . $_ROUTE->controller . '.php'; |
|
72 | 72 | require_once 'templates/backend/master.tpl.php'; |
73 | 73 | } else { |
74 | - require_once 'controllers/frontend/'.$_ROUTE->controller.'.php'; |
|
74 | + require_once 'controllers/frontend/' . $_ROUTE->controller . '.php'; |
|
75 | 75 | require_once 'templates/frontend/master.tpl.php'; |
76 | 76 | } |
@@ -15,8 +15,8 @@ |
||
15 | 15 | use Asymptix\web\Request; |
16 | 16 | |
17 | 17 | // Set and Reset filter submit fields names may be changed. |
18 | -$setFilter = (bool) Request::getFieldValue('setFilter'); |
|
19 | -$resetFilter = (bool) Request::getFieldValue('resetFilter'); |
|
18 | +$setFilter = (bool)Request::getFieldValue('setFilter'); |
|
19 | +$resetFilter = (bool)Request::getFieldValue('resetFilter'); |
|
20 | 20 | |
21 | 21 | if (isset($_SESSION['_filter'])) { |
22 | 22 | $_FILTER = unserialize($_SESSION['_filter']); |
@@ -20,10 +20,10 @@ discard block |
||
20 | 20 | Config::getDBConfigParam('USER'), Config::getDBConfigParam('PASSWORD'), |
21 | 21 | Config::getDBConfigParam('DBNAME')); |
22 | 22 | if ($mysqli->connect_error) { |
23 | - die('Connect Error ('.$mysqli->connect_errno.') '.$mysqli->connect_error); |
|
23 | + die('Connect Error (' . $mysqli->connect_errno . ') ' . $mysqli->connect_error); |
|
24 | 24 | } else { |
25 | 25 | if (!$mysqli->set_charset(Config::getDBConfigParam('DB_CHARSET'))) { |
26 | - printf('Error loading character set '.Config::getDBConfigParam('DB_CHARSET').": %s\n", $mysqli->error); |
|
26 | + printf('Error loading character set ' . Config::getDBConfigParam('DB_CHARSET') . ": %s\n", $mysqli->error); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | $manager = DBCore::getInstance(); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | // Register a shutdown function which will close DB connection |
36 | -register_shutdown_function(function () { |
|
36 | +register_shutdown_function(function() { |
|
37 | 37 | global $manager; |
38 | 38 | |
39 | 39 | $conns = $manager->getConnections(); |
@@ -24,16 +24,16 @@ discard block |
||
24 | 24 | { |
25 | 25 | $paramsString = ''; |
26 | 26 | foreach ($params as $key => $value) { |
27 | - $paramsString .= '&'.$key.'='.$value; |
|
27 | + $paramsString .= '&' . $key . '=' . $value; |
|
28 | 28 | } |
29 | 29 | if ($session) { |
30 | - $paramsString .= '&'.session_name().'='.session_id(); |
|
30 | + $paramsString .= '&' . session_name() . '=' . session_id(); |
|
31 | 31 | } |
32 | 32 | $paramsString = substr($paramsString, 1); |
33 | 33 | if ($paramsString) { |
34 | - $paramsString = '?'.$paramsString; |
|
34 | + $paramsString = '?' . $paramsString; |
|
35 | 35 | } |
36 | - header('Location: '.$url.$paramsString); |
|
36 | + header('Location: ' . $url . $paramsString); |
|
37 | 37 | exit(); |
38 | 38 | } |
39 | 39 | } |
@@ -125,13 +125,13 @@ discard block |
||
125 | 125 | case 505: $text = 'HTTP Version not supported'; |
126 | 126 | break; |
127 | 127 | default: |
128 | - exit('Unknown http status code "'.htmlentities($code).'"'); |
|
128 | + exit('Unknown http status code "' . htmlentities($code) . '"'); |
|
129 | 129 | break; |
130 | 130 | } |
131 | 131 | |
132 | 132 | $protocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0'); |
133 | 133 | |
134 | - header($protocol.' '.$code.' '.$text); |
|
134 | + header($protocol . ' ' . $code . ' ' . $text); |
|
135 | 135 | |
136 | 136 | $GLOBALS['http_response_code'] = $code; |
137 | 137 | } else { |
@@ -23,4 +23,4 @@ |
||
23 | 23 | $_LANG = Languages::getLanguage($_SESSION['lang']); |
24 | 24 | $_SESSION['lang'] = $_LANG->code; |
25 | 25 | |
26 | -require_once realpath(dirname(__FILE__)).'/../conf/langs/'.$_LANG->code.'.php'; |
|
26 | +require_once realpath(dirname(__FILE__)) . '/../conf/langs/' . $_LANG->code . '.php'; |