diff options
author | Sean Molenaar <sean@seanmolenaar.eu> | 2020-08-29 23:39:35 +0200 |
---|---|---|
committer | Benjamin Brahmer <info@b-brahmer.de> | 2020-09-27 15:35:31 +0200 |
commit | d00d1ab2a28f428223e52b17052c072c64784016 (patch) | |
tree | c019f85fb7ac67147dd43ca64b4ac3cda99832f7 /lib/Cron/Updater.php | |
parent | 5687baca75d47dbdffd3de74e865ad2f71ef0cb7 (diff) |
Create V2 mapper, Service and management commands
Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
Diffstat (limited to 'lib/Cron/Updater.php')
-rw-r--r-- | lib/Cron/Updater.php | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/lib/Cron/Updater.php b/lib/Cron/Updater.php deleted file mode 100644 index 3d9336df7..000000000 --- a/lib/Cron/Updater.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php -/** - * Nextcloud - News - * - * This file is licensed under the Affero General Public License version 3 or - * later. See the COPYING file. - * - * @author Bernhard Posselt <dev@bernhard-posselt.com> - * @copyright 2012-2014 Bernhard Posselt - */ - -namespace OCA\News\Cron; - -use OC\BackgroundJob\TimedJob; - -use OCA\News\AppInfo\Application; -use OCA\News\Service\StatusService; -use OCA\News\Utility\Updater as UpdaterService; -use OCP\IConfig; - -class Updater extends TimedJob -{ - - /** - * @var IConfig - */ - private $config; - /** - * @var StatusService - */ - private $status; - /** - * @var UpdaterService - */ - private $updaterService; - - public function __construct( - IConfig $config, - StatusService $status, - UpdaterService $updaterService - ) { - $this->config = $config; - $this->status = $status; - $this->updaterService = $updaterService; - - $interval = $this->config->getAppValue( - Application::NAME, - 'updateInterval', - Application::DEFAULT_SETTINGS['updateInterval'] - ); - - parent::setInterval($interval); - } - - protected function run($argument) - { - $uses_cron = $this->config->getAppValue( - Application::NAME, - 'useCronUpdates', - Application::DEFAULT_SETTINGS['useCronUpdates'] - ); - - if ($uses_cron && $this->status->isProperlyConfigured()) { - $this->updaterService->beforeUpdate(); - $this->updaterService->update(); - $this->updaterService->afterUpdate(); - } - } -} |