aboutsummaryrefslogtreecommitdiff
path: root/lib/lib_install.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lib_install.php')
-rw-r--r--lib/lib_install.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/lib_install.php b/lib/lib_install.php
index 18f4a732a..23c902440 100644
--- a/lib/lib_install.php
+++ b/lib/lib_install.php
@@ -1,7 +1,7 @@
<?php
-Minz_Configuration::register('default_system', join_path(FRESHRSS_PATH, 'config.default.php'));
-Minz_Configuration::register('default_user', join_path(FRESHRSS_PATH, 'config-user.default.php'));
+FreshRSS_SystemConfiguration::register('default_system', join_path(FRESHRSS_PATH, 'config.default.php'));
+FreshRSS_UserConfiguration::register('default_user', join_path(FRESHRSS_PATH, 'config-user.default.php'));
/** @return array<string,string> */
function checkRequirements(string $dbType = ''): array {
@@ -76,7 +76,7 @@ function checkRequirements(string $dbType = ''): array {
}
function generateSalt(): string {
- return sha1(uniqid('' . mt_rand(), true).implode('', stat(__FILE__)));
+ return sha1(uniqid('' . mt_rand(), true).implode('', stat(__FILE__) ?: []));
}
function initDb(): string {
@@ -88,10 +88,14 @@ function initDb(): string {
$db['pdo_options'][PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
$conf->db = $db; //TODO: Remove this Minz limitation "Indirect modification of overloaded property"
+ if (empty($db['type'])) {
+ $db['type'] = 'sqlite';
+ }
+
//Attempt to auto-create database if it does not already exist
if ($db['type'] !== 'sqlite') {
Minz_ModelPdo::$usesSharedPdo = false;
- $dbBase = isset($db['base']) ? $db['base'] : '';
+ $dbBase = $db['base'] ?? '';
//For first connection, use default database for PostgreSQL, empty database for MySQL / MariaDB:
$db['base'] = $db['type'] === 'pgsql' ? 'postgres' : '';
$conf->db = $db;