2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Displays table structure infos like columns, indexes, size, rows
5 * and allows manipulation of indexes and columns
9 declare(strict_types
=1);
11 use PhpMyAdmin\Controllers\Table\StructureController
;
12 use PhpMyAdmin\DatabaseInterface
;
13 use PhpMyAdmin\Di\Container
;
14 use PhpMyAdmin\Response
;
16 if (! defined('ROOT_PATH')) {
17 define('ROOT_PATH', __DIR__
. DIRECTORY_SEPARATOR
);
20 global $db, $table, $db_is_system_schema, $tbl_is_view, $tbl_storage_engine;
21 global $table_info_num_rows, $tbl_collation, $showtable;
23 require_once ROOT_PATH
. 'libraries/common.inc.php';
25 $container = Container
::getDefaultContainer();
26 $container->factory(StructureController
::class);
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(
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()) {
42 $tbl_storage_engine = __('View');
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 = [
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 StructureController $controller */
62 $controller = $container->get(StructureController
::class, $dependency_definitions);
63 $controller->indexAction();