summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/AppInfo/Application.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-04-19 11:47:06 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2016-06-09 11:09:13 +0200
commitf013cfc5309666729ee657b9084ead9e7f93a772 (patch)
treec0018377e9c64bda7a901d9a8fd936a54b5de541 /apps/dav/lib/AppInfo/Application.php
parentfbdec59f22a23a84b36248001bc8680d3746bb7b (diff)
downloadnextcloud-server-f013cfc5309666729ee657b9084ead9e7f93a772.tar.gz
nextcloud-server-f013cfc5309666729ee657b9084ead9e7f93a772.zip
Add migration step
Diffstat (limited to 'apps/dav/lib/AppInfo/Application.php')
-rw-r--r--apps/dav/lib/AppInfo/Application.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/dav/lib/AppInfo/Application.php b/apps/dav/lib/AppInfo/Application.php
index ba0ef421f97..0de61b12e26 100644
--- a/apps/dav/lib/AppInfo/Application.php
+++ b/apps/dav/lib/AppInfo/Application.php
@@ -31,10 +31,12 @@ use OCA\DAV\CardDAV\SyncService;
use OCA\DAV\Connector\Sabre\Principal;
use OCA\DAV\DAV\GroupPrincipalBackend;
use OCA\DAV\HookManager;
+use OCA\DAV\Migration\Classification;
use \OCP\AppFramework\App;
use OCP\AppFramework\IAppContainer;
use OCP\Contacts\IManager;
use OCP\IUser;
+use Sabre\VObject\Reader;
use Symfony\Component\EventDispatcher\GenericEvent;
class Application extends App {
@@ -168,4 +170,20 @@ class Application extends App {
$this->getContainer()->getServer()->getLogger()->logException($ex);
}
}
+
+ public function migrateClassification() {
+ try {
+ /** @var CalDavBackend $calDavBackend */
+ $calDavBackend = $this->getContainer()->query('CalDavBackend');
+ $migration = new Classification($calDavBackend);
+ $userManager = $this->getContainer()->getServer()->getUserManager();
+
+ $userManager->callForAllUsers(function($user) use($migration) {
+ /** @var IUser $user */
+ $migration->runForUser($user);
+ });
+ } catch (\Exception $ex) {
+ $this->getContainer()->getServer()->getLogger()->logException($ex);
+ }
+ }
}