Fix MaxDbList

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
Kamil Tekiela 2026-02-19 21:27:57 +00:00
parent aa1dd0d5ce
commit 0341f9dc23
7 changed files with 8 additions and 18 deletions

View File

@ -14574,12 +14574,6 @@ parameters:
count: 1
path: tests/unit/Controllers/Operations/TableControllerTest.php
-
message: '#^Property PhpMyAdmin\\Config\:\:\$settings \(array\{PmaAbsoluteUri\: string, AuthLog\: string, AuthLogSuccess\: bool, PmaNoRelation_DisableWarning\: bool, SuhosinDisableWarning\: bool, LoginCookieValidityDisableWarning\: bool, ReservedWordDisableWarning\: bool, TranslationWarningThreshold\: int, \.\.\.\}\) does not accept array\{PmaAbsoluteUri\: string, AuthLog\: string, AuthLogSuccess\: bool, PmaNoRelation_DisableWarning\: bool, SuhosinDisableWarning\: bool, LoginCookieValidityDisableWarning\: bool, ReservedWordDisableWarning\: bool, TranslationWarningThreshold\: int, \.\.\.\}\.$#'
identifier: assign.propertyType
count: 1
path: tests/unit/Controllers/Operations/TableControllerTest.php
-
message: '''
#^Call to deprecated method getInstance\(\) of class PhpMyAdmin\\Config\:

View File

@ -9372,9 +9372,6 @@
<DeprecatedMethod>
<code><![CDATA[Config::getInstance()]]></code>
</DeprecatedMethod>
<InvalidPropertyAssignmentValue>
<code><![CDATA[$config->settings]]></code>
</InvalidPropertyAssignmentValue>
</file>
<file src="tests/unit/Controllers/PhpInfoControllerTest.php">
<DeprecatedMethod>

View File

@ -443,7 +443,7 @@ final readonly class TableController implements InvocableController
$databaseList = [];
$listDatabase = $this->dbi->getDatabaseList();
if (count($listDatabase) <= $this->config->settings['MaxDbList']) {
if (count($listDatabase) <= $this->config->config->MaxDbList) {
$databaseList = $listDatabase->getList();
}

View File

@ -171,7 +171,7 @@ final class DatabasesController implements InvocableController
'database_count' => $this->databaseCount,
'pos' => $position,
'url_params' => $urlParams,
'max_db_list' => $this->config->settings['MaxDbList'],
'max_db_list' => $this->config->config->MaxDbList,
'has_primary_replication' => $primaryInfo['status'],
'has_replica_replication' => $replicaInfo['status'],
'is_drop_allowed' => $this->dbi->isSuperUser() || $this->config->settings['AllowUserDropDatabase'],

View File

@ -646,7 +646,7 @@ class DatabaseInterface
$sortOrder = strtoupper($sortOrder);
if ($limitCount === true) {
$limitCount = $this->config->settings['MaxDbList'];
$limitCount = $this->config->config->MaxDbList;
}
$applyLimitAndOrderManual = true;

View File

@ -384,9 +384,9 @@ class FormDisplayTest extends AbstractTestCase
$config = Config::getInstance();
$config->setSetup(false);
$config->settings['MaxDbList'] = 10;
$config->settings['MaxTableList'] = 10;
$config->settings['QueryHistoryMax'] = 10;
$config->set('MaxDbList', 10);
$config->set('MaxTableList', 10);
$config->set('QueryHistoryMax', 10);
$method->invokeArgs(
$this->object,

View File

@ -45,12 +45,11 @@ class TableControllerTest extends AbstractTestCase
Current::$table = 'test_table';
$config = Config::getInstance();
$config->selectServer('1');
$config->settings['MaxDbList'] = 0;
$config->set('MaxDbList', 1);
$this->dummyDbi->addResult(
'SELECT `SCHEMA_NAME` FROM `INFORMATION_SCHEMA`.`SCHEMATA`',
[['test_db']],
[['test_db'], ['information_schema']],
['SCHEMA_NAME'],
);
$this->dummyDbi->addSelectDb('test_db');