@@ -70,17 +70,8 @@ try {
|
||||
echo 'Resetting theme to default ...' . PHP_EOL;
|
||||
$pdo->query("UPDATE ttrss_user_prefs SET value = '' WHERE pref_name = 'USER_CSS_THEME'");
|
||||
}
|
||||
}
|
||||
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 = preg_replace('/--(.*?);/', '', $schema);
|
||||
$schema = preg_replace('/[\r\n]/', ' ', $schema);
|
||||
$schema = trim($schema, ' ;');
|
||||
foreach (explode(';', $schema) as $stm) {
|
||||
$pdo->exec($stm);
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
echo 'Database table not found, there is no schema anymore lets continue and see what will happen... ' . PHP_EOL;
|
||||
unset($pdo);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user