Translated using Weblate (Bulgarian)
[phpmyadmin.git] / tbl_indexes.php
blobe9a6cda4b9032a8791055dcfaf5782489f81f647
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Displays index edit/creation form and handles it
6 * @package PhpMyAdmin
7 */
8 declare(strict_types=1);
10 use PhpMyAdmin\Controllers\Table\IndexesController;
11 use PhpMyAdmin\DatabaseInterface;
12 use PhpMyAdmin\Index;
14 if (! defined('ROOT_PATH')) {
15 define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
18 require_once ROOT_PATH . 'libraries/common.inc.php';
20 /** @var DatabaseInterface $dbi */
21 $dbi = $containerBuilder->get('dbi');
23 /** @var string $db */
24 $db = $containerBuilder->getParameter('db');
26 /** @var string $table */
27 $table = $containerBuilder->getParameter('table');
29 if (! isset($_POST['create_edit_table'])) {
30 include_once ROOT_PATH . 'libraries/tbl_common.inc.php';
32 if (isset($_POST['index'])) {
33 if (is_array($_POST['index'])) {
34 // coming already from form
35 $index = new Index($_POST['index']);
36 } else {
37 $index = $dbi->getTable($db, $table)->getIndex($_POST['index']);
39 } else {
40 $index = new Index();
43 /* Define dependencies for the concerned controller */
44 $containerBuilder->setParameter('index', $index);
46 /** @var IndexesController $controller */
47 $controller = $containerBuilder->get(IndexesController::class);
48 $controller->indexAction();