aboutsummaryrefslogtreecommitdiff
path: root/app/install.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2019-11-06 15:16:00 +0100
committerGravatar GitHub <noreply@github.com> 2019-11-06 15:16:00 +0100
commit22030155f8fd5cab102ddd897a914cf1a0ffd183 (patch)
tree1af332589e778645dc80cb06de8c45261e3eecdd /app/install.php
parent12cdd2cdf6d493a8bd110d1ae310288a0a47afa0 (diff)
Fix database autocreate at install (#2635)
* Fix database autocreate at install Several bugs prevented the auto-creation of the database in Web and CLI installs. Fix https://github.com/YunoHost-Apps/freshrss_ynh/issues/84#issuecomment-549818408 * initDb https://github.com/FreshRSS/FreshRSS/pull/2635#discussion_r343107795
Diffstat (limited to 'app/install.php')
-rw-r--r--app/install.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/install.php b/app/install.php
index 96bee34a1..557ae9eab 100644
--- a/app/install.php
+++ b/app/install.php
@@ -132,7 +132,7 @@ function saveStep2() {
$config_array = [
'salt' => generateSalt(),
'base_url' => $base_url,
- 'default_user' => 'admin',
+ 'default_user' => '_',
'db' => [
'type' => $_SESSION['bd_type'],
'host' => $_SESSION['bd_host'],
@@ -154,12 +154,18 @@ function saveStep2() {
@unlink(DATA_PATH . '/config.php'); //To avoid access-rights problems
file_put_contents(DATA_PATH . '/config.php', "<?php\n return " . var_export($config_array, true) . ";\n");
+ if (function_exists('opcache_reset')) {
+ opcache_reset();
+ }
+
Minz_Configuration::register('system', DATA_PATH . '/config.php', FRESHRSS_PATH . '/config.default.php');
FreshRSS_Context::$system_conf = Minz_Configuration::get('system');
$ok = false;
try {
- $ok = checkDb();
+ Minz_Session::_param('currentUser', $config_array['default_user']);
+ $ok = initDb();
+ Minz_Session::_param('currentUser');
} catch (Exception $ex) {
$_SESSION['bd_error'] = $ex->getMessage();
$ok = false;