66
77use PhpMyAdmin \ConfigStorage \Features \PdfFeature ;
88use PhpMyAdmin \DatabaseInterface ;
9+ use PhpMyAdmin \Dbal \Connection ;
910use PhpMyAdmin \Dbal \DatabaseName ;
1011use PhpMyAdmin \Dbal \TableName ;
1112use PhpMyAdmin \InternalRelations ;
@@ -268,7 +269,7 @@ private function checkRelationsParam(): array
268269 if (
269270 $ GLOBALS ['server ' ] == 0
270271 || empty ($ GLOBALS ['cfg ' ]['Server ' ]['pmadb ' ])
271- || ! $ this ->dbi ->selectDb ($ GLOBALS ['cfg ' ]['Server ' ]['pmadb ' ], DatabaseInterface:: CONNECT_CONTROL )
272+ || ! $ this ->dbi ->selectDb ($ GLOBALS ['cfg ' ]['Server ' ]['pmadb ' ], Connection:: TYPE_CONTROL )
272273 ) {
273274 // No server selected -> no bookmark table
274275 // we return the array with the falses in it,
@@ -387,16 +388,16 @@ public function tryUpgradeTransformations(): bool
387388 ],
388389 (string ) $ query
389390 );
390- $ this ->dbi ->tryMultiQuery ($ query , DatabaseInterface:: CONNECT_CONTROL );
391+ $ this ->dbi ->tryMultiQuery ($ query , Connection:: TYPE_CONTROL );
391392 // skips result sets of query as we are not interested in it
392393 do {
393394 $ hasResult = (
394- $ this ->dbi ->moreResults (DatabaseInterface:: CONNECT_CONTROL )
395- && $ this ->dbi ->nextResult (DatabaseInterface:: CONNECT_CONTROL )
395+ $ this ->dbi ->moreResults (Connection:: TYPE_CONTROL )
396+ && $ this ->dbi ->nextResult (Connection:: TYPE_CONTROL )
396397 );
397398 } while ($ hasResult );
398399
399- $ error = $ this ->dbi ->getError (DatabaseInterface:: CONNECT_CONTROL );
400+ $ error = $ this ->dbi ->getError (Connection:: TYPE_CONTROL );
400401
401402 // return true if no error exists otherwise false
402403 return empty ($ error );
@@ -434,7 +435,7 @@ public function getForeigners($db, $table, $column = '', $source = 'both')
434435 $ rel_query .= ' AND `master_field` = ' . $ this ->dbi ->quoteString ($ column );
435436 }
436437
437- $ foreign = $ this ->dbi ->fetchResult ($ rel_query , 'master_field ' , null , DatabaseInterface:: CONNECT_CONTROL );
438+ $ foreign = $ this ->dbi ->fetchResult ($ rel_query , 'master_field ' , null , Connection:: TYPE_CONTROL );
438439 }
439440
440441 if (($ source === 'both ' || $ source === 'foreign ' ) && strlen ($ table ) > 0 ) {
@@ -505,7 +506,7 @@ public function getDisplayField($db, $table)
505506 $ row = $ this ->dbi ->fetchSingleRow (
506507 $ disp_query ,
507508 DatabaseInterface::FETCH_ASSOC ,
508- DatabaseInterface:: CONNECT_CONTROL
509+ Connection:: TYPE_CONTROL
509510 );
510511 if (isset ($ row ['display_field ' ])) {
511512 return $ row ['display_field ' ];
@@ -751,7 +752,7 @@ public function getHistory($username)
751752 WHERE `username` = ' . $ this ->dbi ->quoteString ($ username ) . '
752753 ORDER BY `id` DESC ' ;
753754
754- return $ this ->dbi ->fetchResult ($ hist_query , null , null , DatabaseInterface:: CONNECT_CONTROL );
755+ return $ this ->dbi ->fetchResult ($ hist_query , null , null , Connection:: TYPE_CONTROL );
755756 }
756757
757758 /**
@@ -777,7 +778,7 @@ public function purgeHistory($username): void
777778 ORDER BY `timevalue` DESC
778779 LIMIT ' . $ GLOBALS ['cfg ' ]['QueryHistoryMax ' ] . ', 1 ' ;
779780
780- $ max_time = $ this ->dbi ->fetchValue ($ search_query , 0 , DatabaseInterface:: CONNECT_CONTROL );
781+ $ max_time = $ this ->dbi ->fetchValue ($ search_query , 0 , Connection:: TYPE_CONTROL );
781782
782783 if (! $ max_time ) {
783784 return ;
@@ -1346,7 +1347,7 @@ public function createPage(?string $newpage, PdfFeature $pdfFeature, $db): int
13461347 . $ this ->dbi ->quoteString ($ newpage ?: __ ('no description ' )) . ') ' ;
13471348 $ this ->dbi ->tryQueryAsControlUser ($ ins_query );
13481349
1349- return $ this ->dbi ->insertId (DatabaseInterface:: CONNECT_CONTROL );
1350+ return $ this ->dbi ->insertId (Connection:: TYPE_CONTROL );
13501351 }
13511352
13521353 /**
@@ -1526,10 +1527,10 @@ public function createPmaDatabase(string $configurationStorageDbName): bool
15261527 {
15271528 $ this ->dbi ->tryQuery (
15281529 'CREATE DATABASE IF NOT EXISTS ' . Util::backquote ($ configurationStorageDbName ),
1529- DatabaseInterface:: CONNECT_CONTROL
1530+ Connection:: TYPE_CONTROL
15301531 );
15311532
1532- $ error = $ this ->dbi ->getError (DatabaseInterface:: CONNECT_CONTROL );
1533+ $ error = $ this ->dbi ->getError (Connection:: TYPE_CONTROL );
15331534 if (! $ error ) {
15341535 // Re-build the cache to show the list of tables created or not
15351536 // This is the case when the DB could be created but no tables just after
@@ -1586,7 +1587,7 @@ public function fixPmaTables($db, $create = true): void
15861587 'pma__export_templates ' => 'export_templates ' ,
15871588 ];
15881589
1589- $ existingTables = $ this ->dbi ->getTables ($ db , DatabaseInterface:: CONNECT_CONTROL );
1590+ $ existingTables = $ this ->dbi ->getTables ($ db , Connection:: TYPE_CONTROL );
15901591
15911592 /** @var array<string, string> $tableNameReplacements */
15921593 $ tableNameReplacements = [];
@@ -1617,16 +1618,16 @@ public function fixPmaTables($db, $create = true): void
16171618 if ($ create ) {
16181619 if ($ createQueries == null ) { // first create
16191620 $ createQueries = $ this ->getDefaultPmaTableNames ($ tableNameReplacements );
1620- if (! $ this ->dbi ->selectDb ($ db , DatabaseInterface:: CONNECT_CONTROL )) {
1621- $ GLOBALS ['message ' ] = $ this ->dbi ->getError (DatabaseInterface:: CONNECT_CONTROL );
1621+ if (! $ this ->dbi ->selectDb ($ db , Connection:: TYPE_CONTROL )) {
1622+ $ GLOBALS ['message ' ] = $ this ->dbi ->getError (Connection:: TYPE_CONTROL );
16221623
16231624 return ;
16241625 }
16251626 }
16261627
1627- $ this ->dbi ->tryQuery ($ createQueries [$ table ], DatabaseInterface:: CONNECT_CONTROL );
1628+ $ this ->dbi ->tryQuery ($ createQueries [$ table ], Connection:: TYPE_CONTROL );
16281629
1629- $ error = $ this ->dbi ->getError (DatabaseInterface:: CONNECT_CONTROL );
1630+ $ error = $ this ->dbi ->getError (Connection:: TYPE_CONTROL );
16301631 if ($ error ) {
16311632 $ GLOBALS ['message ' ] = $ error ;
16321633
0 commit comments