diff options
author | Sean Molenaar <sean@seanmolenaar.eu> | 2020-09-20 22:03:05 +0200 |
---|---|---|
committer | Benjamin Brahmer <info@b-brahmer.de> | 2020-09-25 19:18:04 +0200 |
commit | 60ab4941cc7e6ede095e9e4aee3c2bf9a5c3bff6 (patch) | |
tree | baf0b07dd1c545efeb59437af46a99f4d9f69425 /lib/Config/FetcherConfig.php | |
parent | 2c8b4fa019749113658b9ed8cae211b679e4cbc0 (diff) |
Move to nextcloud config and update phpunit
Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
Diffstat (limited to 'lib/Config/FetcherConfig.php')
-rw-r--r-- | lib/Config/FetcherConfig.php | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/lib/Config/FetcherConfig.php b/lib/Config/FetcherConfig.php index 866f9a4f1..1e9b7941e 100644 --- a/lib/Config/FetcherConfig.php +++ b/lib/Config/FetcherConfig.php @@ -15,6 +15,7 @@ namespace OCA\News\Config; use FeedIo\Adapter\ClientInterface; use \GuzzleHttp\Client; +use OCA\News\AppInfo\Application; use OCA\News\Fetcher\Client\FeedIoClient; use OCA\News\Fetcher\Client\LegacyGuzzleClient; use OCP\IConfig; @@ -45,13 +46,6 @@ class FetcherConfig protected $redirects; /** - * Max size of the recieved data. - * @deprecated guzzle can't handle this - * @var string - */ - protected $max_size; - - /** * User agent for the client. * @var string */ @@ -96,8 +90,7 @@ class FetcherConfig $config['redirect.max'] = $this->redirects; } - $guzzle = new Client($config); - return $guzzle; + return new Client($config); } /** @@ -121,22 +114,28 @@ class FetcherConfig $config['request.options']['redirect.max'] = $this->redirects; } - $guzzle = new Client($config); - return $guzzle; + return new Client($config); } /** * Set settings for config. * - * @param Config $config The shared configuration + * @param IConfig $config The shared configuration * * @return self */ - public function setConfig(Config $config) + public function setConfig(IConfig $config) { - $this->client_timeout = $config->getFeedFetcherTimeout(); - $this->redirects = $config->getMaxRedirects(); - $this->max_size = $config->getMaxSize(); + $this->client_timeout = $config->getAppValue( + Application::NAME, + 'feedFetcherTimeout', + Application::DEFAULT_SETTINGS['feedFetcherTimeout'] + ); + $this->redirects = $config->getAppValue( + Application::NAME, + 'maxRedirects', + Application::DEFAULT_SETTINGS['maxRedirects'] + ); return $this; } |