FeedDAOSQLite.php 528 B

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