mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-01-06 04:17:51 -05:00
* Draft of JSON column for feeds https://github.com/FreshRSS/FreshRSS/issues/1654 * Add some per-feed options * Feed cURL timeout * Mark updated articles as read https://github.com/FreshRSS/FreshRSS/issues/891 * Mark as read upon reception https://github.com/FreshRSS/FreshRSS/issues/1702 * Ignore SSL (unsafe) https://github.com/FreshRSS/FreshRSS/issues/1811 * Try PHPCS workaround While waiting for a better syntax support
52 lines
1.3 KiB
PHP
52 lines
1.3 KiB
PHP
<?php
|
|
|
|
class FreshRSS_Factory {
|
|
|
|
public static function createFeedDao($username = null) {
|
|
$conf = Minz_Configuration::get('system');
|
|
switch ($conf->db['type']) {
|
|
case 'sqlite':
|
|
return new FreshRSS_FeedDAOSQLite($username);
|
|
default:
|
|
return new FreshRSS_FeedDAO($username);
|
|
}
|
|
}
|
|
|
|
public static function createEntryDao($username = null) {
|
|
$conf = Minz_Configuration::get('system');
|
|
switch ($conf->db['type']) {
|
|
case 'sqlite':
|
|
return new FreshRSS_EntryDAOSQLite($username);
|
|
case 'pgsql':
|
|
return new FreshRSS_EntryDAOPGSQL($username);
|
|
default:
|
|
return new FreshRSS_EntryDAO($username);
|
|
}
|
|
}
|
|
|
|
public static function createStatsDAO($username = null) {
|
|
$conf = Minz_Configuration::get('system');
|
|
switch ($conf->db['type']) {
|
|
case 'sqlite':
|
|
return new FreshRSS_StatsDAOSQLite($username);
|
|
case 'pgsql':
|
|
return new FreshRSS_StatsDAOPGSQL($username);
|
|
default:
|
|
return new FreshRSS_StatsDAO($username);
|
|
}
|
|
}
|
|
|
|
public static function createDatabaseDAO($username = null) {
|
|
$conf = Minz_Configuration::get('system');
|
|
switch ($conf->db['type']) {
|
|
case 'sqlite':
|
|
return new FreshRSS_DatabaseDAOSQLite($username);
|
|
case 'pgsql':
|
|
return new FreshRSS_DatabaseDAOPGSQL($username);
|
|
default:
|
|
return new FreshRSS_DatabaseDAO($username);
|
|
}
|
|
}
|
|
|
|
}
|