mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-03-27 02:32:49 -04:00
Re-add database status in installation check (#8510)
* Re-add database status in installation check It got disabled in 2014 to get a beta out. Time to re-enable it. Tested on SQLite. "checkTable" now only verifies that at least the expected columns exist, but does not fail on additional columns provided by e.g. extensions. Related: https://github.com/FreshRSS/FreshRSS/issues/678 * make fix-all * i18n * Simpler and more correct content_bin * Fix PostgreSQL --------- Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
This commit is contained in:
@@ -361,30 +361,32 @@ class FreshRSS_update_Controller extends FreshRSS_ActionController {
|
||||
/**
|
||||
* Check database is well-installed.
|
||||
*
|
||||
* @return array<string,bool> of tested values.
|
||||
* @return array<string,array<string,bool>|bool> of tested values.
|
||||
*/
|
||||
private static function check_install_database(): array {
|
||||
$status = [
|
||||
'connection' => true,
|
||||
'tables' => false,
|
||||
'categories' => false,
|
||||
'feeds' => false,
|
||||
'entries' => false,
|
||||
'entrytmp' => false,
|
||||
'tag' => false,
|
||||
'entrytag' => false,
|
||||
'table' => [
|
||||
'categories' => false,
|
||||
'feeds' => false,
|
||||
'entries' => false,
|
||||
'entrytmp' => false,
|
||||
'tag' => false,
|
||||
'entrytag' => false,
|
||||
],
|
||||
];
|
||||
|
||||
try {
|
||||
$dbDAO = FreshRSS_Factory::createDatabaseDAO();
|
||||
|
||||
$status['tables'] = $dbDAO->tablesAreCorrect();
|
||||
$status['categories'] = $dbDAO->categoryIsCorrect();
|
||||
$status['feeds'] = $dbDAO->feedIsCorrect();
|
||||
$status['entries'] = $dbDAO->entryIsCorrect();
|
||||
$status['entrytmp'] = $dbDAO->entrytmpIsCorrect();
|
||||
$status['tag'] = $dbDAO->tagIsCorrect();
|
||||
$status['entrytag'] = $dbDAO->entrytagIsCorrect();
|
||||
$status['table']['categories'] = $dbDAO->categoryIsCorrect();
|
||||
$status['table']['feeds'] = $dbDAO->feedIsCorrect();
|
||||
$status['table']['entries'] = $dbDAO->entryIsCorrect();
|
||||
$status['table']['entrytmp'] = $dbDAO->entrytmpIsCorrect();
|
||||
$status['table']['tag'] = $dbDAO->tagIsCorrect();
|
||||
$status['table']['entrytag'] = $dbDAO->entrytagIsCorrect();
|
||||
} catch (Minz_PDOConnectionException $e) {
|
||||
$status['connection'] = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user