diff options
| author | 2015-01-31 14:45:37 +0100 | |
|---|---|---|
| committer | 2015-01-31 14:45:37 +0100 | |
| commit | a97bbd9bd54c5fa56d54b3c214cf4e8af96af8b2 (patch) | |
| tree | 6e83890bc1b3814a12c3b7bedc0d5944f30f507b /app/Models/Factory.php | |
| parent | 42fd539a1b14f883077048a35864b4294b6efe94 (diff) | |
| parent | e91b72b63cd11ae3c4f59e48439e93955242c673 (diff) | |
Merge branch 'dev'
Conflicts:
CHANGELOG
README.fr.md
README.md
app/Controllers/feedController.php
app/Controllers/indexController.php
app/i18n/en.php
app/i18n/fr.php
app/views/helpers/view/normal_view.phtml
app/views/stats/index.phtml
app/views/stats/repartition.phtml
constants.php
p/scripts/main.js
Diffstat (limited to 'app/Models/Factory.php')
| -rw-r--r-- | app/Models/Factory.php | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/app/Models/Factory.php b/app/Models/Factory.php index 08569b2e2..db09d155d 100644 --- a/app/Models/Factory.php +++ b/app/Models/Factory.php @@ -2,30 +2,39 @@ class FreshRSS_Factory { - public static function createFeedDao() { - $db = Minz_Configuration::dataBase(); - if ($db['type'] === 'sqlite') { - return new FreshRSS_FeedDAOSQLite(); + 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(); + return new FreshRSS_FeedDAO($username); } } - public static function createEntryDao() { - $db = Minz_Configuration::dataBase(); - if ($db['type'] === 'sqlite') { - return new FreshRSS_EntryDAOSQLite(); + 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(); + return new FreshRSS_EntryDAO($username); } } - public static function createStatsDAO() { - $db = Minz_Configuration::dataBase(); - if ($db['type'] === 'sqlite') { - return new FreshRSS_StatsDAOSQLite(); + 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(); + 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); } } |
