Translated using Weblate (Estonian)
[phpmyadmin.git] / tbl_indexes.php
blob76927ea1b0ea0186b006689e6cf1d6bc662358dd
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 */
9 use PhpMyAdmin\Controllers\Table\TableIndexesController;
10 use PhpMyAdmin\Di\Container;
11 use PhpMyAdmin\Index;
12 use PhpMyAdmin\Response;
14 require_once 'libraries/common.inc.php';
16 $container = Container::getDefaultContainer();
17 $container->factory('PhpMyAdmin\Controllers\Table\TableIndexesController');
18 $container->alias(
19 'TableIndexesController',
20 'PhpMyAdmin\Controllers\Table\TableIndexesController'
22 $container->set('PhpMyAdmin\Response', Response::getInstance());
23 $container->alias('response', 'PhpMyAdmin\Response');
25 /* Define dependencies for the concerned controller */
26 $db = $container->get('db');
27 $table = $container->get('table');
28 $dbi = $container->get('dbi');
30 if (!isset($_POST['create_edit_table'])) {
31 include_once 'libraries/tbl_common.inc.php';
33 if (isset($_POST['index'])) {
34 if (is_array($_POST['index'])) {
35 // coming already from form
36 $index = new Index($_POST['index']);
37 } else {
38 $index = $dbi->getTable($db, $table)->getIndex($_POST['index']);
40 } else {
41 $index = new Index;
44 $dependency_definitions = array(
45 "index" => $index
48 /** @var TableIndexesController $controller */
49 $controller = $container->get('TableIndexesController', $dependency_definitions);
50 $controller->indexAction();