Improve create-release script to handle QA branches higher than QA_4_8.
[phpmyadmin.git] / db_datadict.php
blob03fa55f1d80d1fc864ce29920f632fc07b4580fa
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Renders data dictionary
6 * @package PhpMyAdmin
7 */
8 declare(strict_types=1);
10 use PhpMyAdmin\Controllers\Database\DataDictionaryController;
11 use PhpMyAdmin\DatabaseInterface;
12 use PhpMyAdmin\Di\Container;
13 use PhpMyAdmin\Relation;
14 use PhpMyAdmin\Response;
15 use PhpMyAdmin\Transformations;
16 use PhpMyAdmin\Util;
17 use Symfony\Component\DependencyInjection\Definition;
19 if (! defined('ROOT_PATH')) {
20 define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
23 global $db;
25 require_once ROOT_PATH . 'libraries/common.inc.php';
27 Util::checkParameters(['db']);
29 $container = Container::getDefaultContainer();
30 $container->set(Response::class, Response::getInstance());
32 /** @var Response $response */
33 $response = $container->get(Response::class);
35 /* Define dependencies for the concerned controller */
36 $dependency_definitions = [
37 'db' => $container->get('db'),
40 /** @var Definition $definition */
41 $definition = $containerBuilder->getDefinition(DataDictionaryController::class);
42 array_map(
43 static function (string $parameterName, $value) use ($definition) {
44 $definition->replaceArgument($parameterName, $value);
46 array_keys($dependency_definitions),
47 $dependency_definitions
50 /** @var DataDictionaryController $controller */
51 $controller = $containerBuilder->get(DataDictionaryController::class);
53 $header = $response->getHeader();
54 $header->enablePrintView();
56 $response->addHTML($controller->index());