diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-19 13:20:54 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-19 13:21:11 +0200 |
commit | 517e4ca5435106ab5304849248cbea4e9dffd4b0 (patch) | |
tree | 0f00076f012791b39c710994f695abf723546062 /utility/config.php | |
parent | bd35b98d2c130f058b182f726636ee971625823b (diff) |
split up api class for easier testing and clearer code
Diffstat (limited to 'utility/config.php')
-rw-r--r-- | utility/config.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/utility/config.php b/utility/config.php index d415595b7..b2416ce9a 100644 --- a/utility/config.php +++ b/utility/config.php @@ -25,7 +25,7 @@ namespace OCA\News\Utility; -use \OCA\News\Core\API; +use \OCA\News\Core\Logger; class Config { @@ -43,17 +43,17 @@ class Config { private $proxyPort; private $proxyUser; private $proxyPassword; - private $api; + private $logger; - public function __construct($fileSystem, API $api) { + public function __construct($fileSystem, Logger $logger) { $this->fileSystem = $fileSystem; $this->autoPurgeMinimumInterval = 60; $this->autoPurgeCount = 200; $this->simplePieCacheDuration = 30*60; $this->feedFetcherTimeout = 60; $this->useCronUpdates = true; - $this->api = $api; + $this->logger = $logger; $this->proxyHost = ''; $this->proxyPort = 8080; $this->proxyUser = ''; @@ -162,7 +162,7 @@ class Config { $configValues = parse_ini_string($content); if($configValues === false || count($configValues) === 0) { - $this->api->log('Configuration invalid. Ignoring values.' , 'warn'); + $this->logger->log('Configuration invalid. Ignoring values.' , 'warn'); } else { foreach($configValues as $key => $value) { @@ -171,7 +171,7 @@ class Config { settype($value, $type); $this->$key = $value; } else { - $this->api->log('Configuration value "' . $key . + $this->logger->log('Configuration value "' . $key . '" does not exist. Ignored value.' , 'warn'); } } |