/
usr
/
share
/
phpmyadmin
/
libraries
/
classes
/
Controllers
/
/usr/share/phpmyadmin/libraries/classes/Controllers
mkdir
upload
Name
Size
Mode
Actions
Database/
-
0755
rm
Preferences/
-
0755
rm
Server/
-
0755
rm
Setup/
-
0755
rm
Table/
-
0755
rm
AbstractController.php
2399
0644
edit
dl
rm
BrowseForeignersController.php
2325
0644
edit
dl
rm
ChangeLogController.php
3603
0644
edit
dl
rm
CheckRelationsController.php
1512
0644
edit
dl
rm
ColumnController.php
908
0644
edit
dl
rm
ConfigController.php
1370
0644
edit
dl
rm
DatabaseController.php
270
0644
edit
dl
rm
ErrorReportController.php
6029
0644
edit
dl
rm
ExportController.php
24066
0644
edit
dl
rm
ExportTemplateController.php
4212
0644
edit
dl
rm
GisDataEditorController.php
4906
0644
edit
dl
rm
HomeController.php
18249
0644
edit
dl
rm
ImportController.php
32537
0644
edit
dl
rm
ImportStatusController.php
2313
0644
edit
dl
rm
JavaScriptMessagesController.php
37407
0644
edit
dl
rm
LicenseController.php
968
0644
edit
dl
rm
LintController.php
1774
0644
edit
dl
rm
LogoutController.php
407
0644
edit
dl
rm
NavigationController.php
3335
0644
edit
dl
rm
NormalizationController.php
5669
0644
edit
dl
rm
PhpInfoController.php
681
0644
edit
dl
rm
SchemaExportController.php
1128
0644
edit
dl
rm
SqlController.php
11564
0644
edit
dl
rm
TableController.php
867
0644
edit
dl
rm
ThemesController.php
776
0644
edit
dl
rm
TransformationOverviewController.php
1792
0644
edit
dl
rm
TransformationWrapperController.php
7480
0644
edit
dl
rm
UserPasswordController.php
3351
0644
edit
dl
rm
VersionCheckController.php
1241
0644
edit
dl
rm
ViewCreateController.php
9622
0644
edit
dl
rm
ViewOperationsController.php
3339
0644
edit
dl
rm
Edit:
/usr/share/phpmyadmin/libraries/classes/Controllers/NormalizationController.php
(5669B)
<?php declare(strict_types=1); namespace PhpMyAdmin\Controllers; use PhpMyAdmin\Core; use PhpMyAdmin\Normalization; use PhpMyAdmin\Response; use PhpMyAdmin\Template; use PhpMyAdmin\Url; use function intval; use function json_decode; use function json_encode; use function min; /** * Normalization process (temporarily specific to 1NF). */ class NormalizationController extends AbstractController { /** @var Normalization */ private $normalization; /** * @param Response $response */ public function __construct($response, Template $template, Normalization $normalization) { parent::__construct($response, $template); $this->normalization = $normalization; } public function index(): void { global $db, $table; if (isset($_POST['getColumns'])) { $html = '<option selected disabled>' . __('Select oneā¦') . '</option>' . '<option value="no_such_col">' . __('No such column') . '</option>'; //get column whose datatype falls under string category $html .= $this->normalization->getHtmlForColumnsList( $db, $table, _pgettext('string types', 'String') ); echo $html; return; } if (isset($_POST['splitColumn'])) { $num_fields = min(4096, intval($_POST['numFields'])); $html = $this->normalization->getHtmlForCreateNewColumn($num_fields, $db, $table); $html .= Url::getHiddenInputs($db, $table); echo $html; return; } if (isset($_POST['addNewPrimary'])) { $num_fields = 1; $columnMeta = [ 'Field' => $table . '_id', 'Extra' => 'auto_increment', ]; $html = $this->normalization->getHtmlForCreateNewColumn( $num_fields, $db, $table, $columnMeta ); $html .= Url::getHiddenInputs($db, $table); echo $html; return; } if (isset($_POST['findPdl'])) { $html = $this->normalization->findPartialDependencies($table, $db); echo $html; return; } if (isset($_POST['getNewTables2NF'])) { $partialDependencies = json_decode($_POST['pd'], true); $html = $this->normalization->getHtmlForNewTables2NF($partialDependencies, $table); echo $html; return; } if (isset($_POST['getNewTables3NF'])) { $dependencies = json_decode($_POST['pd']); $tables = json_decode($_POST['tables'], true); $newTables = $this->normalization->getHtmlForNewTables3NF($dependencies, $tables, $db); $this->response->disable(); Core::headerJSON(); echo json_encode($newTables); return; } $this->addScriptFiles(['normalization.js', 'vendor/jquery/jquery.uitablefilter.js']); $normalForm = '1nf'; if (Core::isValid($_POST['normalizeTo'], ['1nf', '2nf', '3nf'])) { $normalForm = $_POST['normalizeTo']; } if (isset($_POST['createNewTables2NF'])) { $partialDependencies = json_decode($_POST['pd'], true); $tablesName = json_decode($_POST['newTablesName']); $res = $this->normalization->createNewTablesFor2NF($partialDependencies, $tablesName, $table, $db); $this->response->addJSON($res); return; } if (isset($_POST['createNewTables3NF'])) { $newtables = json_decode($_POST['newTables'], true); $res = $this->normalization->createNewTablesFor3NF($newtables, $db); $this->response->addJSON($res); return; } if (isset($_POST['repeatingColumns'])) { $repeatingColumns = $_POST['repeatingColumns']; $newTable = $_POST['newTable']; $newColumn = $_POST['newColumn']; $primary_columns = $_POST['primary_columns']; $res = $this->normalization->moveRepeatingGroup( $repeatingColumns, $primary_columns, $newTable, $newColumn, $table, $db ); $this->response->addJSON($res); return; } if (isset($_POST['step1'])) { $html = $this->normalization->getHtmlFor1NFStep1($db, $table, $normalForm); $this->response->addHTML($html); } elseif (isset($_POST['step2'])) { $res = $this->normalization->getHtmlContentsFor1NFStep2($db, $table); $this->response->addJSON($res); } elseif (isset($_POST['step3'])) { $res = $this->normalization->getHtmlContentsFor1NFStep3($db, $table); $this->response->addJSON($res); } elseif (isset($_POST['step4'])) { $res = $this->normalization->getHtmlContentsFor1NFStep4($db, $table); $this->response->addJSON($res); } elseif (isset($_POST['step']) && $_POST['step'] == '2.1') { $res = $this->normalization->getHtmlFor2NFstep1($db, $table); $this->response->addJSON($res); } elseif (isset($_POST['step']) && $_POST['step'] == '3.1') { $tables = $_POST['tables']; $res = $this->normalization->getHtmlFor3NFstep1($db, $tables); $this->response->addJSON($res); } else { $this->response->addHTML($this->normalization->getHtmlForNormalizeTable()); } } }
Save
cmd:
run