@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | */ |
| 6 | 6 | require_once './src/lib.inc.php'; |
| 7 | 7 | |
| 8 | -$app->post('/redirect[/{subject}]', function ($request, $response, $args) { |
|
| 8 | +$app->post('/redirect[/{subject}]', function($request, $response, $args) { |
|
| 9 | 9 | $body = $response->getBody(); |
| 10 | 10 | $query_string = $request->getUri()->getQuery(); |
| 11 | 11 | $misc = $this->misc; |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | $loginShared = $request->getParsedBodyParam('loginShared'); |
| 14 | 14 | $loginServer = $request->getParsedBodyParam('loginServer'); |
| 15 | 15 | $loginUsername = $request->getParsedBodyParam('loginUsername'); |
| 16 | - $loginPassword = $request->getParsedBodyParam('loginPassword_'.md5($loginServer)); |
|
| 16 | + $loginPassword = $request->getParsedBodyParam('loginPassword_' . md5($loginServer)); |
|
| 17 | 17 | |
| 18 | 18 | // If login action is set, then set session variables |
| 19 | 19 | if (boolval($loginServer) && boolval($loginUsername) && $loginPassword !== null) { |
@@ -53,47 +53,47 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | }); |
| 55 | 55 | |
| 56 | -$app->get('/redirect[/{subject}]', function ($request, $response, $args) { |
|
| 56 | +$app->get('/redirect[/{subject}]', function($request, $response, $args) { |
|
| 57 | 57 | $subject = (isset($args['subject'])) ? $args['subject'] : 'root'; |
| 58 | 58 | $destinationurl = $this->utils->getDestinationWithLastTab($subject); |
| 59 | 59 | |
| 60 | 60 | return $response->withStatus(302)->withHeader('Location', $destinationurl); |
| 61 | 61 | }); |
| 62 | 62 | |
| 63 | -$app->get('/src/views/browser', function ($request, $response, $args) { |
|
| 63 | +$app->get('/src/views/browser', function($request, $response, $args) { |
|
| 64 | 64 | $controller = new \PHPPgAdmin\Controller\BrowserController($this, true); |
| 65 | 65 | |
| 66 | 66 | return $controller->render(); |
| 67 | 67 | }); |
| 68 | 68 | |
| 69 | -$app->get('/src/views/login', function ($request, $response, $args) { |
|
| 69 | +$app->get('/src/views/login', function($request, $response, $args) { |
|
| 70 | 70 | $controller = new \PHPPgAdmin\Controller\LoginController($this, true); |
| 71 | 71 | |
| 72 | 72 | return $controller->render(); |
| 73 | 73 | }); |
| 74 | 74 | |
| 75 | -$app->get('/src/views/servers', function ($request, $response, $args) { |
|
| 75 | +$app->get('/src/views/servers', function($request, $response, $args) { |
|
| 76 | 76 | $controller = new \PHPPgAdmin\Controller\ServersController($this, true); |
| 77 | 77 | |
| 78 | 78 | return $controller->render(); |
| 79 | 79 | }); |
| 80 | 80 | |
| 81 | -$app->get('/src/views/intro', function ($request, $response, $args) { |
|
| 81 | +$app->get('/src/views/intro', function($request, $response, $args) { |
|
| 82 | 82 | $controller = new \PHPPgAdmin\Controller\IntroController($this, true); |
| 83 | 83 | |
| 84 | 84 | return $controller->render(); |
| 85 | 85 | }); |
| 86 | 86 | |
| 87 | -$app->map(['GET', 'POST'], '/src/views/{subject}', function ($request, $response, $args) { |
|
| 87 | +$app->map(['GET', 'POST'], '/src/views/{subject}', function($request, $response, $args) { |
|
| 88 | 88 | $subject = $args['subject']; |
| 89 | 89 | |
| 90 | - $className = '\PHPPgAdmin\Controller\\'.ucfirst($subject).'Controller'; |
|
| 90 | + $className = '\PHPPgAdmin\Controller\\' . ucfirst($subject) . 'Controller'; |
|
| 91 | 91 | $controller = new $className($this); |
| 92 | 92 | |
| 93 | 93 | return $controller->render(); |
| 94 | 94 | }); |
| 95 | 95 | |
| 96 | -$app->get('/[{subject}]', function ($request, $response, $args) { |
|
| 96 | +$app->get('/[{subject}]', function($request, $response, $args) { |
|
| 97 | 97 | $subject = (isset($args['subject'])) ? $args['subject'] : 'intro'; |
| 98 | 98 | $_server_info = $this->misc->getServerInfo(); |
| 99 | 99 | $query_string = $request->getUri()->getQuery(); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | $viewVars = [ |
| 111 | - 'url' => '/src/views/'.$subject.($query_string ? '?'.$query_string : ''), |
|
| 111 | + 'url' => '/src/views/' . $subject . ($query_string ? '?' . $query_string : ''), |
|
| 112 | 112 | 'headertemplate' => 'header.twig', |
| 113 | 113 | ]; |
| 114 | 114 | |
@@ -3,10 +3,10 @@ |
||
| 3 | 3 | namespace PHPPgAdmin\Database; |
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | - * PostgreSQL 8.3 support. |
|
| 7 | - * |
|
| 8 | - * $Id: Postgres82.php,v 1.10 2007/12/28 16:21:25 ioguix Exp $ |
|
| 9 | - */ |
|
| 6 | + * PostgreSQL 8.3 support. |
|
| 7 | + * |
|
| 8 | + * $Id: Postgres82.php,v 1.10 2007/12/28 16:21:25 ioguix Exp $ |
|
| 9 | + */ |
|
| 10 | 10 | class Postgres83 extends Postgres84 |
| 11 | 11 | { |
| 12 | 12 | public $major_version = 8.3; |
@@ -322,7 +322,7 @@ |
||
| 322 | 322 | |
| 323 | 323 | // toggle cycle yes/no |
| 324 | 324 | if (!is_null($cycledvalue)) { |
| 325 | - $sql .= (!$cycledvalue ? ' NO ' : '').' CYCLE'; |
|
| 325 | + $sql .= (!$cycledvalue ? ' NO ' : '') . ' CYCLE'; |
|
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | if ($sql != '') { |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | // Ignore host if null |
| 37 | 37 | if ($host === null || $host == '') { |
| 38 | 38 | if ($port !== null && $port != '') { |
| 39 | - $pghost = ':'.$port; |
|
| 39 | + $pghost = ':' . $port; |
|
| 40 | 40 | } else { |
| 41 | 41 | $pghost = ''; |
| 42 | 42 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | // Add sslmode to $pghost as needed |
| 48 | 48 | if (($sslmode == 'disable') || ($sslmode == 'allow') || ($sslmode == 'prefer') || ($sslmode == 'require')) { |
| 49 | - $pghost .= ':'.$sslmode; |
|
| 49 | + $pghost .= ':' . $sslmode; |
|
| 50 | 50 | } elseif ($sslmode == 'legacy') { |
| 51 | 51 | $pghost .= ' requiressl=1'; |
| 52 | 52 | } |
@@ -3,10 +3,10 @@ |
||
| 3 | 3 | namespace PHPPgAdmin\Database; |
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | - * PostgreSQL 8.2 support. |
|
| 7 | - * |
|
| 8 | - * $Id: Postgres82.php,v 1.10 2007/12/28 16:21:25 ioguix Exp $ |
|
| 9 | - */ |
|
| 6 | + * PostgreSQL 8.2 support. |
|
| 7 | + * |
|
| 8 | + * $Id: Postgres82.php,v 1.10 2007/12/28 16:21:25 ioguix Exp $ |
|
| 9 | + */ |
|
| 10 | 10 | class Postgres82 extends Postgres83 |
| 11 | 11 | { |
| 12 | 12 | public $major_version = 8.2; |
@@ -251,13 +251,13 @@ |
||
| 251 | 251 | |
| 252 | 252 | if (is_array($definition)) { |
| 253 | 253 | $this->arrayClean($definition); |
| 254 | - $sql .= "'".$definition[0]."'"; |
|
| 254 | + $sql .= "'" . $definition[0] . "'"; |
|
| 255 | 255 | if ($definition[1]) { |
| 256 | - $sql .= ",'".$definition[1]."'"; |
|
| 256 | + $sql .= ",'" . $definition[1] . "'"; |
|
| 257 | 257 | } |
| 258 | 258 | } else { |
| 259 | 259 | $this->clean($definition); |
| 260 | - $sql .= "'".$definition."'"; |
|
| 260 | + $sql .= "'" . $definition . "'"; |
|
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | $sql .= " LANGUAGE \"{$language}\""; |
@@ -3,10 +3,10 @@ |
||
| 3 | 3 | namespace PHPPgAdmin\Database; |
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | - * PostgreSQL 8.1 support. |
|
| 7 | - * |
|
| 8 | - * $Id: Postgres81.php,v 1.21 2008/01/19 13:46:15 ioguix Exp $ |
|
| 9 | - */ |
|
| 6 | + * PostgreSQL 8.1 support. |
|
| 7 | + * |
|
| 8 | + * $Id: Postgres81.php,v 1.21 2008/01/19 13:46:15 ioguix Exp $ |
|
| 9 | + */ |
|
| 10 | 10 | class Postgres81 extends Postgres82 |
| 11 | 11 | { |
| 12 | 12 | public $major_version = 8.1; |
@@ -3,10 +3,10 @@ |
||
| 3 | 3 | namespace PHPPgAdmin\Database; |
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | - * PostgreSQL 8.0 support. |
|
| 7 | - * |
|
| 8 | - * $Id: Postgres80.php,v 1.28 2007/12/12 04:11:10 xzilla Exp $ |
|
| 9 | - */ |
|
| 6 | + * PostgreSQL 8.0 support. |
|
| 7 | + * |
|
| 8 | + * $Id: Postgres80.php,v 1.28 2007/12/12 04:11:10 xzilla Exp $ |
|
| 9 | + */ |
|
| 10 | 10 | class Postgres80 extends Postgres81 |
| 11 | 11 | { |
| 12 | 12 | public $major_version = 8.0; |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | $values = ") VALUES ('{$value}'"; |
| 236 | 236 | } |
| 237 | 237 | } |
| 238 | - $sql = $fields.$values.')'; |
|
| 238 | + $sql = $fields . $values . ')'; |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | // Check for failures |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | // Check for failures |
| 307 | - if (!$this->conn->Execute($setClause.$whereClause)) { |
|
| 307 | + if (!$this->conn->Execute($setClause . $whereClause)) { |
|
| 308 | 308 | // Check for unique constraint failure |
| 309 | 309 | if (stristr($this->conn->ErrorMsg(), 'unique')) { |
| 310 | 310 | return -1; |
@@ -269,13 +269,13 @@ discard block |
||
| 269 | 269 | if (is_array($this->help_page[$help])) { |
| 270 | 270 | $urls = []; |
| 271 | 271 | foreach ($this->help_page[$help] as $link) { |
| 272 | - $urls[] = $this->help_base.$link; |
|
| 272 | + $urls[] = $this->help_base . $link; |
|
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | return $urls; |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | - return $this->help_base.$this->help_page[$help]; |
|
| 278 | + return $this->help_base . $this->help_page[$help]; |
|
| 279 | 279 | } else { |
| 280 | 280 | return; |
| 281 | 281 | } |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | public function getHelpPages() |
| 289 | 289 | { |
| 290 | 290 | if ($this->help_page === null || $this->help_base === null) { |
| 291 | - $help_classname = '\PHPPgAdmin\Help\PostgresDoc'.str_replace('.', '', $this->major_version); |
|
| 291 | + $help_classname = '\PHPPgAdmin\Help\PostgresDoc' . str_replace('.', '', $this->major_version); |
|
| 292 | 292 | |
| 293 | 293 | $help_class = new $help_classname($this->conf, $this->major_version); |
| 294 | 294 | |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | // Determine actions string |
| 315 | 315 | $extra_str = ''; |
| 316 | 316 | foreach ($extras as $k => $v) { |
| 317 | - $extra_str .= " {$k}=\"".htmlspecialchars($v).'"'; |
|
| 317 | + $extra_str .= " {$k}=\"" . htmlspecialchars($v) . '"'; |
|
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | switch (substr($type, 0, 9)) { |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | |
| 445 | 445 | if (isset($server_info['hiddendbs']) && $server_info['hiddendbs']) { |
| 446 | 446 | $hiddendbs = $server_info['hiddendbs']; |
| 447 | - $not_in = "('".implode("','", $hiddendbs)."')"; |
|
| 447 | + $not_in = "('" . implode("','", $hiddendbs) . "')"; |
|
| 448 | 448 | $clause .= " AND pdb.datname NOT IN {$not_in} "; |
| 449 | 449 | } |
| 450 | 450 | |
@@ -1107,7 +1107,7 @@ discard block |
||
| 1107 | 1107 | } |
| 1108 | 1108 | $this->fieldArrayClean($temp); |
| 1109 | 1109 | |
| 1110 | - $sql = 'SET SEARCH_PATH TO "'.implode('","', $temp).'"'; |
|
| 1110 | + $sql = 'SET SEARCH_PATH TO "' . implode('","', $temp) . '"'; |
|
| 1111 | 1111 | |
| 1112 | 1112 | return $this->execute($sql); |
| 1113 | 1113 | } |
@@ -1408,7 +1408,7 @@ discard block |
||
| 1408 | 1408 | } |
| 1409 | 1409 | |
| 1410 | 1410 | // Output a reconnect command to create the table as the correct user |
| 1411 | - $sql = $this->getChangeUserSQL($t->fields['relowner'])."\n\n"; |
|
| 1411 | + $sql = $this->getChangeUserSQL($t->fields['relowner']) . "\n\n"; |
|
| 1412 | 1412 | |
| 1413 | 1413 | // Set schema search path |
| 1414 | 1414 | $sql .= "SET search_path = \"{$t->fields['nspname']}\", pg_catalog;\n\n"; |
@@ -1441,7 +1441,7 @@ discard block |
||
| 1441 | 1441 | $sql .= ' BIGSERIAL'; |
| 1442 | 1442 | } |
| 1443 | 1443 | } else { |
| 1444 | - $sql .= ' '.$this->formatType($atts->fields['type'], $atts->fields['atttypmod']); |
|
| 1444 | + $sql .= ' ' . $this->formatType($atts->fields['type'], $atts->fields['atttypmod']); |
|
| 1445 | 1445 | |
| 1446 | 1446 | // Add NOT NULL if necessary |
| 1447 | 1447 | if ($this->phpBool($atts->fields['attnotnull'])) { |
@@ -1481,11 +1481,11 @@ discard block |
||
| 1481 | 1481 | switch ($cons->fields['contype']) { |
| 1482 | 1482 | case 'p': |
| 1483 | 1483 | $keys = $this->getAttributeNames($table, explode(' ', $cons->fields['indkey'])); |
| 1484 | - $sql .= 'PRIMARY KEY ('.implode(',', $keys).')'; |
|
| 1484 | + $sql .= 'PRIMARY KEY (' . implode(',', $keys) . ')'; |
|
| 1485 | 1485 | break; |
| 1486 | 1486 | case 'u': |
| 1487 | 1487 | $keys = $this->getAttributeNames($table, explode(' ', $cons->fields['indkey'])); |
| 1488 | - $sql .= 'UNIQUE ('.implode(',', $keys).')'; |
|
| 1488 | + $sql .= 'UNIQUE (' . implode(',', $keys) . ')'; |
|
| 1489 | 1489 | break; |
| 1490 | 1490 | default: |
| 1491 | 1491 | // Unrecognised constraint |
@@ -1629,7 +1629,7 @@ discard block |
||
| 1629 | 1629 | } |
| 1630 | 1630 | |
| 1631 | 1631 | // Output privileges with no GRANT OPTION |
| 1632 | - $sql .= 'GRANT '.implode(', ', $nongrant)." ON TABLE \"{$t->fields['relname']}\" TO "; |
|
| 1632 | + $sql .= 'GRANT ' . implode(', ', $nongrant) . " ON TABLE \"{$t->fields['relname']}\" TO "; |
|
| 1633 | 1633 | switch ($v[0]) { |
| 1634 | 1634 | case 'public': |
| 1635 | 1635 | $sql .= "PUBLIC;\n"; |
@@ -1668,7 +1668,7 @@ discard block |
||
| 1668 | 1668 | $sql .= "SET SESSION AUTHORIZATION '{$grantor}';\n"; |
| 1669 | 1669 | } |
| 1670 | 1670 | |
| 1671 | - $sql .= 'GRANT '.implode(', ', $v[4])." ON \"{$t->fields['relname']}\" TO "; |
|
| 1671 | + $sql .= 'GRANT ' . implode(', ', $v[4]) . " ON \"{$t->fields['relname']}\" TO "; |
|
| 1672 | 1672 | switch ($v[0]) { |
| 1673 | 1673 | case 'public': |
| 1674 | 1674 | $sql .= 'PUBLIC'; |
@@ -1908,7 +1908,7 @@ discard block |
||
| 1908 | 1908 | } elseif ($typname == 'varchar') { |
| 1909 | 1909 | $temp = 'character varying'; |
| 1910 | 1910 | if ($typmod != -1) { |
| 1911 | - $temp .= '('.($typmod - $varhdrsz).')'; |
|
| 1911 | + $temp .= '(' . ($typmod - $varhdrsz) . ')'; |
|
| 1912 | 1912 | } |
| 1913 | 1913 | } elseif ($typname == 'numeric') { |
| 1914 | 1914 | $temp = 'numeric'; |
@@ -1959,7 +1959,7 @@ discard block |
||
| 1959 | 1959 | $sql = "SELECT attnum, attname FROM pg_catalog.pg_attribute WHERE |
| 1960 | 1960 | attrelid=(SELECT oid FROM pg_catalog.pg_class WHERE relname='{$table}' AND |
| 1961 | 1961 | relnamespace=(SELECT oid FROM pg_catalog.pg_namespace WHERE nspname='{$c_schema}')) |
| 1962 | - AND attnum IN ('".implode("','", $atts)."')"; |
|
| 1962 | + AND attnum IN ('" . implode("','", $atts) . "')"; |
|
| 1963 | 1963 | |
| 1964 | 1964 | $rs = $this->selectSet($sql); |
| 1965 | 1965 | if ($rs->recordCount() != count($atts)) { |
@@ -2261,7 +2261,7 @@ discard block |
||
| 2261 | 2261 | if ($indexes->recordCount() > 0) { |
| 2262 | 2262 | $sql .= "\n-- Indexes\n\n"; |
| 2263 | 2263 | while (!$indexes->EOF) { |
| 2264 | - $sql .= $indexes->fields['inddef'].";\n"; |
|
| 2264 | + $sql .= $indexes->fields['inddef'] . ";\n"; |
|
| 2265 | 2265 | |
| 2266 | 2266 | $indexes->moveNext(); |
| 2267 | 2267 | } |
@@ -2296,7 +2296,7 @@ discard block |
||
| 2296 | 2296 | if ($rules->recordCount() > 0) { |
| 2297 | 2297 | $sql .= "\n-- Rules\n\n"; |
| 2298 | 2298 | while (!$rules->EOF) { |
| 2299 | - $sql .= $rules->fields['definition']."\n"; |
|
| 2299 | + $sql .= $rules->fields['definition'] . "\n"; |
|
| 2300 | 2300 | |
| 2301 | 2301 | $rules->moveNext(); |
| 2302 | 2302 | } |
@@ -2524,7 +2524,7 @@ discard block |
||
| 2524 | 2524 | } |
| 2525 | 2525 | } |
| 2526 | 2526 | if (count($primarykeycolumns) > 0) { |
| 2527 | - $sql .= ', PRIMARY KEY ('.implode(', ', $primarykeycolumns).')'; |
|
| 2527 | + $sql .= ', PRIMARY KEY (' . implode(', ', $primarykeycolumns) . ')'; |
|
| 2528 | 2528 | } |
| 2529 | 2529 | |
| 2530 | 2530 | $sql .= ')'; |
@@ -2945,7 +2945,7 @@ discard block |
||
| 2945 | 2945 | |
| 2946 | 2946 | // DEFAULT clause |
| 2947 | 2947 | if ($default != '') { |
| 2948 | - $sql .= ' DEFAULT '.$default; |
|
| 2948 | + $sql .= ' DEFAULT ' . $default; |
|
| 2949 | 2949 | } |
| 2950 | 2950 | } |
| 2951 | 2951 | |
@@ -3038,7 +3038,7 @@ discard block |
||
| 3038 | 3038 | $toAlter = []; |
| 3039 | 3039 | // Create the command for changing nullability |
| 3040 | 3040 | if ($notnull != $oldnotnull) { |
| 3041 | - $toAlter[] = "ALTER COLUMN \"{$name}\" ".($notnull ? 'SET' : 'DROP').' NOT NULL'; |
|
| 3041 | + $toAlter[] = "ALTER COLUMN \"{$name}\" " . ($notnull ? 'SET' : 'DROP') . ' NOT NULL'; |
|
| 3042 | 3042 | } |
| 3043 | 3043 | |
| 3044 | 3044 | // Add default, if it has changed |
@@ -3165,7 +3165,7 @@ discard block |
||
| 3165 | 3165 | $this->fieldClean($table); |
| 3166 | 3166 | $this->fieldClean($column); |
| 3167 | 3167 | |
| 3168 | - $sql = "ALTER TABLE \"{$f_schema}\".\"{$table}\" ALTER COLUMN \"{$column}\" ".($state ? 'DROP' : 'SET').' NOT NULL'; |
|
| 3168 | + $sql = "ALTER TABLE \"{$f_schema}\".\"{$table}\" ALTER COLUMN \"{$column}\" " . ($state ? 'DROP' : 'SET') . ' NOT NULL'; |
|
| 3169 | 3169 | |
| 3170 | 3170 | return $this->execute($sql); |
| 3171 | 3171 | } |
@@ -3284,7 +3284,7 @@ discard block |
||
| 3284 | 3284 | |
| 3285 | 3285 | // Actually retrieve the rows |
| 3286 | 3286 | if ($oids) { |
| 3287 | - $oid_str = $this->id.', '; |
|
| 3287 | + $oid_str = $this->id . ', '; |
|
| 3288 | 3288 | } else { |
| 3289 | 3289 | $oid_str = ''; |
| 3290 | 3290 | } |
@@ -3446,12 +3446,12 @@ discard block |
||
| 3446 | 3446 | if (isset($nulls[$i])) { |
| 3447 | 3447 | $sql .= ',NULL'; |
| 3448 | 3448 | } else { |
| 3449 | - $sql .= ','.$this->formatValue($types[$i], $format[$i], $value); |
|
| 3449 | + $sql .= ',' . $this->formatValue($types[$i], $format[$i], $value); |
|
| 3450 | 3450 | } |
| 3451 | 3451 | } |
| 3452 | 3452 | |
| 3453 | - $sql = "INSERT INTO \"{$f_schema}\".\"{$table}\" (\"".implode('","', $fields).'") |
|
| 3454 | - VALUES ('.substr($sql, 1).')'; |
|
| 3453 | + $sql = "INSERT INTO \"{$f_schema}\".\"{$table}\" (\"" . implode('","', $fields) . '") |
|
| 3454 | + VALUES ('.substr($sql, 1) . ')'; |
|
| 3455 | 3455 | |
| 3456 | 3456 | return $this->execute($sql); |
| 3457 | 3457 | } |
@@ -4067,7 +4067,7 @@ discard block |
||
| 4067 | 4067 | |
| 4068 | 4068 | // toggle cycle yes/no |
| 4069 | 4069 | if (!is_null($cycledvalue)) { |
| 4070 | - $sql .= (!$cycledvalue ? ' NO ' : '').' CYCLE'; |
|
| 4070 | + $sql .= (!$cycledvalue ? ' NO ' : '') . ' CYCLE'; |
|
| 4071 | 4071 | } |
| 4072 | 4072 | |
| 4073 | 4073 | if ($sql != '') { |
@@ -4529,9 +4529,9 @@ discard block |
||
| 4529 | 4529 | |
| 4530 | 4530 | if (is_array($columns)) { |
| 4531 | 4531 | $this->arrayClean($columns); |
| 4532 | - $sql .= '("'.implode('","', $columns).'")'; |
|
| 4532 | + $sql .= '("' . implode('","', $columns) . '")'; |
|
| 4533 | 4533 | } else { |
| 4534 | - $sql .= '('.$columns.')'; |
|
| 4534 | + $sql .= '(' . $columns . ')'; |
|
| 4535 | 4535 | } |
| 4536 | 4536 | |
| 4537 | 4537 | // Tablespace |
@@ -4731,7 +4731,7 @@ discard block |
||
| 4731 | 4731 | $sql .= "CONSTRAINT \"{$name}\" "; |
| 4732 | 4732 | } |
| 4733 | 4733 | |
| 4734 | - $sql .= 'PRIMARY KEY ("'.implode('","', $fields).'")'; |
|
| 4734 | + $sql .= 'PRIMARY KEY ("' . implode('","', $fields) . '")'; |
|
| 4735 | 4735 | |
| 4736 | 4736 | if ($tablespace != '' && $this->hasTablespaces()) { |
| 4737 | 4737 | $sql .= " USING INDEX TABLESPACE \"{$tablespace}\""; |
@@ -4768,7 +4768,7 @@ discard block |
||
| 4768 | 4768 | $sql .= "CONSTRAINT \"{$name}\" "; |
| 4769 | 4769 | } |
| 4770 | 4770 | |
| 4771 | - $sql .= 'UNIQUE ("'.implode('","', $fields).'")'; |
|
| 4771 | + $sql .= 'UNIQUE ("' . implode('","', $fields) . '")'; |
|
| 4772 | 4772 | |
| 4773 | 4773 | if ($tablespace != '' && $this->hasTablespaces()) { |
| 4774 | 4774 | $sql .= " USING INDEX TABLESPACE \"{$tablespace}\""; |
@@ -4920,9 +4920,9 @@ discard block |
||
| 4920 | 4920 | $sql .= "CONSTRAINT \"{$name}\" "; |
| 4921 | 4921 | } |
| 4922 | 4922 | |
| 4923 | - $sql .= 'FOREIGN KEY ("'.implode('","', $sfields).'") '; |
|
| 4923 | + $sql .= 'FOREIGN KEY ("' . implode('","', $sfields) . '") '; |
|
| 4924 | 4924 | // Target table needs to be fully qualified |
| 4925 | - $sql .= "REFERENCES \"{$targschema}\".\"{$targtable}\"(\"".implode('","', $tfields).'") '; |
|
| 4925 | + $sql .= "REFERENCES \"{$targschema}\".\"{$targtable}\"(\"" . implode('","', $tfields) . '") '; |
|
| 4926 | 4926 | if ($match != $this->fkmatches[0]) { |
| 4927 | 4927 | $sql .= " {$match}"; |
| 4928 | 4928 | } |
@@ -5611,13 +5611,13 @@ discard block |
||
| 5611 | 5611 | |
| 5612 | 5612 | if (is_array($definition)) { |
| 5613 | 5613 | $this->arrayClean($definition); |
| 5614 | - $sql .= "'".$definition[0]."'"; |
|
| 5614 | + $sql .= "'" . $definition[0] . "'"; |
|
| 5615 | 5615 | if ($definition[1]) { |
| 5616 | - $sql .= ",'".$definition[1]."'"; |
|
| 5616 | + $sql .= ",'" . $definition[1] . "'"; |
|
| 5617 | 5617 | } |
| 5618 | 5618 | } else { |
| 5619 | 5619 | $this->clean($definition); |
| 5620 | - $sql .= "'".$definition."'"; |
|
| 5620 | + $sql .= "'" . $definition . "'"; |
|
| 5621 | 5621 | } |
| 5622 | 5622 | |
| 5623 | 5623 | $sql .= " LANGUAGE \"{$language}\""; |
@@ -6393,7 +6393,7 @@ discard block |
||
| 6393 | 6393 | // Split on escaped null characters |
| 6394 | 6394 | $params = explode('\\000', $v); |
| 6395 | 6395 | for ($findx = 0; $findx < $trigger['tgnargs']; $findx++) { |
| 6396 | - $param = "'".str_replace('\'', '\\\'', $params[$findx])."'"; |
|
| 6396 | + $param = "'" . str_replace('\'', '\\\'', $params[$findx]) . "'"; |
|
| 6397 | 6397 | $tgdef .= $param; |
| 6398 | 6398 | if ($findx < ($trigger['tgnargs'] - 1)) { |
| 6399 | 6399 | $tgdef .= ', '; |
@@ -6625,13 +6625,13 @@ discard block |
||
| 6625 | 6625 | $sql = "DROP OPERATOR \"{$f_schema}\".{$opr->fields['oprname']} ("; |
| 6626 | 6626 | // Quoting or formatting here??? |
| 6627 | 6627 | if ($opr->fields['oprleftname'] !== null) { |
| 6628 | - $sql .= $opr->fields['oprleftname'].', '; |
|
| 6628 | + $sql .= $opr->fields['oprleftname'] . ', '; |
|
| 6629 | 6629 | } else { |
| 6630 | 6630 | $sql .= 'NONE, '; |
| 6631 | 6631 | } |
| 6632 | 6632 | |
| 6633 | 6633 | if ($opr->fields['oprrightname'] !== null) { |
| 6634 | - $sql .= $opr->fields['oprrightname'].')'; |
|
| 6634 | + $sql .= $opr->fields['oprrightname'] . ')'; |
|
| 6635 | 6635 | } else { |
| 6636 | 6636 | $sql .= 'NONE)'; |
| 6637 | 6637 | } |
@@ -7459,11 +7459,11 @@ discard block |
||
| 7459 | 7459 | FROM pg_catalog.pg_proc p, pg_catalog.pg_namespace n, pg_catalog.pg_user u, pg_catalog.pg_aggregate a |
| 7460 | 7460 | WHERE n.oid = p.pronamespace AND p.proowner=u.usesysid AND p.oid=a.aggfnoid |
| 7461 | 7461 | AND p.proisagg AND n.nspname='{$c_schema}' |
| 7462 | - AND p.proname='".$name."' |
|
| 7462 | + AND p.proname='" . $name . "' |
|
| 7463 | 7463 | AND CASE p.proargtypes[0] |
| 7464 | 7464 | WHEN 'pg_catalog.\"any\"'::pg_catalog.regtype THEN '' |
| 7465 | 7465 | ELSE pg_catalog.format_type(p.proargtypes[0], NULL) |
| 7466 | - END ='".$basetype."'"; |
|
| 7466 | + END ='".$basetype . "'"; |
|
| 7467 | 7467 | |
| 7468 | 7468 | return $this->selectSet($sql); |
| 7469 | 7469 | } |
@@ -7620,7 +7620,7 @@ discard block |
||
| 7620 | 7620 | public function renameAggregate($aggrschema, $aggrname, $aggrtype, $newaggrname) |
| 7621 | 7621 | { |
| 7622 | 7622 | /* this function is called from alterAggregate where params are cleaned */ |
| 7623 | - $sql = "ALTER AGGREGATE \"{$aggrschema}\"".'.'."\"{$aggrname}\" (\"{$aggrtype}\") RENAME TO \"{$newaggrname}\""; |
|
| 7623 | + $sql = "ALTER AGGREGATE \"{$aggrschema}\"" . '.' . "\"{$aggrname}\" (\"{$aggrtype}\") RENAME TO \"{$newaggrname}\""; |
|
| 7624 | 7624 | |
| 7625 | 7625 | return $this->execute($sql); |
| 7626 | 7626 | } |
@@ -7762,15 +7762,15 @@ discard block |
||
| 7762 | 7762 | } |
| 7763 | 7763 | |
| 7764 | 7764 | if (is_array($memberof) && count($memberof) > 0) { |
| 7765 | - $sql .= ' IN ROLE "'.implode('", "', $memberof).'"'; |
|
| 7765 | + $sql .= ' IN ROLE "' . implode('", "', $memberof) . '"'; |
|
| 7766 | 7766 | } |
| 7767 | 7767 | |
| 7768 | 7768 | if (is_array($members) && count($members) > 0) { |
| 7769 | - $sql .= ' ROLE "'.implode('", "', $members).'"'; |
|
| 7769 | + $sql .= ' ROLE "' . implode('", "', $members) . '"'; |
|
| 7770 | 7770 | } |
| 7771 | 7771 | |
| 7772 | 7772 | if (is_array($adminmembers) && count($adminmembers) > 0) { |
| 7773 | - $sql .= ' ADMIN "'.implode('", "', $adminmembers).'"'; |
|
| 7773 | + $sql .= ' ADMIN "' . implode('", "', $adminmembers) . '"'; |
|
| 7774 | 7774 | } |
| 7775 | 7775 | |
| 7776 | 7776 | return $this->execute($sql); |
@@ -7786,7 +7786,7 @@ discard block |
||
| 7786 | 7786 | */ |
| 7787 | 7787 | public function _encryptPassword($username, $password) |
| 7788 | 7788 | { |
| 7789 | - return 'md5'.md5($password.$username); |
|
| 7789 | + return 'md5' . md5($password . $username); |
|
| 7790 | 7790 | } |
| 7791 | 7791 | |
| 7792 | 7792 | /** |
@@ -8108,7 +8108,7 @@ discard block |
||
| 8108 | 8108 | $sql .= $createdb ? ' CREATEDB' : ' NOCREATEDB'; |
| 8109 | 8109 | $sql .= $createuser ? ' CREATEUSER' : ' NOCREATEUSER'; |
| 8110 | 8110 | if (is_array($groups) && count($groups) > 0) { |
| 8111 | - $sql .= ' IN GROUP "'.implode('", "', $groups).'"'; |
|
| 8111 | + $sql .= ' IN GROUP "' . implode('", "', $groups) . '"'; |
|
| 8112 | 8112 | } |
| 8113 | 8113 | |
| 8114 | 8114 | if ($expiry != '') { |
@@ -8377,7 +8377,7 @@ discard block |
||
| 8377 | 8377 | |
| 8378 | 8378 | if (is_array($users) && count($users) > 0) { |
| 8379 | 8379 | $this->fieldArrayClean($users); |
| 8380 | - $sql .= ' WITH USER "'.implode('", "', $users).'"'; |
|
| 8380 | + $sql .= ' WITH USER "' . implode('", "', $users) . '"'; |
|
| 8381 | 8381 | } |
| 8382 | 8382 | |
| 8383 | 8383 | return $this->execute($sql); |
@@ -8458,9 +8458,9 @@ discard block |
||
| 8458 | 8458 | } else { |
| 8459 | 8459 | if ($type == 'column') { |
| 8460 | 8460 | $this->fieldClean($object); |
| 8461 | - $sql .= ' '.implode(" (\"{$object}\"), ", $privileges); |
|
| 8461 | + $sql .= ' ' . implode(" (\"{$object}\"), ", $privileges); |
|
| 8462 | 8462 | } else { |
| 8463 | - $sql .= ' '.implode(', ', $privileges); |
|
| 8463 | + $sql .= ' ' . implode(', ', $privileges); |
|
| 8464 | 8464 | } |
| 8465 | 8465 | } |
| 8466 | 8466 | |
@@ -8840,7 +8840,7 @@ discard block |
||
| 8840 | 8840 | $params[] = "autovacuum_vacuum_cost_limit='{$vaccostlimit}'"; |
| 8841 | 8841 | } |
| 8842 | 8842 | |
| 8843 | - $sql = $sql.implode(',', $params).');'; |
|
| 8843 | + $sql = $sql . implode(',', $params) . ');'; |
|
| 8844 | 8844 | |
| 8845 | 8845 | return $this->execute($sql); |
| 8846 | 8846 | } |
@@ -9361,7 +9361,7 @@ discard block |
||
| 9361 | 9361 | } |
| 9362 | 9362 | |
| 9363 | 9363 | // Actually retrieve the rows, with offset and limit |
| 9364 | - $rs = $this->selectSet("SELECT * FROM ({$query}) AS sub {$orderby} LIMIT {$page_size} OFFSET ".($page - 1) * $page_size); |
|
| 9364 | + $rs = $this->selectSet("SELECT * FROM ({$query}) AS sub {$orderby} LIMIT {$page_size} OFFSET " . ($page - 1) * $page_size); |
|
| 9365 | 9365 | $status = $this->endTransaction(); |
| 9366 | 9366 | if ($status != 0) { |
| 9367 | 9367 | $this->rollbackTransaction(); |
@@ -9403,7 +9403,7 @@ discard block |
||
| 9403 | 9403 | $sql = 'SELECT "'; |
| 9404 | 9404 | } |
| 9405 | 9405 | |
| 9406 | - $sql .= implode('","', $show).'" FROM '; |
|
| 9406 | + $sql .= implode('","', $show) . '" FROM '; |
|
| 9407 | 9407 | } |
| 9408 | 9408 | |
| 9409 | 9409 | $this->fieldClean($table); |
@@ -9467,7 +9467,7 @@ discard block |
||
| 9467 | 9467 | $sql .= $k; |
| 9468 | 9468 | } else { |
| 9469 | 9469 | $this->fieldClean($k); |
| 9470 | - $sql .= '"'.$k.'"'; |
|
| 9470 | + $sql .= '"' . $k . '"'; |
|
| 9471 | 9471 | } |
| 9472 | 9472 | if (strtoupper($v) == 'DESC') { |
| 9473 | 9473 | $sql .= ' DESC'; |
@@ -3,11 +3,11 @@ |
||
| 3 | 3 | namespace PHPPgAdmin\Database; |
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | - * A class that implements the DB interface for Postgres |
|
| 7 | - * Note: This class uses ADODB and returns RecordSets. |
|
| 8 | - * |
|
| 9 | - * $Id: Postgres74.php,v 1.72 2008/02/20 21:06:18 ioguix Exp $ |
|
| 10 | - */ |
|
| 6 | + * A class that implements the DB interface for Postgres |
|
| 7 | + * Note: This class uses ADODB and returns RecordSets. |
|
| 8 | + * |
|
| 9 | + * $Id: Postgres74.php,v 1.72 2008/02/20 21:06:18 ioguix Exp $ |
|
| 10 | + */ |
|
| 11 | 11 | class Postgres74 extends Postgres80 |
| 12 | 12 | { |
| 13 | 13 | public $major_version = 7.4; |