2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Displays index edit/creation form and handles it
8 declare(strict_types
=1);
10 use PhpMyAdmin\Controllers\Table\IndexesController
;
11 use PhpMyAdmin\DatabaseInterface
;
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']);
37 $index = $dbi->getTable($db, $table)->getIndex($_POST['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();