|
14 | 14 |
|
15 | 15 | namespace PhpMyAdmin\Config; |
16 | 16 |
|
| 17 | +use PhpMyAdmin\Config; |
17 | 18 | use PhpMyAdmin\Config\Forms\User\UserFormList; |
18 | 19 | use PhpMyAdmin\Html\MySQLDocumentation; |
19 | 20 | use PhpMyAdmin\Sanitize; |
@@ -99,7 +100,7 @@ class FormDisplay |
99 | 100 |
|
100 | 101 | public function __construct(private ConfigFile $configFile) |
101 | 102 | { |
102 | | - $this->formDisplayTemplate = new FormDisplayTemplate($GLOBALS['config']); |
| 103 | + $this->formDisplayTemplate = new FormDisplayTemplate(Config::getInstance()); |
103 | 104 | $this->isSetupScript = Sanitize::isSetup(); |
104 | 105 | // initialize validators |
105 | 106 | Validator::getValidators($this->configFile); |
@@ -542,7 +543,7 @@ public function save(array $forms, bool $allowPartialSave = true): bool |
542 | 543 | $result = true; |
543 | 544 | $values = []; |
544 | 545 | $toSave = []; |
545 | | - $isSetupScript = $GLOBALS['config']->get('is_setup'); |
| 546 | + $isSetupScript = Config::getInstance()->get('is_setup'); |
546 | 547 | if ($isSetupScript) { |
547 | 548 | $this->loadUserprefsInfo(); |
548 | 549 | } |
@@ -744,7 +745,7 @@ private function loadUserprefsInfo(): void |
744 | 745 |
|
745 | 746 | $this->userprefsKeys = array_flip(UserFormList::getFields()); |
746 | 747 | // read real config for user preferences display |
747 | | - $userPrefsDisallow = $GLOBALS['config']->get('is_setup') |
| 748 | + $userPrefsDisallow = Config::getInstance()->get('is_setup') |
748 | 749 | ? $this->configFile->get('UserprefsDisallow', []) |
749 | 750 | : $GLOBALS['cfg']['UserprefsDisallow']; |
750 | 751 | $this->userprefsDisallow = array_flip($userPrefsDisallow ?? []); |
@@ -805,7 +806,7 @@ private function setComments(string $systemPath, array &$opts): void |
805 | 806 | $opts['comment_warning'] = true; |
806 | 807 | } |
807 | 808 |
|
808 | | - if ($GLOBALS['config']->get('is_setup')) { |
| 809 | + if (Config::getInstance()->get('is_setup')) { |
809 | 810 | return; |
810 | 811 | } |
811 | 812 |
|
|
0 commit comments