Skip to content

Commit

Permalink
Remove the table structure entry point file
Browse files Browse the repository at this point in the history
Directly calls the controller instead of including the file.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
  • Loading branch information
MauricioFauth committed Jan 7, 2020
1 parent 7837ab8 commit 96ee3b8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
6 changes: 5 additions & 1 deletion libraries/classes/Controllers/Table/IndexesController.php
Expand Up @@ -140,6 +140,8 @@ public function displayForm(Index $index): void
*/
public function doSaveData(Index $index): void
{
global $containerBuilder;

$error = false;

$sql_query = $this->dbi->getTable($this->db, $this->table)
Expand Down Expand Up @@ -171,7 +173,9 @@ public function doSaveData(Index $index): void
)
);
} else {
include ROOT_PATH . 'libraries/entry_points/table/structure.php';
/** @var StructureController $controller */
$controller = $containerBuilder->get(StructureController::class);
$controller->index();
}
} else {
$this->response->setRequestStatus(false);
Expand Down
7 changes: 5 additions & 2 deletions libraries/classes/Controllers/ViewCreateController.php
Expand Up @@ -6,6 +6,7 @@

namespace PhpMyAdmin\Controllers;

use PhpMyAdmin\Controllers\Table\StructureController;
use PhpMyAdmin\Core;
use PhpMyAdmin\Html\Generator;
use PhpMyAdmin\Message;
Expand All @@ -26,7 +27,7 @@ public function index(): void
{
global $text_dir, $url_params, $view_algorithm_options, $view_with_options, $view_security_options;
global $message, $sep, $sql_query, $arr, $view_columns, $column_map, $systemDb, $pma_transformation_data;
global $new_transformations_sql, $view, $item, $parts, $db;
global $containerBuilder, $new_transformations_sql, $view, $item, $parts, $db;

require ROOT_PATH . 'libraries/db_common.inc.php';

Expand Down Expand Up @@ -164,7 +165,9 @@ public function index(): void

if (! isset($_POST['ajax_dialog'])) {
$message = Message::success();
include ROOT_PATH . 'libraries/entry_points/table/structure.php';
/** @var StructureController $controller */
$controller = $containerBuilder->get(StructureController::class);
$controller->index();
} else {
$this->response->addJSON(
'message',
Expand Down
17 changes: 0 additions & 17 deletions libraries/entry_points/table/structure.php

This file was deleted.

0 comments on commit 96ee3b8

Please sign in to comment.