FeedDAOSQLite.php 489 B

123456789101112131415161718
  1. <?php
  2. declare(strict_types=1);
  3. class FreshRSS_FeedDAOSQLite extends FreshRSS_FeedDAO {
  4. /** @param array<int|string> $errorInfo */
  5. protected function autoUpdateDb(array $errorInfo): bool {
  6. if ($tableInfo = $this->pdo->query("PRAGMA table_info('feed')")) {
  7. $columns = $tableInfo->fetchAll(PDO::FETCH_COLUMN, 1);
  8. foreach (['attributes', 'kind'] as $column) {
  9. if (!in_array($column, $columns, true)) {
  10. return $this->addColumn($column);
  11. }
  12. }
  13. }
  14. return false;
  15. }
  16. }