restoreSession bug fix in new form validation engine
[openemr.git] / phpmyadmin / tbl_indexes.php
blob63fee93951d02d13e9eff6a79fc289b817b6868e
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_Index;
12 use PMA_Response;
14 require_once 'libraries/common.inc.php';
15 require_once 'libraries/di/Container.class.php';
16 require_once 'libraries/controllers/TableIndexesController.class.php';
17 require_once 'libraries/Response.class.php';
18 require_once 'libraries/Index.class.php';
20 $container = DI\Container::getDefaultContainer();
21 $container->factory('PMA\Controllers\Table\TableIndexesController');
22 $container->alias(
23 'TableIndexesController', 'PMA\Controllers\Table\TableIndexesController'
25 $container->set('PMA_Response', PMA_Response::getInstance());
26 $container->alias('response', 'PMA_Response');
28 /* Define dependencies for the concerned controller */
29 $db = $container->get('db');
30 $table = $container->get('table');
31 $dbi = $container->get('dbi');
33 if (!isset($_REQUEST['create_edit_table'])) {
34 include_once 'libraries/tbl_common.inc.php';
36 if (isset($_REQUEST['index'])) {
37 if (is_array($_REQUEST['index'])) {
38 // coming already from form
39 $index = new PMA_Index($_REQUEST['index']);
40 } else {
41 $index = $dbi->getTable($db, $table)->getIndex($_REQUEST['index']);
43 } else {
44 $index = new PMA_Index;
47 $dependency_definitions = array(
48 "index" => $index
51 /** @var Controllers\Table\TableIndexesController $controller */
52 $controller = $container->get('TableIndexesController', $dependency_definitions);
53 $controller->indexAction();