Translated using Weblate (Norwegian Bokmål)
[phpmyadmin.git] / tbl_indexes.php
blob467e6289fd62f1d2fb9552d9dee2d384373dc400
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 namespace PMA;
11 use PMA\libraries\controllers\table\TableIndexesController;
12 use PMA\libraries\Index;
13 use PMA\libraries\Response;
15 require_once 'libraries/common.inc.php';
17 $container = libraries\di\Container::getDefaultContainer();
18 $container->factory('PMA\libraries\controllers\table\TableIndexesController');
19 $container->alias(
20 'TableIndexesController',
21 'PMA\libraries\controllers\table\TableIndexesController'
23 $container->set('PMA\libraries\Response', Response::getInstance());
24 $container->alias('response', 'PMA\libraries\Response');
26 /* Define dependencies for the concerned controller */
27 $db = $container->get('db');
28 $table = $container->get('table');
29 $dbi = $container->get('dbi');
31 if (!isset($_REQUEST['create_edit_table'])) {
32 include_once 'libraries/tbl_common.inc.php';
34 if (isset($_REQUEST['index'])) {
35 if (is_array($_REQUEST['index'])) {
36 // coming already from form
37 $index = new Index($_REQUEST['index']);
38 } else {
39 $index = $dbi->getTable($db, $table)->getIndex($_REQUEST['index']);
41 } else {
42 $index = new Index;
45 $dependency_definitions = array(
46 "index" => $index
49 /** @var TableIndexesController $controller */
50 $controller = $container->get('TableIndexesController', $dependency_definitions);
51 $controller->indexAction();