Improve create-release script to handle QA branches higher than QA_4_8.
[phpmyadmin.git] / tbl_structure.php
blobf0e504e8cbb6355850d4f443f06940703263ff98
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Displays table structure infos like columns, indexes, size, rows
5 * and allows manipulation of indexes and columns
7 * @package PhpMyAdmin
8 */
9 declare(strict_types=1);
11 use PhpMyAdmin\Controllers\Table\StructureController;
12 use PhpMyAdmin\DatabaseInterface;
13 use PhpMyAdmin\Di\Container;
14 use PhpMyAdmin\Response;
15 use Symfony\Component\DependencyInjection\Definition;
17 if (! defined('ROOT_PATH')) {
18 define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
21 global $db, $table, $db_is_system_schema, $tbl_is_view, $tbl_storage_engine;
22 global $table_info_num_rows, $tbl_collation, $showtable;
24 require_once ROOT_PATH . 'libraries/common.inc.php';
26 $container = Container::getDefaultContainer();
27 $container->set(Response::class, Response::getInstance());
28 $container->alias('response', Response::class);
30 /** @var DatabaseInterface $dbi */
31 $dbi = $container->get(DatabaseInterface::class);
33 $dbi->selectDb($GLOBALS['db']);
34 $table_class_object = $dbi->getTable(
35 $GLOBALS['db'],
36 $GLOBALS['table']
38 $reread_info = $table_class_object->getStatusInfo(null, true);
39 $GLOBALS['showtable'] = $table_class_object->getStatusInfo(null, (isset($reread_info) && $reread_info ? true : false));
40 if ($table_class_object->isView()) {
41 $tbl_is_view = true;
42 $tbl_storage_engine = __('View');
43 } else {
44 $tbl_is_view = false;
45 $tbl_storage_engine = $table_class_object->getStorageEngine();
47 $tbl_collation = $table_class_object->getCollation();
48 $table_info_num_rows = $table_class_object->getNumRows();
49 /* Define dependencies for the concerned controller */
50 $dependency_definitions = [
51 'db' => $db,
52 'table' => $table,
53 'db_is_system_schema' => $db_is_system_schema,
54 'tbl_is_view' => $tbl_is_view,
55 'tbl_storage_engine' => $tbl_storage_engine,
56 'table_info_num_rows' => $table_info_num_rows,
57 'tbl_collation' => $tbl_collation,
58 'showtable' => $GLOBALS['showtable']
61 /** @var Definition $definition */
62 $definition = $containerBuilder->getDefinition(StructureController::class);
63 array_map(
64 static function (string $parameterName, $value) use ($definition) {
65 $definition->replaceArgument($parameterName, $value);
67 array_keys($dependency_definitions),
68 $dependency_definitions
71 /** @var StructureController $controller */
72 $controller = $containerBuilder->get(StructureController::class);
73 $controller->indexAction($containerBuilder);