فهرست منبع

Rearranged installer

Sergio Brighenti 5 سال پیش
والد
کامیت
73a3fc08f1
2فایلهای تغییر یافته به همراه14 افزوده شده و 7 حذف شده
  1. 5 1
      CHANGELOG.md
  2. 9 6
      install/index.php

+ 5 - 1
CHANGELOG.md

@@ -1,4 +1,8 @@
-## v.3.0 (WIP)
+## v.3.0.1
++ Fixed error with older mysql versions.
++ Small installer update.
+
+## v.3.0
 + Upgraded from Slim3 to Slim 4.
 + Added web upload.
 + Added ability to add custom HTML in \<head\> tag.

+ 9 - 6
install/index.php

@@ -200,16 +200,13 @@ $app->post('/', function (Request $request, Response $response, Filesystem $stor
         $db->query("INSERT INTO `users` (`email`, `username`, `password`, `is_admin`, `user_code`) VALUES (?, 'admin', ?, 1, ?)", [param($request, 'email'), password_hash(param($request, 'password'), PASSWORD_DEFAULT), humanRandomString(5)]);
     }
 
-    // post install cleanup
-    cleanDirectory(__DIR__.'/../resources/cache');
-    cleanDirectory(__DIR__.'/../resources/sessions');
-
-    removeDirectory(__DIR__.'/../install');
-
     // if is upgrading and existing installation, put it out maintenance
     if ($installed) {
         unset($config['maintenance']);
+
+        // remove old config from old versions
         unset($config['lang']);
+        unset($config['displayErrorDetails']);
     }
 
     // Finally write the config
@@ -220,6 +217,12 @@ $app->post('/', function (Request $request, Response $response, Filesystem $stor
         return redirect($response, '/install');
     }
 
+    // post install cleanup
+    cleanDirectory(__DIR__.'/../resources/cache');
+    cleanDirectory(__DIR__.'/../resources/sessions');
+
+    removeDirectory(__DIR__.'/../install');
+
     // Installed successfully, destroy the installer session
     $session->destroy();