mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-03-27 10:43:41 -04:00
* New SQL wrapper function `fetchInt()`
* Favour use of `fetchAssoc()`, `fetchInt()`, `fetchColumn()`
* Favour Nowdoc / Heredoc syntax for SQL
* Update indenting to PHP 8.1+ convention
* Favour `bindValue()` instead of position `?` when possible
* Favour `bindValue()` over `bindParam()`
* More uniform and robust syntax when using `bindValue()`, checking return code
25 lines
574 B
PHP
25 lines
574 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
class FreshRSS_FeedDAOSQLite extends FreshRSS_FeedDAOPGSQL {
|
|
|
|
#[\Override]
|
|
public function sqlResetSequence(): bool {
|
|
return true; // Nothing to do for SQLite
|
|
}
|
|
|
|
/** @param array{0:string,1:int,2:string} $errorInfo */
|
|
#[\Override]
|
|
public function autoUpdateDb(array $errorInfo): bool {
|
|
$columns = $this->fetchColumn("PRAGMA table_info('feed')", 1);
|
|
if ($columns !== null) {
|
|
foreach (['kind'] as $column) {
|
|
if (!in_array($column, $columns, true)) {
|
|
return $this->addColumn($column);
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|