diff options
Diffstat (limited to 'config/config.php')
-rw-r--r-- | config/config.php | 290 |
1 files changed, 145 insertions, 145 deletions
diff --git a/config/config.php b/config/config.php index d84e4076c..25e8a2294 100644 --- a/config/config.php +++ b/config/config.php @@ -18,179 +18,179 @@ use \OCP\ILogger; class Config { - private $fileSystem; - private $autoPurgeMinimumInterval; // seconds, used to define how - // long deleted folders and feeds - // should still be kept for an - // undo actions - private $autoPurgeCount; // number of allowed unread articles per feed - private $simplePieCacheDuration; // seconds - private $feedFetcherTimeout; // seconds - private $useCronUpdates; // turn off updates run by owncloud cronjob - private $proxyHost; - private $proxyPort; - private $proxyUser; - private $proxyPassword; - private $logger; - private $loggerParams; + private $fileSystem; + private $autoPurgeMinimumInterval; // seconds, used to define how + // long deleted folders and feeds + // should still be kept for an + // undo actions + private $autoPurgeCount; // number of allowed unread articles per feed + private $simplePieCacheDuration; // seconds + private $feedFetcherTimeout; // seconds + private $useCronUpdates; // turn off updates run by owncloud cronjob + private $proxyHost; + private $proxyPort; + private $proxyUser; + private $proxyPassword; + private $logger; + private $loggerParams; - public function __construct($fileSystem, ILogger $logger, $loggerParams) { - $this->fileSystem = $fileSystem; - $this->autoPurgeMinimumInterval = 60; - $this->autoPurgeCount = 200; - $this->simplePieCacheDuration = 30*60; - $this->feedFetcherTimeout = 60; - $this->useCronUpdates = true; - $this->logger = $logger; - $this->proxyHost = ''; - $this->proxyPort = 8080; - $this->proxyUser = ''; - $this->proxyPassword = ''; - $this->loggerParams = $loggerParams; - } + public function __construct($fileSystem, ILogger $logger, $loggerParams) { + $this->fileSystem = $fileSystem; + $this->autoPurgeMinimumInterval = 60; + $this->autoPurgeCount = 200; + $this->simplePieCacheDuration = 30*60; + $this->feedFetcherTimeout = 60; + $this->useCronUpdates = true; + $this->logger = $logger; + $this->proxyHost = ''; + $this->proxyPort = 8080; + $this->proxyUser = ''; + $this->proxyPassword = ''; + $this->loggerParams = $loggerParams; + } - public function getProxyPort() { - return $this->proxyPort; - } + public function getProxyPort() { + return $this->proxyPort; + } - public function getProxyHost() { - return $this->proxyHost; - } + public function getProxyHost() { + return $this->proxyHost; + } - public function getProxyAuth() { - if($this->proxyUser === '') { - return null; - } else { - return $this->proxyUser . ':' . $this->proxyPassword; - } - } + public function getProxyAuth() { + if($this->proxyUser === '') { + return null; + } else { + return $this->proxyUser . ':' . $this->proxyPassword; + } + } - public function getProxyUser() { - return $this->proxyUser; - } + public function getProxyUser() { + return $this->proxyUser; + } - public function getProxyPassword() { - return $this->proxyPassword; - } + public function getProxyPassword() { + return $this->proxyPassword; + } - public function getAutoPurgeMinimumInterval() { - if ($this->autoPurgeMinimumInterval > 60) { - return $this->autoPurgeMinimumInterval; - } else { - return 60; - } - } + public function getAutoPurgeMinimumInterval() { + if ($this->autoPurgeMinimumInterval > 60) { + return $this->autoPurgeMinimumInterval; + } else { + return 60; + } + } - public function getAutoPurgeCount() { - return $this->autoPurgeCount; - } - - - public function getSimplePieCacheDuration() { - return $this->simplePieCacheDuration; - } - - - public function getFeedFetcherTimeout() { - return $this->feedFetcherTimeout; - } - - - public function getUseCronUpdates() { - return $this->useCronUpdates; - } - - - public function setAutoPurgeMinimumInterval($value) { - $this->autoPurgeMinimumInterval = $value; - } - - - public function setAutoPurgeCount($value) { - $this->autoPurgeCount = $value; - } - - - public function setSimplePieCacheDuration($value) { - $this->simplePieCacheDuration = $value; - } - - - public function setFeedFetcherTimeout($value) { - $this->feedFetcherTimeout = $value; - } + public function getAutoPurgeCount() { + return $this->autoPurgeCount; + } + + + public function getSimplePieCacheDuration() { + return $this->simplePieCacheDuration; + } + + + public function getFeedFetcherTimeout() { + return $this->feedFetcherTimeout; + } + + + public function getUseCronUpdates() { + return $this->useCronUpdates; + } + + + public function setAutoPurgeMinimumInterval($value) { + $this->autoPurgeMinimumInterval = $value; + } + + + public function setAutoPurgeCount($value) { + $this->autoPurgeCount = $value; + } + + + public function setSimplePieCacheDuration($value) { + $this->simplePieCacheDuration = $value; + } + + + public function setFeedFetcherTimeout($value) { + $this->feedFetcherTimeout = $value; + } - public function setUseCronUpdates($value) { - $this->useCronUpdates = $value; - } + public function setUseCronUpdates($value) { + $this->useCronUpdates = $value; + } - public function setProxyPort($value) { - $this->proxyPort = $value; - } + public function setProxyPort($value) { + $this->proxyPort = $value; + } - public function setProxyHost($value) { - $this->proxyHost = $value; - } + public function setProxyHost($value) { + $this->proxyHost = $value; + } - public function setProxyUser($value) { - $this->proxyUser = $value; - } + public function setProxyUser($value) { + $this->proxyUser = $value; + } - public function setProxyPassword($value) { - $this->proxyPassword = $value; - } + public function setProxyPassword($value) { + $this->proxyPassword = $value; + } - public function read($configPath, $createIfNotExists=false) { - if($createIfNotExists && !$this->fileSystem->file_exists($configPath)) { + public function read($configPath, $createIfNotExists=false) { + if($createIfNotExists && !$this->fileSystem->file_exists($configPath)) { - $this->write($configPath); + $this->write($configPath); - } else { + } else { - $content = $this->fileSystem->file_get_contents($configPath); - $configValues = parse_ini_string($content); + $content = $this->fileSystem->file_get_contents($configPath); + $configValues = parse_ini_string($content); - if($configValues === false || count($configValues) === 0) { - $this->logger->warning('Configuration invalid. Ignoring values.', - $this->loggerParams); - } else { + if($configValues === false || count($configValues) === 0) { + $this->logger->warning('Configuration invalid. Ignoring values.', + $this->loggerParams); + } else { - foreach($configValues as $key => $value) { - if(property_exists($this, $key)) { - $type = gettype($this->$key); - settype($value, $type); - $this->$key = $value; - } else { - $this->logger->warning('Configuration value "' . $key . - '" does not exist. Ignored value.' , $this->loggerParams); - } - } + foreach($configValues as $key => $value) { + if(property_exists($this, $key)) { + $type = gettype($this->$key); + settype($value, $type); + $this->$key = $value; + } else { + $this->logger->warning('Configuration value "' . $key . + '" does not exist. Ignored value.' , $this->loggerParams); + } + } - } - } - } + } + } + } - public function write($configPath) { - $ini = - "autoPurgeMinimumInterval = " . $this->autoPurgeMinimumInterval . "\n" . - "autoPurgeCount = " . $this->autoPurgeCount . "\n" . - "simplePieCacheDuration = " . $this->simplePieCacheDuration . "\n" . - "feedFetcherTimeout = " . $this->feedFetcherTimeout . "\n" . - "useCronUpdates = " . var_export($this->useCronUpdates, true) . "\n" . - "proxyHost = " . $this->proxyHost . "\n" . - "proxyPort = " . $this->proxyPort . "\n" . - "proxyUser = " . $this->proxyUser . "\n" . - "proxyPassword = " . $this->proxyPassword; - ; + public function write($configPath) { + $ini = + "autoPurgeMinimumInterval = " . $this->autoPurgeMinimumInterval . "\n" . + "autoPurgeCount = " . $this->autoPurgeCount . "\n" . + "simplePieCacheDuration = " . $this->simplePieCacheDuration . "\n" . + "feedFetcherTimeout = " . $this->feedFetcherTimeout . "\n" . + "useCronUpdates = " . var_export($this->useCronUpdates, true) . "\n" . + "proxyHost = " . $this->proxyHost . "\n" . + "proxyPort = " . $this->proxyPort . "\n" . + "proxyUser = " . $this->proxyUser . "\n" . + "proxyPassword = " . $this->proxyPassword; + ; - $this->fileSystem->file_put_contents($configPath, $ini); - } + $this->fileSystem->file_put_contents($configPath, $ini); + } }
\ No newline at end of file |