diff --git a/phpmyfaq/api/index.php b/phpmyfaq/api/index.php index ab88550e1a..9ffaefd095 100644 --- a/phpmyfaq/api/index.php +++ b/phpmyfaq/api/index.php @@ -72,8 +72,6 @@ // Strings::init($currentLanguage); -$request = Request::createFromGlobals(); - $routes = include __DIR__ . '/../src/api-routes.php'; $context = new RequestContext(); diff --git a/phpmyfaq/setup/index.php b/phpmyfaq/setup/index.php index 9edebd859e..6e433623cb 100644 --- a/phpmyfaq/setup/index.php +++ b/phpmyfaq/setup/index.php @@ -22,11 +22,13 @@ */ use Composer\Autoload\ClassLoader; -use phpMyFAQ\Component\Alert;use phpMyFAQ\Core\Exception; +use phpMyFAQ\Component\Alert; +use phpMyFAQ\Core\Exception; use phpMyFAQ\Language\LanguageCodes; use phpMyFAQ\Setup\Installer; use phpMyFAQ\Strings; -use phpMyFAQ\System;use phpMyFAQ\Translation; +use phpMyFAQ\System; +use phpMyFAQ\Translation; define('PMF_ROOT_DIR', dirname(__FILE__, 2)); const PMF_SRC_DIR = PMF_ROOT_DIR . '/src'; diff --git a/phpmyfaq/setup/update.php b/phpmyfaq/setup/update.php index 6508a0b314..e09ef1fd51 100644 --- a/phpmyfaq/setup/update.php +++ b/phpmyfaq/setup/update.php @@ -23,7 +23,6 @@ use phpMyFAQ\Database; use phpMyFAQ\Filter; use phpMyFAQ\Permission\BasicPermission; -use phpMyFAQ\Setup\Installer; use phpMyFAQ\Setup\Update; use phpMyFAQ\Strings; use phpMyFAQ\System; @@ -48,7 +47,9 @@ $version = Filter::filterInput(INPUT_POST, 'version', FILTER_SANITIZE_SPECIAL_CHARS); $query = []; -$update = new Update(new System(), Configuration::getConfigurationInstance()); +$system = new System(); +$faqConfig = Configuration::getConfigurationInstance(); +$update = new Update($system, $faqConfig); if (!$update->checkDatabaseFile()) { $redirect = new RedirectResponse('./index.php'); @@ -120,8 +121,6 @@ getVersion(); $update = new Update($system, $faqConfig); @@ -296,34 +295,16 @@ // Perform the queries for optimizing the database echo '
Error: ' . $exception->getMessage() . '
'; - System::renderFooter(); } - /* - foreach ($query as $executeQuery) { - $result = $faqConfig->getDb()->query($executeQuery); - printf('█', $executeQuery); - if (!$result) { - echo 'Error: Please update your version of phpMyFAQ ' . - 'once again or send us a ' . - 'bug report
'; - printf('DB error: %s
', $faqConfig->getDb()->error()); - printf('%s
', htmlentities($executeQuery));
- System::renderFooter();
- }
- usleep(10000);
- }
- */
- echo '