mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2025-12-31 17:37:48 -05:00
- Use only Minz_Configuration
- register() method to load a new configuration file
- get() to get a configuration
- new exceptions related to configuration
- fix a list configuration calls to have FRSS working
Current problems to resolve:
- How to handle configuration param verifications (i.e. check auth_type
is a value from none, http_auth, persona or form)
- We must use $conf = Minz_Configuration::get('system'); $general_conf = $conf->general;
to access global system configuration which is quite annoying. How to change that?
See https://github.com/FreshRSS/FreshRSS/issues/730
42 lines
1.0 KiB
PHP
42 lines
1.0 KiB
PHP
<?php
|
|
|
|
class FreshRSS_Factory {
|
|
|
|
public static function createFeedDao($username = null) {
|
|
$conf = Minz_Configuration::get('system');
|
|
if ($conf->db['type'] === 'sqlite') {
|
|
return new FreshRSS_FeedDAOSQLite($username);
|
|
} else {
|
|
return new FreshRSS_FeedDAO($username);
|
|
}
|
|
}
|
|
|
|
public static function createEntryDao($username = null) {
|
|
$conf = Minz_Configuration::get('system');
|
|
if ($conf->db['type'] === 'sqlite') {
|
|
return new FreshRSS_EntryDAOSQLite($username);
|
|
} else {
|
|
return new FreshRSS_EntryDAO($username);
|
|
}
|
|
}
|
|
|
|
public static function createStatsDAO($username = null) {
|
|
$conf = Minz_Configuration::get('system');
|
|
if ($conf->db['type'] === 'sqlite') {
|
|
return new FreshRSS_StatsDAOSQLite($username);
|
|
} else {
|
|
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);
|
|
}
|
|
}
|
|
|
|
}
|