devilbox/.devilbox/www/htdocs/vendor/phpmyadmin-4.9.7/tbl_indexes.php

51 lines
1.4 KiB
PHP
Raw Normal View History

2016-10-22 14:57:10 +00:00
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Displays index edit/creation form and handles it
*
* @package PhpMyAdmin
*/
2018-04-14 09:18:00 +00:00
use PhpMyAdmin\Controllers\Table\TableIndexesController;
use PhpMyAdmin\Di\Container;
use PhpMyAdmin\Index;
use PhpMyAdmin\Response;
2016-10-22 14:57:10 +00:00
require_once 'libraries/common.inc.php';
2018-04-14 09:18:00 +00:00
$container = Container::getDefaultContainer();
$container->factory('PhpMyAdmin\Controllers\Table\TableIndexesController');
2016-10-22 14:57:10 +00:00
$container->alias(
'TableIndexesController',
2018-04-14 09:18:00 +00:00
'PhpMyAdmin\Controllers\Table\TableIndexesController'
2016-10-22 14:57:10 +00:00
);
2018-04-14 09:18:00 +00:00
$container->set('PhpMyAdmin\Response', Response::getInstance());
$container->alias('response', 'PhpMyAdmin\Response');
2016-10-22 14:57:10 +00:00
/* Define dependencies for the concerned controller */
$db = $container->get('db');
$table = $container->get('table');
$dbi = $container->get('dbi');
2018-12-16 14:31:03 +00:00
if (!isset($_POST['create_edit_table'])) {
2016-10-22 14:57:10 +00:00
include_once 'libraries/tbl_common.inc.php';
}
2018-12-16 14:31:03 +00:00
if (isset($_POST['index'])) {
if (is_array($_POST['index'])) {
2016-10-22 14:57:10 +00:00
// coming already from form
2018-12-16 14:31:03 +00:00
$index = new Index($_POST['index']);
2016-10-22 14:57:10 +00:00
} else {
2018-12-16 14:31:03 +00:00
$index = $dbi->getTable($db, $table)->getIndex($_POST['index']);
2016-10-22 14:57:10 +00:00
}
} else {
$index = new Index;
}
$dependency_definitions = array(
"index" => $index
);
/** @var TableIndexesController $controller */
$controller = $container->get('TableIndexesController', $dependency_definitions);
$controller->indexAction();