@@ -13,19 +13,19 @@ |
||
| 13 | 13 | |
| 14 | 14 | $deepness = substr_count($_SERVER['SCRIPT_NAME'], "/") - 1; |
| 15 | 15 | |
| 16 | -$_PATH = $deepness>0 ? implode("", array_fill(0, $deepness, "../")) : "./"; |
|
| 16 | +$_PATH = $deepness > 0 ? implode("", array_fill(0, $deepness, "../")) : "./"; |
|
| 17 | 17 | |
| 18 | -require_once($_PATH . "vendor/autoload.php"); |
|
| 19 | -spl_autoload_register(function ($className) { |
|
| 18 | +require_once($_PATH."vendor/autoload.php"); |
|
| 19 | +spl_autoload_register(function($className) { |
|
| 20 | 20 | global $_PATH; |
| 21 | 21 | |
| 22 | 22 | $path = explode("\\", $className); |
| 23 | 23 | if (in_array($path[0], array("conf"))) { |
| 24 | - $includePath = $_PATH . str_replace("\\", "/", $className . ".php"); |
|
| 24 | + $includePath = $_PATH.str_replace("\\", "/", $className.".php"); |
|
| 25 | 25 | } else { |
| 26 | - $includePath = $_PATH . "classes/" . str_replace("\\", "/", $className . ".php"); |
|
| 26 | + $includePath = $_PATH."classes/".str_replace("\\", "/", $className.".php"); |
|
| 27 | 27 | } |
| 28 | 28 | require_once($includePath); |
| 29 | 29 | }); |
| 30 | 30 | |
| 31 | -require_once($_PATH . "modules/error_log.php"); |
|
| 32 | 31 | \ No newline at end of file |
| 32 | +require_once($_PATH."modules/error_log.php"); |
|
| 33 | 33 | \ No newline at end of file |
@@ -22,4 +22,4 @@ |
||
| 22 | 22 | $_LANG = Languages::getLanguage($_SESSION['lang']); |
| 23 | 23 | $_SESSION['lang'] = $_LANG->code; |
| 24 | 24 | |
| 25 | -require_once(realpath(dirname(__FILE__)) . "/../conf/langs/" . $_LANG->code . ".php"); |
|
| 26 | 25 | \ No newline at end of file |
| 26 | +require_once(realpath(dirname(__FILE__))."/../conf/langs/".$_LANG->code.".php"); |
|
| 27 | 27 | \ No newline at end of file |
@@ -88,9 +88,9 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function saveActivationFlag() { |
| 90 | 90 | return DBCore::doUpdateQuery( |
| 91 | - "UPDATE " . static::TABLE_NAME . " |
|
| 91 | + "UPDATE ".static::TABLE_NAME." |
|
| 92 | 92 | SET activation = ? |
| 93 | - WHERE " . static::ID_FIELD_NAME . " = ? |
|
| 93 | + WHERE " . static::ID_FIELD_NAME." = ? |
|
| 94 | 94 | LIMIT 1", |
| 95 | 95 | "ii", |
| 96 | 96 | [$this->activation, $this->id] |
@@ -154,9 +154,9 @@ discard block |
||
| 154 | 154 | */ |
| 155 | 155 | public function saveRemovementFlag() { |
| 156 | 156 | return DBCore::doUpdateQuery( |
| 157 | - "UPDATE " . static::TABLE_NAME . " |
|
| 157 | + "UPDATE ".static::TABLE_NAME." |
|
| 158 | 158 | SET removed = ? |
| 159 | - WHERE " . static::ID_FIELD_NAME . " = ? |
|
| 159 | + WHERE " . static::ID_FIELD_NAME." = ? |
|
| 160 | 160 | LIMIT 1", |
| 161 | 161 | "ii", |
| 162 | 162 | [$this->removed, $this->id] |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | */ |
| 358 | 358 | public static function _count($conditions = [], $debug = false) { |
| 359 | 359 | $dbQuery = (new DBPreparedQuery())->prepare( |
| 360 | - "SELECT COUNT(*) as 'val' FROM " . static::TABLE_NAME, |
|
| 360 | + "SELECT COUNT(*) as 'val' FROM ".static::TABLE_NAME, |
|
| 361 | 361 | $conditions |
| 362 | 362 | ); |
| 363 | 363 | |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | */ |
| 379 | 379 | public static function _max($field, $conditions = [], $debug = false) { |
| 380 | 380 | $dbQuery = (new DBPreparedQuery())->prepare( |
| 381 | - "SELECT MAX(`" . $field . "`) as 'val' FROM " . static::TABLE_NAME, |
|
| 381 | + "SELECT MAX(`".$field."`) as 'val' FROM ".static::TABLE_NAME, |
|
| 382 | 382 | $conditions |
| 383 | 383 | ); |
| 384 | 384 | |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | */ |
| 400 | 400 | public static function _min($field, $conditions = [], $debug = false) { |
| 401 | 401 | $dbQuery = (new DBPreparedQuery())->prepare( |
| 402 | - "SELECT MIN(`" . $field . "`) as 'val' FROM " . static::TABLE_NAME, |
|
| 402 | + "SELECT MIN(`".$field."`) as 'val' FROM ".static::TABLE_NAME, |
|
| 403 | 403 | $conditions |
| 404 | 404 | ); |
| 405 | 405 | |
@@ -485,14 +485,14 @@ discard block |
||
| 485 | 485 | public function go($debug = false) { |
| 486 | 486 | switch ($this->dbQuery->getType()) { |
| 487 | 487 | case (DBQueryType::SELECT): |
| 488 | - $this->dbQuery->query = "SELECT * FROM " . static::TABLE_NAME; |
|
| 488 | + $this->dbQuery->query = "SELECT * FROM ".static::TABLE_NAME; |
|
| 489 | 489 | break; |
| 490 | 490 | case (DBQueryType::UPDATE): |
| 491 | - $this->dbQuery->query = "UPDATE " . static::TABLE_NAME . " SET "; |
|
| 491 | + $this->dbQuery->query = "UPDATE ".static::TABLE_NAME." SET "; |
|
| 492 | 492 | $this->dbQuery->sqlPushValues($this->dbQuery->fields); |
| 493 | 493 | break; |
| 494 | 494 | case (DBQueryType::DELETE): |
| 495 | - $this->dbQuery->query = "DELETE FROM " . static::TABLE_NAME; |
|
| 495 | + $this->dbQuery->query = "DELETE FROM ".static::TABLE_NAME; |
|
| 496 | 496 | break; |
| 497 | 497 | } |
| 498 | 498 | |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | if ($this->isNewRecord()) { |
| 503 | 503 | $this->dbQuery->prepareConditions(); |
| 504 | 504 | } else { |
| 505 | - $this->dbQuery->query.= " WHERE "; |
|
| 505 | + $this->dbQuery->query .= " WHERE "; |
|
| 506 | 506 | $this->dbQuery->sqlPushValues([static::ID_FIELD_NAME => $this->id]); |
| 507 | 507 | } |
| 508 | 508 | |
@@ -520,7 +520,7 @@ discard block |
||
| 520 | 520 | if ($this->isNewRecord()) { |
| 521 | 521 | $count = $this->dbQuery->prepareLimit(); |
| 522 | 522 | } else { |
| 523 | - $this->dbQuery->query.= " LIMIT 1"; |
|
| 523 | + $this->dbQuery->query .= " LIMIT 1"; |
|
| 524 | 524 | $count = 1; |
| 525 | 525 | } |
| 526 | 526 | |
@@ -53,9 +53,9 @@ discard block |
||
| 53 | 53 | /** |
| 54 | 54 | * Sets primary key value. |
| 55 | 55 | * |
| 56 | - * @param mixed $recordId Key vaue. |
|
| 56 | + * @param integer $recordId Key vaue. |
|
| 57 | 57 | * |
| 58 | - * @return bool Success flag. |
|
| 58 | + * @return DBObject Success flag. |
|
| 59 | 59 | * @throws DBCoreException If object has no field with such name. |
| 60 | 60 | */ |
| 61 | 61 | public function setId($recordId) { |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | * @param bool $ignore Ignore unique indexes or not. |
| 256 | 256 | * @param bool Debug mode flag. |
| 257 | 257 | * |
| 258 | - * @return mixed Primary key value. |
|
| 258 | + * @return integer Primary key value. |
|
| 259 | 259 | * @throws DBCoreException If some database error occurred. |
| 260 | 260 | */ |
| 261 | 261 | public function insert($ignore = false, $debug = false) { |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | * |
| 484 | 484 | * @param bool $debug Debug mode flag. |
| 485 | 485 | * |
| 486 | - * @return mixed DBObject, array of DBObject or null. |
|
| 486 | + * @return string DBObject, array of DBObject or null. |
|
| 487 | 487 | * @throws DBCoreException If some DB or query syntax errors occurred. |
| 488 | 488 | */ |
| 489 | 489 | public function go($debug = false) { |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | */ |
| 127 | 127 | public function getConnection($connName) { |
| 128 | 128 | if (!isset($this->connections[$connName])) { |
| 129 | - throw new DBCoreException('Unknown connection: ' . $connName); |
|
| 129 | + throw new DBCoreException('Unknown connection: '.$connName); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | return $this->connections[$connName]; |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | $resultSet[$field->table] = []; |
| 280 | 280 | } |
| 281 | 281 | $resultSet[$field->table][$field->name] = $fieldsCounter++; |
| 282 | - $parameterName = "variable" . $fieldsCounter; //$field->name; |
|
| 282 | + $parameterName = "variable".$fieldsCounter; //$field->name; |
|
| 283 | 283 | $$parameterName = null; |
| 284 | 284 | $parameters[] = &$$parameterName; |
| 285 | 285 | } |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | */ |
| 411 | 411 | public static function getTableFieldsList($tableName) { |
| 412 | 412 | if (!empty($tableName)) { |
| 413 | - $query = "SHOW FULL COLUMNS FROM " . $tableName; |
|
| 413 | + $query = "SHOW FULL COLUMNS FROM ".$tableName; |
|
| 414 | 414 | $stmt = self::doSelectQuery($query); |
| 415 | 415 | if ($stmt !== false) { |
| 416 | 416 | $stmt->bind_result( |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | || strpos($type, "datetime") === 0 |
| 457 | 457 | || strpos($type, "timestamp") === 0 |
| 458 | 458 | || strpos($type, "date") === 0) { |
| 459 | - return ('"' . $value . '"'); |
|
| 459 | + return ('"'.$value.'"'); |
|
| 460 | 460 | } elseif (strpos($type, "int") === 0 |
| 461 | 461 | || strpos($type, "tinyint") === 0 |
| 462 | 462 | || strpos($type, "smallint") === 0 |
@@ -492,17 +492,17 @@ discard block |
||
| 492 | 492 | $extra = trim($attributes['extra']); |
| 493 | 493 | $comment = trim($attributes['comment']); |
| 494 | 494 | |
| 495 | - $fieldStr = "'" . $field . "' => "; |
|
| 495 | + $fieldStr = "'".$field."' => "; |
|
| 496 | 496 | if ($attributes['null'] === 'YES' && is_null($attributes['default'])) { |
| 497 | - $fieldStr.= "null"; |
|
| 497 | + $fieldStr .= "null"; |
|
| 498 | 498 | } else { |
| 499 | - $fieldStr.= self::getPrintableSQLValue($attributes['type'], $attributes['default']); |
|
| 499 | + $fieldStr .= self::getPrintableSQLValue($attributes['type'], $attributes['default']); |
|
| 500 | 500 | } |
| 501 | - $fieldStr.= ", // " . $attributes['type'] . |
|
| 502 | - ", " . (($attributes['null'] == "NO") ? "not null" : "null") |
|
| 503 | - . ", default '" . $attributes['default'] . "'" . |
|
| 504 | - ($extra ? ", " . $extra : "") . |
|
| 505 | - ($comment ? " (" . $comment . ")" : "") . "\n"; |
|
| 501 | + $fieldStr .= ", // ".$attributes['type']. |
|
| 502 | + ", ".(($attributes['null'] == "NO") ? "not null" : "null") |
|
| 503 | + . ", default '".$attributes['default']."'". |
|
| 504 | + ($extra ? ", ".$extra : ""). |
|
| 505 | + ($comment ? " (".$comment.")" : "")."\n"; |
|
| 506 | 506 | |
| 507 | 507 | return $fieldStr; |
| 508 | 508 | } |
@@ -557,12 +557,12 @@ discard block |
||
| 557 | 557 | $idFieldName = $dbObject->getIdFieldName(); |
| 558 | 558 | |
| 559 | 559 | if (Tools::isInteger($fieldsList[$idFieldName])) { |
| 560 | - $query = "INSERT " . ($ignore ? 'IGNORE' : 'INTO') . " " . $dbObject->getTableName() . " |
|
| 560 | + $query = "INSERT ".($ignore ? 'IGNORE' : 'INTO')." ".$dbObject->getTableName()." |
|
| 561 | 561 | SET " . DBPreparedQuery::sqlQMValuesString($fieldsList, $idFieldName); |
| 562 | 562 | $typesString = DBPreparedQuery::sqlTypesString($fieldsList, $idFieldName); |
| 563 | 563 | $valuesList = self::createValuesList($fieldsList, $idFieldName); |
| 564 | 564 | } else { |
| 565 | - $query = "INSERT " . ($ignore ? 'IGNORE' : 'INTO') . " " . $dbObject->getTableName() . " |
|
| 565 | + $query = "INSERT ".($ignore ? 'IGNORE' : 'INTO')." ".$dbObject->getTableName()." |
|
| 566 | 566 | SET " . DBPreparedQuery::sqlQMValuesString($fieldsList); |
| 567 | 567 | $typesString = DBPreparedQuery::sqlTypesString($fieldsList); |
| 568 | 568 | $valuesList = self::createValuesList($fieldsList); |
@@ -591,15 +591,15 @@ discard block |
||
| 591 | 591 | $fieldsList = $dbObject->getFieldsList(); |
| 592 | 592 | $idFieldName = $dbObject->getIdFieldName(); |
| 593 | 593 | |
| 594 | - $query = "UPDATE " . $dbObject->getTableName() . " |
|
| 595 | - SET " . DBPreparedQuery::sqlQMValuesString($fieldsList, $idFieldName) . " |
|
| 596 | - WHERE " . $idFieldName . " = ? |
|
| 594 | + $query = "UPDATE ".$dbObject->getTableName()." |
|
| 595 | + SET " . DBPreparedQuery::sqlQMValuesString($fieldsList, $idFieldName)." |
|
| 596 | + WHERE " . $idFieldName." = ? |
|
| 597 | 597 | LIMIT 1"; |
| 598 | 598 | $typesString = DBPreparedQuery::sqlTypesString($fieldsList, $idFieldName); |
| 599 | 599 | if (Tools::isInteger($fieldsList[$idFieldName])) { |
| 600 | - $typesString.= "i"; |
|
| 600 | + $typesString .= "i"; |
|
| 601 | 601 | } else { |
| 602 | - $typesString.= "s"; |
|
| 602 | + $typesString .= "s"; |
|
| 603 | 603 | } |
| 604 | 604 | $valuesList = self::createValuesList($fieldsList, $idFieldName); |
| 605 | 605 | $valuesList[] = $dbObject->getId(); |
@@ -621,8 +621,8 @@ discard block |
||
| 621 | 621 | */ |
| 622 | 622 | public static function deleteDBObject($dbObject) { |
| 623 | 623 | if (!empty($dbObject) && is_object($dbObject)) { |
| 624 | - $query = "DELETE FROM " . $dbObject->getTableName() . |
|
| 625 | - " WHERE " . $dbObject->getIdFieldName() . " = ? LIMIT 1"; |
|
| 624 | + $query = "DELETE FROM ".$dbObject->getTableName(). |
|
| 625 | + " WHERE ".$dbObject->getIdFieldName()." = ? LIMIT 1"; |
|
| 626 | 626 | |
| 627 | 627 | $typesString = "s"; |
| 628 | 628 | if (Tools::isInteger($dbObject->getId())) { |
@@ -674,7 +674,7 @@ discard block |
||
| 674 | 674 | return null; |
| 675 | 675 | } |
| 676 | 676 | } elseif ($stmt->num_rows > 1) { |
| 677 | - throw new DBCoreException("More than single record of '" . $className . "' entity selected"); |
|
| 677 | + throw new DBCoreException("More than single record of '".$className."' entity selected"); |
|
| 678 | 678 | } |
| 679 | 679 | |
| 680 | 680 | return null; |
@@ -621,7 +621,7 @@ |
||
| 621 | 621 | public static function deleteDBObject($dbObject) { |
| 622 | 622 | if (!empty($dbObject) && is_object($dbObject)) { |
| 623 | 623 | $query = "DELETE FROM " . $dbObject->getTableName() . |
| 624 | - " WHERE " . $dbObject->getIdFieldName() . " = ? LIMIT 1"; |
|
| 624 | + " WHERE " . $dbObject->getIdFieldName() . " = ? LIMIT 1"; |
|
| 625 | 625 | |
| 626 | 626 | $typesString = "s"; |
| 627 | 627 | if (Tools::isInteger($dbObject->getId())) { |
@@ -126,7 +126,7 @@ |
||
| 126 | 126 | * priority the same. |
| 127 | 127 | */ |
| 128 | 128 | public static function reorderMessages() { |
| 129 | - uasort(self::$messages, function ($a, $b) { |
|
| 129 | + uasort(self::$messages, function($a, $b) { |
|
| 130 | 130 | return ($a->type <= $b->type); |
| 131 | 131 | }); |
| 132 | 132 | } |
@@ -217,8 +217,8 @@ discard block |
||
| 217 | 217 | return ""; |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | - if (!self::validateRegexp($url, "#^" . $protocol . "://.+#")) { |
|
| 221 | - $url = $protocol . "://" . $url; |
|
| 220 | + if (!self::validateRegexp($url, "#^".$protocol."://.+#")) { |
|
| 221 | + $url = $protocol."://".$url; |
|
| 222 | 222 | } |
| 223 | 223 | $url = preg_replace("#/{3,}#", "//", $url); |
| 224 | 224 | |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | |
| 265 | 265 | return self::validateRegexp( |
| 266 | 266 | $value, |
| 267 | - "<^(?#Protocol)(?:(?:ht|f)tp(?:s?)\:\/\/|~/|/)?(?#Username:Password)(?:\w+:\w+@)?(?#Subdomains)(?:(?:[-\w]+\.)+(?#TopLevel Domains)(?:" . implode("|", $topLevelDomainsList) . "|[a-z]{2}))(?#Port)(?::[\d]{1,5})?(?#Directories)(?:(?:(?:/(?:[-\w~!$+|.,=]|%[a-f\d]{2})+)+|/)+|\?|#)?(?#Query)(?:(?:\?(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)(?:&(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)*)*(?#Anchor)(?:#(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)?$>" |
|
| 267 | + "<^(?#Protocol)(?:(?:ht|f)tp(?:s?)\:\/\/|~/|/)?(?#Username:Password)(?:\w+:\w+@)?(?#Subdomains)(?:(?:[-\w]+\.)+(?#TopLevel Domains)(?:".implode("|", $topLevelDomainsList)."|[a-z]{2}))(?#Port)(?::[\d]{1,5})?(?#Directories)(?:(?:(?:/(?:[-\w~!$+|.,=]|%[a-f\d]{2})+)+|/)+|\?|#)?(?#Query)(?:(?:\?(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)(?:&(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)*)*(?#Anchor)(?:#(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)?$>" |
|
| 268 | 268 | ); |
| 269 | 269 | } |
| 270 | 270 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | } else { |
| 47 | 47 | $fieldValue = $newValue; |
| 48 | 48 | } |
| 49 | - $count ++; |
|
| 49 | + $count++; |
|
| 50 | 50 | } elseif (!empty($this->fieldsAliases)) { // look up for the field aliases |
| 51 | 51 | $fieldAliases = array_keys($this->fieldsAliases, $fieldName); |
| 52 | 52 | if (!empty($fieldAliases)) { |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | } else { |
| 59 | 59 | $fieldValue = $newValue; |
| 60 | 60 | } |
| 61 | - $count ++; |
|
| 61 | + $count++; |
|
| 62 | 62 | |
| 63 | 63 | break; |
| 64 | 64 | } |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | return $this; |
| 94 | 94 | } else { |
| 95 | - throw new \Exception("Object '" . get_class($this) . "' hasn't field '" . $fieldName . "'"); |
|
| 95 | + throw new \Exception("Object '".get_class($this)."' hasn't field '".$fieldName."'"); |
|
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | return $fieldsList; |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - return array_map(function ($e) { |
|
| 117 | + return array_map(function($e) { |
|
| 118 | 118 | return stripslashes($e); |
| 119 | 119 | }, $this->fieldsList); |
| 120 | 120 | } |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | if (isset($this->fieldsList[$fieldName])) { |
| 136 | 136 | return stripslashes($this->fieldsList[$fieldName]); |
| 137 | 137 | } else { |
| 138 | - throw new \Exception("Object '" . get_class($this) . "' hasn't field '" . $fieldName . "'"); |
|
| 138 | + throw new \Exception("Object '".get_class($this)."' hasn't field '".$fieldName."'"); |
|
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 | |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | * @return mixed The return value of the callback, or FALSE on error. |
| 214 | 214 | */ |
| 215 | 215 | public function __set($fieldName, $fieldValue) { |
| 216 | - return call_user_func_array([$this, "set" . ucfirst($fieldName)], [$fieldValue]); |
|
| 216 | + return call_user_func_array([$this, "set".ucfirst($fieldName)], [$fieldValue]); |
|
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | /** |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | * @return mixed The return value of the callback, or FALSE on error. |
| 225 | 225 | */ |
| 226 | 226 | public function __get($fieldName) { |
| 227 | - return call_user_func_array([$this, "get" . ucfirst($fieldName)], []); |
|
| 227 | + return call_user_func_array([$this, "get".ucfirst($fieldName)], []); |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | } |
@@ -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 | |
@@ -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 | } |
@@ -96,19 +96,19 @@ discard block |
||
| 96 | 96 | * @return string URL. |
| 97 | 97 | */ |
| 98 | 98 | public function getUrl($action = null, $id = null, $getParams = []) { |
| 99 | - $url = $this->controller . "/"; |
|
| 99 | + $url = $this->controller."/"; |
|
| 100 | 100 | |
| 101 | 101 | $action = is_null($action) ? $this->action : $action; |
| 102 | 102 | if (!is_null($id)) { |
| 103 | - $url.= $action . "/" . $id; |
|
| 103 | + $url .= $action."/".$id; |
|
| 104 | 104 | } else { |
| 105 | - $url.= $action; |
|
| 105 | + $url .= $action; |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | if (!empty($getParams)) { |
| 109 | - $url.= "?"; |
|
| 109 | + $url .= "?"; |
|
| 110 | 110 | foreach ($getParams as $key => $value) { |
| 111 | - $url.= $key . "=" . $value; |
|
| 111 | + $url .= $key."=".$value; |
|
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | |
@@ -121,9 +121,9 @@ discard block |
||
| 121 | 121 | * @return string |
| 122 | 122 | */ |
| 123 | 123 | public function tplPath() { |
| 124 | - $path = $this->controller . "/" . $this->controller; |
|
| 124 | + $path = $this->controller."/".$this->controller; |
|
| 125 | 125 | if (!empty($this->action)) { |
| 126 | - $path.= "_" . $this->action; |
|
| 126 | + $path .= "_".$this->action; |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | return $path; |