Remove Di\Container in tbl_indexes.php
Signed-off-by: Hugues Peccatte <hugues.peccatte@gmail.com>
This commit is contained in:
parent
1c710ee4e0
commit
454eb60fbb
@ -234,7 +234,7 @@ services:
|
||||
template: '@template'
|
||||
db: '%db%'
|
||||
table: '%table%'
|
||||
index: null
|
||||
index: '%index%'
|
||||
|
||||
PhpMyAdmin\Controllers\Table\RelationController:
|
||||
class: 'PhpMyAdmin\Controllers\Table\RelationController'
|
||||
|
||||
@ -9,10 +9,7 @@ declare(strict_types=1);
|
||||
|
||||
use PhpMyAdmin\Controllers\Table\IndexesController;
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\Di\Container;
|
||||
use PhpMyAdmin\Index;
|
||||
use PhpMyAdmin\Response;
|
||||
use Symfony\Component\DependencyInjection\Definition;
|
||||
|
||||
if (! defined('ROOT_PATH')) {
|
||||
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
|
||||
@ -20,16 +17,14 @@ if (! defined('ROOT_PATH')) {
|
||||
|
||||
require_once ROOT_PATH . 'libraries/common.inc.php';
|
||||
|
||||
$container = Container::getDefaultContainer();
|
||||
$container->set(Response::class, Response::getInstance());
|
||||
$container->alias('response', Response::class);
|
||||
|
||||
/* Define dependencies for the concerned controller */
|
||||
$db = $container->get('db');
|
||||
$table = $container->get('table');
|
||||
|
||||
/** @var DatabaseInterface $dbi */
|
||||
$dbi = $container->get(DatabaseInterface::class);
|
||||
$dbi = $containerBuilder->get('dbi');
|
||||
|
||||
/** @var string $db */
|
||||
$db = $containerBuilder->getParameter('db');
|
||||
|
||||
/** @var string $table */
|
||||
$table = $containerBuilder->getParameter('table');
|
||||
|
||||
if (! isset($_POST['create_edit_table'])) {
|
||||
include_once ROOT_PATH . 'libraries/tbl_common.inc.php';
|
||||
@ -46,19 +41,7 @@ if (isset($_POST['index'])) {
|
||||
}
|
||||
|
||||
/* Define dependencies for the concerned controller */
|
||||
$dependency_definitions = [
|
||||
'index' => $index,
|
||||
];
|
||||
|
||||
/** @var Definition $definition */
|
||||
$definition = $containerBuilder->getDefinition(IndexesController::class);
|
||||
array_map(
|
||||
static function (string $parameterName, $value) use ($definition) {
|
||||
$definition->replaceArgument($parameterName, $value);
|
||||
},
|
||||
array_keys($dependency_definitions),
|
||||
$dependency_definitions
|
||||
);
|
||||
$containerBuilder->setParameter('index', $index);
|
||||
|
||||
/** @var IndexesController $controller */
|
||||
$controller = $containerBuilder->get(IndexesController::class);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user