From 04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 9 Jan 2020 10:55:03 +0100 Subject: phpmyadmin working --- srcs/phpmyadmin/chk_rel.php | 47 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 srcs/phpmyadmin/chk_rel.php (limited to 'srcs/phpmyadmin/chk_rel.php') diff --git a/srcs/phpmyadmin/chk_rel.php b/srcs/phpmyadmin/chk_rel.php new file mode 100644 index 0000000..2455917 --- /dev/null +++ b/srcs/phpmyadmin/chk_rel.php @@ -0,0 +1,47 @@ +get(Response::class); + +/** @var DatabaseInterface $dbi */ +$dbi = $containerBuilder->get(DatabaseInterface::class); + +/** @var Relation $relation */ +$relation = $containerBuilder->get('relation'); + +// If request for creating the pmadb +if (isset($_POST['create_pmadb']) && $relation->createPmaDatabase()) { + $relation->fixPmaTables('phpmyadmin'); +} + +// If request for creating all PMA tables. +if (isset($_POST['fixall_pmadb'])) { + $relation->fixPmaTables($GLOBALS['db']); +} + +$cfgRelation = $relation->getRelationsParam(); +// If request for creating missing PMA tables. +if (isset($_POST['fix_pmadb'])) { + $relation->fixPmaTables($cfgRelation['db']); +} + +$response->addHTML( + $relation->getRelationsParamDiagnostic($cfgRelation) +); -- cgit