From 8dc906e9239f076e28874cd3c6692ed0b3622d03 Mon Sep 17 00:00:00 2001 From: Hugues Peccatte Date: Wed, 5 Jun 2019 22:19:19 +0200 Subject: [PATCH] Define correctly the Database\StructureController parameters Signed-off-by: Hugues Peccatte --- db_structure.php | 18 ------------------ services_controllers.yml | 2 +- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/db_structure.php b/db_structure.php index 0da843bbaf..41dd1c47d2 100644 --- a/db_structure.php +++ b/db_structure.php @@ -10,14 +10,11 @@ declare(strict_types=1); use PhpMyAdmin\Controllers\Database\StructureController; use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Response; -use Symfony\Component\DependencyInjection\Definition; if (! defined('ROOT_PATH')) { define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR); } -global $db; - require_once ROOT_PATH . 'libraries/common.inc.php'; require_once ROOT_PATH . 'libraries/db_common.inc.php'; @@ -27,21 +24,6 @@ $response = $containerBuilder->get(Response::class); /** @var DatabaseInterface $dbi */ $dbi = $containerBuilder->get(DatabaseInterface::class); -/* Define dependencies for the concerned controller */ -$dependency_definitions = [ - 'db' => $db, -]; - -/** @var Definition $definition */ -$definition = $containerBuilder->getDefinition(StructureController::class); -array_map( - static function (string $parameterName, $value) use ($definition) { - $definition->replaceArgument($parameterName, $value); - }, - array_keys($dependency_definitions), - $dependency_definitions -); - /** @var StructureController $controller */ $controller = $containerBuilder->get(StructureController::class); diff --git a/services_controllers.yml b/services_controllers.yml index d16cf8ffd0..68f7a3d782 100644 --- a/services_controllers.yml +++ b/services_controllers.yml @@ -73,7 +73,7 @@ services: response: '@response' dbi: '@dbi' template: '@template' - db: null + db: '%db%' relation: '@relation' replication: '@replication'