diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-01-27 09:54:18 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-01-27 09:54:18 +0100 |
commit | 04e98e9890a453b19e4384270ef23ea8eec68481 (patch) | |
tree | a09e9dc05e9ce553d6b2682adf72f4772d87c0b5 /config/config.php | |
parent | 8241180c6ce0cb19255d70a3394f891e08182542 (diff) |
update config to use node based public filesystem
Diffstat (limited to 'config/config.php')
-rw-r--r-- | config/config.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/config/config.php b/config/config.php index 4df8ba853..c02a8872c 100644 --- a/config/config.php +++ b/config/config.php @@ -13,7 +13,8 @@ namespace OCA\News\Config; -use \OCP\ILogger; +use OCP\ILogger; +use OCP\Files\Folder; class Config { @@ -33,7 +34,8 @@ class Config { private $exploreUrl; - public function __construct($fileSystem, ILogger $logger, + public function __construct(Folder $fileSystem, + ILogger $logger, $LoggerParameters) { $this->fileSystem = $fileSystem; $this->autoPurgeMinimumInterval = 60; @@ -170,13 +172,13 @@ class Config { public function read($configPath, $createIfNotExists=false) { - if($createIfNotExists && !$this->fileSystem->file_exists($configPath)) { - + if($createIfNotExists && !$this->fileSystem->nodeExists($configPath)) { + $this->fileSystem->newFile($configPath); $this->write($configPath); } else { - $content = $this->fileSystem->file_get_contents($configPath); + $content = $this->fileSystem->get($configPath)->getContent(); $configValues = parse_ini_string($content); if($configValues === false || count($configValues) === 0) { @@ -223,7 +225,7 @@ class Config { var_export($this->useCronUpdates, true); ; - $this->fileSystem->file_put_contents($configPath, $ini); + $this->fileSystem->get($configPath)->putContent($ini); } |