@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | $configOrig = $dbConnection->getConfig(); |
| 26 | 26 | array_walk_recursive( |
| 27 | 27 | $configOrig, |
| 28 | - function ($k, $v) use (&$configTmp) { |
|
| 28 | + function($k, $v) use (&$configTmp) { |
|
| 29 | 29 | $configTmp[] = $v; |
| 30 | 30 | $configTmp[] = $k; |
| 31 | 31 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $optimized = 0; |
| 52 | 52 | if (!empty($tables)) { |
| 53 | 53 | foreach ($tables as $table) { |
| 54 | - $optimize = 'OPTIMIZE TABLE ' . $dbConnection->quote_string($table); |
|
| 54 | + $optimize = 'OPTIMIZE TABLE '.$dbConnection->quote_string($table); |
|
| 55 | 55 | $result = $dbConnection->query($optimize); |
| 56 | 56 | if ($result) { |
| 57 | 57 | $optimized++; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $optimized = 0; |
| 80 | 80 | if (!empty($tables)) { |
| 81 | 81 | foreach ($tables as $table) { |
| 82 | - $optimize = 'REPAIR TABLE ' . $dbConnection->quote_string($table); |
|
| 82 | + $optimize = 'REPAIR TABLE '.$dbConnection->quote_string($table); |
|
| 83 | 83 | $result = $dbConnection->query($optimize); |
| 84 | 84 | if ($result) { |
| 85 | 85 | $optimized++; |
@@ -199,23 +199,23 @@ discard block |
||
| 199 | 199 | |
| 200 | 200 | $whereSQL = $dbConnection->_parseArrayPair($whereArray, 'AND'); |
| 201 | 201 | if ($whereSQL) { |
| 202 | - $whereSQL = 'AND ' . $whereSQL; |
|
| 202 | + $whereSQL = 'AND '.$whereSQL; |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | if ($databaseName) { |
| 206 | - $databaseName = $dbConnection->quote_string(\trim($databaseName)) . '.'; |
|
| 206 | + $databaseName = $dbConnection->quote_string(\trim($databaseName)).'.'; |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | // get the row |
| 210 | - $query = 'SELECT ' . $dbConnection->quote_string($searchFieldName) . ', ' . $dbConnection->quote_string($idFieldName) . ' |
|
| 211 | - FROM ' . $databaseName . $dbConnection->quote_string($table) . ' |
|
| 210 | + $query = 'SELECT '.$dbConnection->quote_string($searchFieldName).', '.$dbConnection->quote_string($idFieldName).' |
|
| 211 | + FROM ' . $databaseName.$dbConnection->quote_string($table).' |
|
| 212 | 212 | WHERE 1 = 1 |
| 213 | - ' . $whereSQL . ' |
|
| 213 | + ' . $whereSQL.' |
|
| 214 | 214 | '; |
| 215 | 215 | |
| 216 | 216 | if ($useCache) { |
| 217 | 217 | $cache = new Cache(null, null, false, $useCache); |
| 218 | - $cacheKey = 'sql-phonetic-search-' . \md5($query); |
|
| 218 | + $cacheKey = 'sql-phonetic-search-'.\md5($query); |
|
| 219 | 219 | |
| 220 | 220 | if ( |
| 221 | 221 | $cache->getCacheIsReady() |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | } |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | - return $MYSQL_CLIENT_VERSION_CACHE[$cacheKey] = (string) \mysqli_get_client_version($dbConnection->getLink()); |
|
| 293 | + return $MYSQL_CLIENT_VERSION_CACHE[$cacheKey] = (string)\mysqli_get_client_version($dbConnection->getLink()); |
|
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | /** |
@@ -318,11 +318,11 @@ discard block |
||
| 318 | 318 | if ($doctrineConnection) { |
| 319 | 319 | $doctrineWrappedConnection = $doctrineConnection->getWrappedConnection(); |
| 320 | 320 | if ($doctrineWrappedConnection instanceof \Doctrine\DBAL\Driver\PDOConnection) { |
| 321 | - return $MYSQL_SERVER_VERSION_CACHE[$cacheKey] = (string) $doctrineWrappedConnection->getServerVersion(); |
|
| 321 | + return $MYSQL_SERVER_VERSION_CACHE[$cacheKey] = (string)$doctrineWrappedConnection->getServerVersion(); |
|
| 322 | 322 | } |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | - return $MYSQL_SERVER_VERSION_CACHE[$cacheKey] = (string) \mysqli_get_server_version($dbConnection->getLink()); |
|
| 325 | + return $MYSQL_SERVER_VERSION_CACHE[$cacheKey] = (string)\mysqli_get_server_version($dbConnection->getLink()); |
|
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | /** |
@@ -363,10 +363,10 @@ discard block |
||
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | if ($databaseName) { |
| 366 | - $databaseName = $dbConnection->quote_string(\trim($databaseName)) . '.'; |
|
| 366 | + $databaseName = $dbConnection->quote_string(\trim($databaseName)).'.'; |
|
| 367 | 367 | } |
| 368 | 368 | |
| 369 | - $sql = 'SHOW COLUMNS FROM ' . $databaseName . $dbConnection->escape($table); |
|
| 369 | + $sql = 'SHOW COLUMNS FROM '.$databaseName.$dbConnection->escape($table); |
|
| 370 | 370 | $result = $dbConnection->query($sql); |
| 371 | 371 | |
| 372 | 372 | if ($result && $result->num_rows > 0) { |
@@ -412,17 +412,17 @@ discard block |
||
| 412 | 412 | |
| 413 | 413 | $whereSQL = $dbConnection->_parseArrayPair($whereArray, 'AND'); |
| 414 | 414 | if ($whereSQL) { |
| 415 | - $whereSQL = 'AND ' . $whereSQL; |
|
| 415 | + $whereSQL = 'AND '.$whereSQL; |
|
| 416 | 416 | } |
| 417 | 417 | |
| 418 | 418 | if ($databaseName) { |
| 419 | - $databaseName = $dbConnection->quote_string(\trim($databaseName)) . '.'; |
|
| 419 | + $databaseName = $dbConnection->quote_string(\trim($databaseName)).'.'; |
|
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | // get the row |
| 423 | - $query = 'SELECT * FROM ' . $databaseName . $dbConnection->quote_string($table) . ' |
|
| 423 | + $query = 'SELECT * FROM '.$databaseName.$dbConnection->quote_string($table).' |
|
| 424 | 424 | WHERE 1 = 1 |
| 425 | - ' . $whereSQL . ' |
|
| 425 | + ' . $whereSQL.' |
|
| 426 | 426 | '; |
| 427 | 427 | $result = $dbConnection->query($query); |
| 428 | 428 | |
@@ -441,11 +441,11 @@ discard block |
||
| 441 | 441 | foreach ($tmpArray as $fieldName => $value) { |
| 442 | 442 | if (!\in_array($fieldName, $ignoreArray, true)) { |
| 443 | 443 | if (\array_key_exists($fieldName, $updateArray)) { |
| 444 | - $insert_keys .= ',' . $fieldName; |
|
| 444 | + $insert_keys .= ','.$fieldName; |
|
| 445 | 445 | $insert_values .= ',?'; |
| 446 | 446 | $bindings[] = $updateArray[$fieldName]; // INFO: do not escape non selected data |
| 447 | 447 | } else { |
| 448 | - $insert_keys .= ',' . $fieldName; |
|
| 448 | + $insert_keys .= ','.$fieldName; |
|
| 449 | 449 | $insert_values .= ',?'; |
| 450 | 450 | $bindings[] = $value; // INFO: do not escape non selected data |
| 451 | 451 | } |
@@ -456,10 +456,10 @@ discard block |
||
| 456 | 456 | $insert_values = \ltrim($insert_values, ','); |
| 457 | 457 | |
| 458 | 458 | // insert the "copied" row |
| 459 | - $new_query = 'INSERT INTO ' . $databaseName . $dbConnection->quote_string($table) . ' |
|
| 460 | - (' . $insert_keys . ') |
|
| 459 | + $new_query = 'INSERT INTO '.$databaseName.$dbConnection->quote_string($table).' |
|
| 460 | + (' . $insert_keys.') |
|
| 461 | 461 | VALUES |
| 462 | - (' . $insert_values . ') |
|
| 462 | + (' . $insert_values.') |
|
| 463 | 463 | '; |
| 464 | 464 | |
| 465 | 465 | return $dbConnection->query($new_query, $bindings); |