Translated using Weblate (Bulgarian)
[phpmyadmin.git] / tbl_structure.php
blob0cda2b63e65c88969745b363e61a7f9c4d8bc9e3
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 Symfony\Component\DependencyInjection\Definition;
15 if (! defined('ROOT_PATH')) {
16 define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
19 global $db_is_system_schema, $tbl_is_view, $tbl_storage_engine;
20 global $table_info_num_rows, $tbl_collation, $showtable;
22 require_once ROOT_PATH . 'libraries/common.inc.php';
24 /** @var DatabaseInterface $dbi */
25 $dbi = $containerBuilder->get('dbi');
27 /** @var string $db */
28 $db = $containerBuilder->getParameter('db');
30 /** @var string $table */
31 $table = $containerBuilder->getParameter('table');
33 $dbi->selectDb($db);
34 $table_class_object = $dbi->getTable($db, $table);
35 $reread_info = $table_class_object->getStatusInfo(null, true);
36 $GLOBALS['showtable'] = $table_class_object->getStatusInfo(null, (isset($reread_info) && $reread_info ? true : false));
37 if ($table_class_object->isView()) {
38 $tbl_is_view = true;
39 $tbl_storage_engine = __('View');
40 } else {
41 $tbl_is_view = false;
42 $tbl_storage_engine = $table_class_object->getStorageEngine();
44 $tbl_collation = $table_class_object->getCollation();
45 $table_info_num_rows = $table_class_object->getNumRows();
46 /* Define dependencies for the concerned controller */
47 $dependency_definitions = [
48 'db_is_system_schema' => $db_is_system_schema,
49 'tbl_is_view' => $tbl_is_view,
50 'tbl_storage_engine' => $tbl_storage_engine,
51 'table_info_num_rows' => $table_info_num_rows,
52 'tbl_collation' => $tbl_collation,
53 'showtable' => $GLOBALS['showtable'],
56 /** @var Definition $definition */
57 $definition = $containerBuilder->getDefinition(StructureController::class);
58 $parameterBag = $containerBuilder->getParameterBag();
59 array_map(
60 static function (string $parameterName, $value) use ($definition, $parameterBag) {
61 $definition->replaceArgument($parameterName, $parameterBag->escapeValue($value));
63 array_keys($dependency_definitions),
64 $dependency_definitions
67 /** @var StructureController $controller */
68 $controller = $containerBuilder->get(StructureController::class);
69 $controller->indexAction($containerBuilder);