2014-07-23 15:52:50 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class FreshRSS_Factory {
|
|
|
|
|
2015-02-08 18:55:48 +01:00
|
|
|
public static function createFeedDao($username = null) {
|
|
|
|
$conf = Minz_Configuration::get('system');
|
|
|
|
if ($conf->db['type'] === 'sqlite') {
|
|
|
|
return new FreshRSS_FeedDAOSQLite($username);
|
2014-07-23 15:52:50 +02:00
|
|
|
} else {
|
2015-02-08 18:55:48 +01:00
|
|
|
return new FreshRSS_FeedDAO($username);
|
2014-07-23 15:52:50 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-08 18:55:48 +01:00
|
|
|
public static function createEntryDao($username = null) {
|
|
|
|
$conf = Minz_Configuration::get('system');
|
|
|
|
if ($conf->db['type'] === 'sqlite') {
|
|
|
|
return new FreshRSS_EntryDAOSQLite($username);
|
2014-07-23 15:52:50 +02:00
|
|
|
} else {
|
2015-02-08 18:55:48 +01:00
|
|
|
return new FreshRSS_EntryDAO($username);
|
2014-07-23 15:52:50 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-08 18:55:48 +01:00
|
|
|
public static function createStatsDAO($username = null) {
|
|
|
|
$conf = Minz_Configuration::get('system');
|
|
|
|
if ($conf->db['type'] === 'sqlite') {
|
|
|
|
return new FreshRSS_StatsDAOSQLite($username);
|
2014-07-23 15:52:50 +02:00
|
|
|
} else {
|
2015-02-08 18:55:48 +01:00
|
|
|
return new FreshRSS_StatsDAO($username);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function createDatabaseDAO($username = null) {
|
|
|
|
$conf = Minz_Configuration::get('system');
|
|
|
|
if ($conf->db['type'] === 'sqlite') {
|
|
|
|
return new FreshRSS_DatabaseDAOSQLite($username);
|
|
|
|
} else {
|
|
|
|
return new FreshRSS_DatabaseDAO($username);
|
2014-07-23 15:52:50 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|