Rearranged installer

This commit is contained in:
Sergio Brighenti 2019-11-25 21:15:57 +01:00
parent 6f4e19f02b
commit 73a3fc08f1
2 changed files with 14 additions and 7 deletions

View file

@ -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.

View file

@ -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();