Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Database\ImportController class
Moves the database import entry point logic to the controller and removes the entry point file. Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
- Loading branch information
1 parent
5ad3376
commit 5debd00
Showing
4 changed files
with
71 additions
and
56 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
libraries/classes/Controllers/Database/ImportController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
/** | ||
* @package PhpMyAdmin\Controllers\Database | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace PhpMyAdmin\Controllers\Database; | ||
|
||
use PhpMyAdmin\Config\PageSettings; | ||
use PhpMyAdmin\Display\Import; | ||
use PhpMyAdmin\Util; | ||
|
||
/** | ||
* @package PhpMyAdmin\Controllers\Database | ||
*/ | ||
final class ImportController extends AbstractController | ||
{ | ||
/** | ||
* @return void | ||
*/ | ||
public function index(): void | ||
{ | ||
global $db, $max_upload_size, $table, $tables, $num_tables, $total_num_tables, $is_show_stats; | ||
global $db_is_system_schema, $tooltip_truename, $tooltip_aliasname, $pos, $sub_part; | ||
|
||
PageSettings::showGroup('Import'); | ||
|
||
$header = $this->response->getHeader(); | ||
$scripts = $header->getScripts(); | ||
$scripts->addFile('import.js'); | ||
|
||
/** | ||
* Gets tables information and displays top links | ||
*/ | ||
require ROOT_PATH . 'libraries/db_common.inc.php'; | ||
|
||
list( | ||
$tables, | ||
$num_tables, | ||
$total_num_tables, | ||
$sub_part, | ||
$is_show_stats, | ||
$db_is_system_schema, | ||
$tooltip_truename, | ||
$tooltip_aliasname, | ||
$pos | ||
) = Util::getDbInfo($db, $sub_part ?? ''); | ||
|
||
$this->response->addHTML( | ||
Import::get( | ||
'database', | ||
$db, | ||
$table, | ||
$max_upload_size | ||
) | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters