Assume that TTRSS_PATH has no trailing slash in ttrss-configure-db.php, as in setup-ttrss.sh

This commit is contained in:
Gilles FELIX 2021-02-25 08:46:49 +01:00 committed by GitHub
parent d2365335e1
commit eff41ce188
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,8 +3,8 @@
include '/srv/ttrss-utils.php';
$confpath = env('TTRSS_PATH', '/var/www/ttrss/');
$conffile = $confpath . 'config.php';
$confpath = env('TTRSS_PATH', '/var/www/ttrss');
$conffile = $confpath . '/config.php';
$ename = 'DB';
$eport = 5432;
@ -73,7 +73,8 @@ try {
}
catch (PDOException $e) {
echo 'Database table not found, applying schema... ' . PHP_EOL;
$schema = file_get_contents($confpath . 'schema/ttrss_schema_' . $config['DB_TYPE'] . '.sql');
$schema = file_get_contents($confpath . '/schema/ttrss_schema_' . $config['DB_TYPE'] . '.sql');
$schema = preg_replace('/--(.*?);/', '', $schema);
$schema = preg_replace('/[\r\n]/', ' ', $schema);
$schema = trim($schema, ' ;');