From 51eef892a42e12132813fa670820f63deb5f8b0f Mon Sep 17 00:00:00 2001 From: Matthias Held Date: Mon, 30 Sep 2019 20:54:56 +0200 Subject: update notifier to nextcloud version 17 --- .travis.yml | 10 +++++++++- lib/AppInfo/Application.php | 11 +---------- lib/Notification/Notifier.php | 20 ++++++++++++++++++++ 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index f479b51..d9b08a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: php env: global: - - CORE_BRANCH=stable16 + - CORE_BRANCH=stable17 - APP_NAME=ransomware_detection branches: @@ -49,6 +49,14 @@ jobs: script: - cd apps/$APP_NAME/ - phpunit --configuration phpunit.xml + - stage: test + php: 7.0 + env: + - DB=sqlite + - CORE_BRANCH=stable16 + script: + - cd apps/$APP_NAME/ + - phpunit --configuration phpunit.xml - stage: test php: 7.1 env: diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index e3827bf..dedb5af 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -174,15 +174,6 @@ class Application extends App protected function registerNotificationNotifier() { - $this->getContainer()->getServer()->getNotificationManager()->registerNotifier(function () { - return $this->getContainer()->query(Notifier::class); - }, function () { - $l = $this->getContainer()->getServer()->getL10NFactory()->get(self::APP_ID); - - return [ - 'id' => self::APP_ID, - 'name' => $l->t('Ransomware recovery'), - ]; - }); + $this->getContainer()->getServer()->getNotificationManager()->registerNotifierService(Notifier::class); } } diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index b7a19bd..e85cca0 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -96,4 +96,24 @@ class Notifier implements INotifier throw new \InvalidArgumentException('Unknown subject'); } } + + /** + * Identifier of the notifier, only use [a-z0-9_] + * + * @return string + * @since 17.0.0 + */ + public function getID(): string { + return Application::APP_ID; + } + + /** + * Human readable name describing the notifier + * + * @return string + * @since 17.0.0 + */ + public function getName(): string { + return $this->l10nFactory->get(Application::APP_ID)->t('Ransomware recovery'); + } } -- cgit v1.2.3 From 1f7961db330bb5152a15fc3dca1803dd0f7a9766 Mon Sep 17 00:00:00 2001 From: Matthias Held Date: Mon, 30 Sep 2019 21:01:41 +0200 Subject: adjust nextcloud version --- .travis.yml | 32 -------------------------------- appinfo/info.xml | 2 +- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/.travis.yml b/.travis.yml index d9b08a5..bb32c7d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,38 +25,6 @@ jobs: allow_failures: - env: "CHECKSTYLE=2" include: - - stage: test - php: 7.0 - env: - - DB=sqlite - - CORE_BRANCH=stable13 - script: - - cd apps/$APP_NAME/ - - phpunit --configuration phpunit.xml - - stage: test - php: 7.0 - env: - - DB=sqlite - - CORE_BRANCH=stable14 - script: - - cd apps/$APP_NAME/ - - phpunit --configuration phpunit.xml - - stage: test - php: 7.0 - env: - - DB=sqlite - - CORE_BRANCH=stable15 - script: - - cd apps/$APP_NAME/ - - phpunit --configuration phpunit.xml - - stage: test - php: 7.0 - env: - - DB=sqlite - - CORE_BRANCH=stable16 - script: - - cd apps/$APP_NAME/ - - phpunit --configuration phpunit.xml - stage: test php: 7.1 env: diff --git a/appinfo/info.xml b/appinfo/info.xml index e507073..97dae9c 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -20,7 +20,7 @@ https://github.com/undo-ransomware/ransomware_detection/raw/master/screenshots/monitoring-0.3.0.png https://github.com/undo-ransomware/ransomware_detection/raw/master/screenshots/scan-files-0.3.0.png - + -- cgit v1.2.3 From c6ca2abfcb494dad0bd056582e1edfae45246023 Mon Sep 17 00:00:00 2001 From: Matthias Held Date: Mon, 30 Sep 2019 21:05:13 +0200 Subject: add mysql and postgresql service --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index bb32c7d..e60d12f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,10 @@ env: - CORE_BRANCH=stable17 - APP_NAME=ransomware_detection +services: + - mysql + - postgresql + branches: only: - master -- cgit v1.2.3 From 5dab8b20593414e54a9053f9a3726fa682b03d00 Mon Sep 17 00:00:00 2001 From: Matthias Held Date: Mon, 30 Sep 2019 21:10:58 +0200 Subject: adjust prepare method --- lib/Notification/Notifier.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index e85cca0..c3dcc6d 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -74,7 +74,7 @@ class Notifier implements INotifier * * @return INotification */ - public function prepare(INotification $notification, $languageCode) + public function prepare(INotification $notification, string $languageCode): INotification { if ($notification->getApp() !== Application::APP_ID) { // Not my app => throw -- cgit v1.2.3 From 9162906220444f6998300954ea7f433e2f12e3c1 Mon Sep 17 00:00:00 2001 From: Matthias Held Date: Mon, 30 Sep 2019 21:15:49 +0200 Subject: bump version and update changelog --- CHANGELOG.md | 6 ++++++ appinfo/info.xml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 783b788..85c9b5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## 0.6.0 + +### Added + +- Nextcloud version 17 support. + ## 0.5.2 ### Fixed diff --git a/appinfo/info.xml b/appinfo/info.xml index 97dae9c..edd5605 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -5,7 +5,7 @@ Ransomware recovery - 0.5.2 + 0.6.0 agpl Matthias Held RansomwareDetection -- cgit v1.2.3