Completed
Pull Request — master (#10059)
by Georg
16:31
created
apps/dav/appinfo/app.php 1 patch
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -31,59 +31,59 @@  discard block
 block discarded – undo
31 31
 $app->registerHooks();
32 32
 
33 33
 \OC::$server->registerService('CardDAVSyncService', function() use ($app) {
34
-	return $app->getSyncService();
34
+    return $app->getSyncService();
35 35
 });
36 36
 
37 37
 $eventDispatcher = \OC::$server->getEventDispatcher();
38 38
 
39 39
 $eventDispatcher->addListener('OCP\Federation\TrustedServerEvent::remove',
40
-	function(GenericEvent $event) use ($app) {
41
-		/** @var CardDavBackend $cardDavBackend */
42
-		$cardDavBackend = $app->getContainer()->query(CardDavBackend::class);
43
-		$addressBookUri = $event->getSubject();
44
-		$addressBook = $cardDavBackend->getAddressBooksByUri('principals/system/system', $addressBookUri);
45
-		if (!is_null($addressBook)) {
46
-			$cardDavBackend->deleteAddressBook($addressBook['id']);
47
-		}
48
-	}
40
+    function(GenericEvent $event) use ($app) {
41
+        /** @var CardDavBackend $cardDavBackend */
42
+        $cardDavBackend = $app->getContainer()->query(CardDavBackend::class);
43
+        $addressBookUri = $event->getSubject();
44
+        $addressBook = $cardDavBackend->getAddressBooksByUri('principals/system/system', $addressBookUri);
45
+        if (!is_null($addressBook)) {
46
+            $cardDavBackend->deleteAddressBook($addressBook['id']);
47
+        }
48
+    }
49 49
 );
50 50
 
51 51
 $eventDispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::createSubscription',
52
-	function(GenericEvent $event) use ($app) {
53
-		$jobList = $app->getContainer()->getServer()->getJobList();
54
-		$subscriptionData = $event->getArgument('subscriptionData');
52
+    function(GenericEvent $event) use ($app) {
53
+        $jobList = $app->getContainer()->getServer()->getJobList();
54
+        $subscriptionData = $event->getArgument('subscriptionData');
55 55
 
56
-		$jobList->add(\OCA\DAV\BackgroundJob\RefreshWebcalJob::class, [
57
-			'principaluri' => $subscriptionData['principaluri'],
58
-			'uri' => $subscriptionData['uri']
59
-		]);
60
-	}
56
+        $jobList->add(\OCA\DAV\BackgroundJob\RefreshWebcalJob::class, [
57
+            'principaluri' => $subscriptionData['principaluri'],
58
+            'uri' => $subscriptionData['uri']
59
+        ]);
60
+    }
61 61
 );
62 62
 
63 63
 $eventDispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::deleteSubscription',
64
-	function(GenericEvent $event) use ($app) {
65
-		$jobList = $app->getContainer()->getServer()->getJobList();
66
-		$subscriptionData = $event->getArgument('subscriptionData');
64
+    function(GenericEvent $event) use ($app) {
65
+        $jobList = $app->getContainer()->getServer()->getJobList();
66
+        $subscriptionData = $event->getArgument('subscriptionData');
67 67
 
68
-		$jobList->remove(\OCA\DAV\BackgroundJob\RefreshWebcalJob::class, [
69
-			'principaluri' => $subscriptionData['principaluri'],
70
-			'uri' => $subscriptionData['uri']
71
-		]);
68
+        $jobList->remove(\OCA\DAV\BackgroundJob\RefreshWebcalJob::class, [
69
+            'principaluri' => $subscriptionData['principaluri'],
70
+            'uri' => $subscriptionData['uri']
71
+        ]);
72 72
 
73
-		/** @var \OCA\DAV\CalDAV\CalDavBackend $calDavBackend */
74
-		$calDavBackend = $app->getContainer()->query(\OCA\DAV\CalDAV\CalDavBackend::class);
75
-		$calDavBackend->purgeAllCachedEventsForSubscription($subscriptionData['id']);
76
-	}
73
+        /** @var \OCA\DAV\CalDAV\CalDavBackend $calDavBackend */
74
+        $calDavBackend = $app->getContainer()->query(\OCA\DAV\CalDAV\CalDavBackend::class);
75
+        $calDavBackend->purgeAllCachedEventsForSubscription($subscriptionData['id']);
76
+    }
77 77
 );
78 78
 
79 79
 $eventHandler = function() use ($app) {
80
-	try {
81
-		$job = $app->getContainer()->query(\OCA\DAV\BackgroundJob\UpdateCalendarResourcesRoomsBackgroundJob::class);
82
-		$job->run([]);
83
-		$app->getContainer()->getServer()->getJobList()->setLastRun($job);
84
-	} catch(\Exception $ex) {
85
-		$app->getContainer()->getServer()->getLogger()->logException($ex);
86
-	}
80
+    try {
81
+        $job = $app->getContainer()->query(\OCA\DAV\BackgroundJob\UpdateCalendarResourcesRoomsBackgroundJob::class);
82
+        $job->run([]);
83
+        $app->getContainer()->getServer()->getJobList()->setLastRun($job);
84
+    } catch(\Exception $ex) {
85
+        $app->getContainer()->getServer()->getLogger()->logException($ex);
86
+    }
87 87
 };
88 88
 
89 89
 $eventDispatcher->addListener('\OCP\Calendar\Resource\ForceRefreshEvent', $eventHandler);
@@ -91,18 +91,18 @@  discard block
 block discarded – undo
91 91
 
92 92
 $cm = \OC::$server->getContactsManager();
93 93
 $cm->register(function() use ($cm, $app) {
94
-	$user = \OC::$server->getUserSession()->getUser();
95
-	if (!is_null($user)) {
96
-		$app->setupContactsProvider($cm, $user->getUID());
97
-	} else {
98
-		$app->setupSystemContactsProvider($cm);
99
-	}
94
+    $user = \OC::$server->getUserSession()->getUser();
95
+    if (!is_null($user)) {
96
+        $app->setupContactsProvider($cm, $user->getUID());
97
+    } else {
98
+        $app->setupSystemContactsProvider($cm);
99
+    }
100 100
 });
101 101
 
102 102
 $calendarManager = \OC::$server->getCalendarManager();
103 103
 $calendarManager->register(function() use ($calendarManager, $app) {
104
-	$user = \OC::$server->getUserSession()->getUser();
105
-	if ($user !== null) {
106
-		$app->setupCalendarProvider($calendarManager, $user->getUID());
107
-	}
104
+    $user = \OC::$server->getUserSession()->getUser();
105
+    if ($user !== null) {
106
+        $app->setupCalendarProvider($calendarManager, $user->getUID());
107
+    }
108 108
 });
Please login to merge, or discard this patch.
apps/dav/lib/CalDAV/WebcalCaching/Plugin.php 1 patch
Indentation   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -36,115 +36,115 @@
 block discarded – undo
36 36
 
37 37
 class Plugin extends ServerPlugin {
38 38
 
39
-	/**
40
-	 * list of regular expressions for calendar user agents,
41
-	 * that do not support subscriptions on their own
42
-	 *
43
-	 * @var string[]
44
-	 */
45
-	const ENABLE_FOR_CLIENTS = [
46
-		// TODO - fill me
47
-	];
39
+    /**
40
+     * list of regular expressions for calendar user agents,
41
+     * that do not support subscriptions on their own
42
+     *
43
+     * @var string[]
44
+     */
45
+    const ENABLE_FOR_CLIENTS = [
46
+        // TODO - fill me
47
+    ];
48 48
 
49
-	/**
50
-	 * @var bool
51
-	 */
52
-	private $enabled=false;
49
+    /**
50
+     * @var bool
51
+     */
52
+    private $enabled=false;
53 53
 
54
-	/**
55
-	 * @var Server
56
-	 */
57
-	private $server;
54
+    /**
55
+     * @var Server
56
+     */
57
+    private $server;
58 58
 
59
-	/**
60
-	 * Plugin constructor.
61
-	 *
62
-	 * @param IRequest $request
63
-	 */
64
-	public function __construct(IRequest $request) {
65
-		if ($request->isUserAgent(self::ENABLE_FOR_CLIENTS)) {
66
-			$this->enabled = true;
67
-		}
59
+    /**
60
+     * Plugin constructor.
61
+     *
62
+     * @param IRequest $request
63
+     */
64
+    public function __construct(IRequest $request) {
65
+        if ($request->isUserAgent(self::ENABLE_FOR_CLIENTS)) {
66
+            $this->enabled = true;
67
+        }
68 68
 
69
-		$magicHeader = $request->getHeader('X-NC-CALDAV-WEBCAL-CACHING');
70
-		if ($magicHeader === 'ON') {
71
-			$this->enabled = true;
72
-		}
73
-	}
69
+        $magicHeader = $request->getHeader('X-NC-CALDAV-WEBCAL-CACHING');
70
+        if ($magicHeader === 'ON') {
71
+            $this->enabled = true;
72
+        }
73
+    }
74 74
 
75
-	/**
76
-	 * This initializes the plugin.
77
-	 *
78
-	 * This function is called by Sabre\DAV\Server, after
79
-	 * addPlugin is called.
80
-	 *
81
-	 * This method should set up the required event subscriptions.
82
-	 *
83
-	 * @param Server $server
84
-	 */
85
-	public function initialize(Server $server) {
86
-		$this->server = $server;
87
-		$server->on('beforeMethod', [$this, 'beforeMethod']);
88
-	}
75
+    /**
76
+     * This initializes the plugin.
77
+     *
78
+     * This function is called by Sabre\DAV\Server, after
79
+     * addPlugin is called.
80
+     *
81
+     * This method should set up the required event subscriptions.
82
+     *
83
+     * @param Server $server
84
+     */
85
+    public function initialize(Server $server) {
86
+        $this->server = $server;
87
+        $server->on('beforeMethod', [$this, 'beforeMethod']);
88
+    }
89 89
 
90
-	/**
91
-	 * @param RequestInterface $request
92
-	 * @param ResponseInterface $response
93
-	 */
94
-	public function beforeMethod(RequestInterface $request, ResponseInterface $response) {
95
-		if (!$this->enabled) {
96
-			return;
97
-		}
90
+    /**
91
+     * @param RequestInterface $request
92
+     * @param ResponseInterface $response
93
+     */
94
+    public function beforeMethod(RequestInterface $request, ResponseInterface $response) {
95
+        if (!$this->enabled) {
96
+            return;
97
+        }
98 98
 
99
-		$path = $request->getPath();
100
-		$pathParts = explode('/', ltrim($path, '/'));
101
-		if (\count($pathParts) < 2) {
102
-			return;
103
-		}
99
+        $path = $request->getPath();
100
+        $pathParts = explode('/', ltrim($path, '/'));
101
+        if (\count($pathParts) < 2) {
102
+            return;
103
+        }
104 104
 
105
-		// $calendarHomePath will look like: calendars/username
106
-		$calendarHomePath = $pathParts[0] . '/' . $pathParts[1];
107
-		try {
108
-			$calendarHome = $this->server->tree->getNodeForPath($calendarHomePath);
109
-			if (!($calendarHome instanceof CalendarHome)) {
110
-				//how did we end up here?
111
-				return;
112
-			}
105
+        // $calendarHomePath will look like: calendars/username
106
+        $calendarHomePath = $pathParts[0] . '/' . $pathParts[1];
107
+        try {
108
+            $calendarHome = $this->server->tree->getNodeForPath($calendarHomePath);
109
+            if (!($calendarHome instanceof CalendarHome)) {
110
+                //how did we end up here?
111
+                return;
112
+            }
113 113
 
114
-			$calendarHome->enableCachedSubscriptionsForThisRequest();
115
-		} catch(NotFound $ex) {
116
-			return;
117
-		}
118
-	}
114
+            $calendarHome->enableCachedSubscriptionsForThisRequest();
115
+        } catch(NotFound $ex) {
116
+            return;
117
+        }
118
+    }
119 119
 
120
-	/**
121
-	 * @return bool
122
-	 */
123
-	public function isCachingEnabledForThisRequest():bool {
124
-		return $this->enabled;
125
-	}
120
+    /**
121
+     * @return bool
122
+     */
123
+    public function isCachingEnabledForThisRequest():bool {
124
+        return $this->enabled;
125
+    }
126 126
 
127
-	/**
128
-	 * This method should return a list of server-features.
129
-	 *
130
-	 * This is for example 'versioning' and is added to the DAV: header
131
-	 * in an OPTIONS response.
132
-	 *
133
-	 * @return string[]
134
-	 */
135
-	public function getFeatures():array {
136
-		return ['nc-calendar-webcal-cache'];
137
-	}
127
+    /**
128
+     * This method should return a list of server-features.
129
+     *
130
+     * This is for example 'versioning' and is added to the DAV: header
131
+     * in an OPTIONS response.
132
+     *
133
+     * @return string[]
134
+     */
135
+    public function getFeatures():array {
136
+        return ['nc-calendar-webcal-cache'];
137
+    }
138 138
 
139
-	/**
140
-	 * Returns a plugin name.
141
-	 *
142
-	 * Using this name other plugins will be able to access other plugins
143
-	 * using Sabre\DAV\Server::getPlugin
144
-	 *
145
-	 * @return string
146
-	 */
147
-	public function getPluginName():string {
148
-		return 'nc-calendar-webcal-cache';
149
-	}
139
+    /**
140
+     * Returns a plugin name.
141
+     *
142
+     * Using this name other plugins will be able to access other plugins
143
+     * using Sabre\DAV\Server::getPlugin
144
+     *
145
+     * @return string
146
+     */
147
+    public function getPluginName():string {
148
+        return 'nc-calendar-webcal-cache';
149
+    }
150 150
 }
Please login to merge, or discard this patch.
apps/dav/lib/CalDAV/CachedSubscription.php 1 patch
Indentation   +136 added lines, -136 removed lines patch added patch discarded remove patch
@@ -36,140 +36,140 @@
 block discarded – undo
36 36
  */
37 37
 class CachedSubscription extends \Sabre\CalDAV\Calendar {
38 38
 
39
-	/**
40
-	 * @return string
41
-	 */
42
-	public function getPrincipalURI():string {
43
-		return $this->calendarInfo['principaluri'];
44
-	}
45
-
46
-	/**
47
-	 * @return array
48
-	 */
49
-	public function getACL():array {
50
-		return [
51
-			[
52
-				'privilege' => '{DAV:}read',
53
-				'principal' => $this->getOwner(),
54
-				'protected' => true,
55
-			]
56
-		];
57
-	}
58
-
59
-	/**
60
-	 * @return array
61
-	 */
62
-	public function getChildACL():array {
63
-		return $this->getACL();
64
-	}
65
-
66
-	/**
67
-	 * @return null|string
68
-	 */
69
-	public function getOwner() {
70
-		if (isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal'])) {
71
-			return $this->calendarInfo['{http://owncloud.org/ns}owner-principal'];
72
-		}
73
-		return parent::getOwner();
74
-	}
75
-
76
-	/**
77
-	 *
78
-	 */
79
-	public function delete() {
80
-		$this->caldavBackend->deleteSubscription($this->calendarInfo['id']);
81
-	}
82
-
83
-	/**
84
-	 * @param PropPatch $propPatch
85
-	 */
86
-	public function propPatch(PropPatch $propPatch) {
87
-		$this->caldavBackend->updateSubscription($this->calendarInfo['id'], $propPatch);
88
-	}
89
-
90
-	/**
91
-	 * @param string $name
92
-	 * @return CalendarObject|\Sabre\CalDAV\ICalendarObject
93
-	 * @throws NotFound
94
-	 */
95
-	public function getChild($name) {
96
-		$obj = $this->caldavBackend->getCachedCalendarObject($this->calendarInfo['id'], $name);
97
-		if (!$obj) {
98
-			throw new NotFound('Calendar object not found');
99
-		}
100
-
101
-		$obj['acl'] = $this->getChildACL();
102
-		return new CalendarObject($this->caldavBackend, $this->calendarInfo, $obj);
103
-
104
-	}
105
-
106
-	/**
107
-	 * @return array
108
-	 */
109
-	public function getChildren():array {
110
-		$objs = $this->caldavBackend->getCachedCalendarObjects($this->calendarInfo['id']);
111
-
112
-		$children = [];
113
-		foreach($objs as $obj) {
114
-			$children[] = new CachedSubscriptionObject($this->caldavBackend, $this->calendarInfo, $obj);
115
-		}
116
-
117
-		return $children;
118
-	}
119
-
120
-	/**
121
-	 * @param array $paths
122
-	 * @return array
123
-	 */
124
-	public function getMultipleChildren(array $paths):array {
125
-		$objs = $this->caldavBackend->getMultipleCachedCalendarObjects($this->calendarInfo['id'], $paths);
126
-
127
-		$children = [];
128
-		foreach($objs as $obj) {
129
-			$children[] = new CachedSubscriptionObject($this->caldavBackend, $this->calendarInfo, $obj);
130
-		}
131
-
132
-		return $children;
133
-	}
134
-
135
-	/**
136
-	 * @param string $name
137
-	 * @param null $calendarData
138
-	 * @return null|string|void
139
-	 * @throws MethodNotAllowed
140
-	 */
141
-	public function createFile($name, $calendarData = null) {
142
-		throw new MethodNotAllowed('Creating objects in cached subscription is not allowed');
143
-	}
144
-
145
-	/**
146
-	 * @param string $name
147
-	 * @return bool
148
-	 */
149
-	public function childExists($name):bool {
150
-		$obj = $this->caldavBackend->getCachedCalendarObject($this->calendarInfo['id'], $name);
151
-		if (!$obj) {
152
-			return false;
153
-		}
154
-
155
-		return true;
156
-	}
157
-
158
-	/**
159
-	 * @param array $filters
160
-	 * @return array
161
-	 */
162
-	public function calendarQuery(array $filters):array {
163
-		return $this->caldavBackend->cachedCalendarQuery($this->calendarInfo['id'], $filters);
164
-	}
165
-
166
-	/**
167
-	 * CachedSubscriptions don't support sync-tokens for now
168
-	 * Clients will have to do a multi get etag for now
169
-	 *
170
-	 * @return null
171
-	 */
172
-	public function getSyncToken() {
173
-		return null;
174
-	}
39
+    /**
40
+     * @return string
41
+     */
42
+    public function getPrincipalURI():string {
43
+        return $this->calendarInfo['principaluri'];
44
+    }
45
+
46
+    /**
47
+     * @return array
48
+     */
49
+    public function getACL():array {
50
+        return [
51
+            [
52
+                'privilege' => '{DAV:}read',
53
+                'principal' => $this->getOwner(),
54
+                'protected' => true,
55
+            ]
56
+        ];
57
+    }
58
+
59
+    /**
60
+     * @return array
61
+     */
62
+    public function getChildACL():array {
63
+        return $this->getACL();
64
+    }
65
+
66
+    /**
67
+     * @return null|string
68
+     */
69
+    public function getOwner() {
70
+        if (isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal'])) {
71
+            return $this->calendarInfo['{http://owncloud.org/ns}owner-principal'];
72
+        }
73
+        return parent::getOwner();
74
+    }
75
+
76
+    /**
77
+     *
78
+     */
79
+    public function delete() {
80
+        $this->caldavBackend->deleteSubscription($this->calendarInfo['id']);
81
+    }
82
+
83
+    /**
84
+     * @param PropPatch $propPatch
85
+     */
86
+    public function propPatch(PropPatch $propPatch) {
87
+        $this->caldavBackend->updateSubscription($this->calendarInfo['id'], $propPatch);
88
+    }
89
+
90
+    /**
91
+     * @param string $name
92
+     * @return CalendarObject|\Sabre\CalDAV\ICalendarObject
93
+     * @throws NotFound
94
+     */
95
+    public function getChild($name) {
96
+        $obj = $this->caldavBackend->getCachedCalendarObject($this->calendarInfo['id'], $name);
97
+        if (!$obj) {
98
+            throw new NotFound('Calendar object not found');
99
+        }
100
+
101
+        $obj['acl'] = $this->getChildACL();
102
+        return new CalendarObject($this->caldavBackend, $this->calendarInfo, $obj);
103
+
104
+    }
105
+
106
+    /**
107
+     * @return array
108
+     */
109
+    public function getChildren():array {
110
+        $objs = $this->caldavBackend->getCachedCalendarObjects($this->calendarInfo['id']);
111
+
112
+        $children = [];
113
+        foreach($objs as $obj) {
114
+            $children[] = new CachedSubscriptionObject($this->caldavBackend, $this->calendarInfo, $obj);
115
+        }
116
+
117
+        return $children;
118
+    }
119
+
120
+    /**
121
+     * @param array $paths
122
+     * @return array
123
+     */
124
+    public function getMultipleChildren(array $paths):array {
125
+        $objs = $this->caldavBackend->getMultipleCachedCalendarObjects($this->calendarInfo['id'], $paths);
126
+
127
+        $children = [];
128
+        foreach($objs as $obj) {
129
+            $children[] = new CachedSubscriptionObject($this->caldavBackend, $this->calendarInfo, $obj);
130
+        }
131
+
132
+        return $children;
133
+    }
134
+
135
+    /**
136
+     * @param string $name
137
+     * @param null $calendarData
138
+     * @return null|string|void
139
+     * @throws MethodNotAllowed
140
+     */
141
+    public function createFile($name, $calendarData = null) {
142
+        throw new MethodNotAllowed('Creating objects in cached subscription is not allowed');
143
+    }
144
+
145
+    /**
146
+     * @param string $name
147
+     * @return bool
148
+     */
149
+    public function childExists($name):bool {
150
+        $obj = $this->caldavBackend->getCachedCalendarObject($this->calendarInfo['id'], $name);
151
+        if (!$obj) {
152
+            return false;
153
+        }
154
+
155
+        return true;
156
+    }
157
+
158
+    /**
159
+     * @param array $filters
160
+     * @return array
161
+     */
162
+    public function calendarQuery(array $filters):array {
163
+        return $this->caldavBackend->cachedCalendarQuery($this->calendarInfo['id'], $filters);
164
+    }
165
+
166
+    /**
167
+     * CachedSubscriptions don't support sync-tokens for now
168
+     * Clients will have to do a multi get etag for now
169
+     *
170
+     * @return null
171
+     */
172
+    public function getSyncToken() {
173
+        return null;
174
+    }
175 175
 }
Please login to merge, or discard this patch.
apps/dav/lib/CalDAV/CalendarHome.php 1 patch
Indentation   +123 added lines, -123 removed lines patch added patch discarded remove patch
@@ -37,127 +37,127 @@
 block discarded – undo
37 37
 
38 38
 class CalendarHome extends \Sabre\CalDAV\CalendarHome {
39 39
 
40
-	/** @var \OCP\IL10N */
41
-	private $l10n;
42
-
43
-	/** @var \OCP\IConfig */
44
-	private $config;
45
-
46
-	/** @var bool */
47
-	private $returnCachedSubscriptions=false;
48
-
49
-	public function __construct(BackendInterface $caldavBackend, $principalInfo) {
50
-		parent::__construct($caldavBackend, $principalInfo);
51
-		$this->l10n = \OC::$server->getL10N('dav');
52
-		$this->config = \OC::$server->getConfig();
53
-	}
54
-
55
-	/**
56
-	 * @return BackendInterface
57
-	 */
58
-	public function getCalDAVBackend() {
59
-		return $this->caldavBackend;
60
-	}
61
-
62
-	/**
63
-	 * @inheritdoc
64
-	 */
65
-	function createExtendedCollection($name, MkCol $mkCol) {
66
-		$reservedNames = [BirthdayService::BIRTHDAY_CALENDAR_URI];
67
-
68
-		if (in_array($name, $reservedNames)) {
69
-			throw new MethodNotAllowed('The resource you tried to create has a reserved name');
70
-		}
71
-
72
-		parent::createExtendedCollection($name, $mkCol);
73
-	}
74
-
75
-	/**
76
-	 * @inheritdoc
77
-	 */
78
-	function getChildren() {
79
-		$calendars = $this->caldavBackend->getCalendarsForUser($this->principalInfo['uri']);
80
-		$objects = [];
81
-		foreach ($calendars as $calendar) {
82
-			$objects[] = new Calendar($this->caldavBackend, $calendar, $this->l10n, $this->config);
83
-		}
84
-
85
-		if ($this->caldavBackend instanceof SchedulingSupport) {
86
-			$objects[] = new Inbox($this->caldavBackend, $this->principalInfo['uri']);
87
-			$objects[] = new Outbox($this->principalInfo['uri']);
88
-		}
89
-
90
-		// We're adding a notifications node, if it's supported by the backend.
91
-		if ($this->caldavBackend instanceof NotificationSupport) {
92
-			$objects[] = new \Sabre\CalDAV\Notifications\Collection($this->caldavBackend, $this->principalInfo['uri']);
93
-		}
94
-
95
-		// If the backend supports subscriptions, we'll add those as well,
96
-		if ($this->caldavBackend instanceof SubscriptionSupport) {
97
-			foreach ($this->caldavBackend->getSubscriptionsForUser($this->principalInfo['uri']) as $subscription) {
98
-				if ($this->returnCachedSubscriptions) {
99
-					$objects[] = new CachedSubscription($this->caldavBackend, $subscription);
100
-				} else {
101
-					$objects[] = new Subscription($this->caldavBackend, $subscription);
102
-				}
103
-			}
104
-		}
105
-
106
-		return $objects;
107
-	}
108
-
109
-	/**
110
-	 * @inheritdoc
111
-	 */
112
-	function getChild($name) {
113
-		// Special nodes
114
-		if ($name === 'inbox' && $this->caldavBackend instanceof SchedulingSupport) {
115
-			return new Inbox($this->caldavBackend, $this->principalInfo['uri']);
116
-		}
117
-		if ($name === 'outbox' && $this->caldavBackend instanceof SchedulingSupport) {
118
-			return new Outbox($this->principalInfo['uri']);
119
-		}
120
-		if ($name === 'notifications' && $this->caldavBackend instanceof NotificationSupport) {
121
-			return new \Sabre\CalDAv\Notifications\Collection($this->caldavBackend, $this->principalInfo['uri']);
122
-		}
123
-
124
-		// Calendars
125
-		foreach ($this->caldavBackend->getCalendarsForUser($this->principalInfo['uri']) as $calendar) {
126
-			if ($calendar['uri'] === $name) {
127
-				return new Calendar($this->caldavBackend, $calendar, $this->l10n, $this->config);
128
-			}
129
-		}
130
-
131
-		if ($this->caldavBackend instanceof SubscriptionSupport) {
132
-			foreach ($this->caldavBackend->getSubscriptionsForUser($this->principalInfo['uri']) as $subscription) {
133
-				if ($subscription['uri'] === $name) {
134
-					if ($this->returnCachedSubscriptions) {
135
-						return new CachedSubscription($this->caldavBackend, $subscription);
136
-					}
137
-
138
-					return new Subscription($this->caldavBackend, $subscription);
139
-				}
140
-			}
141
-
142
-		}
143
-
144
-		throw new NotFound('Node with name \'' . $name . '\' could not be found');
145
-	}
146
-
147
-	/**
148
-	 * @param array $filters
149
-	 * @param integer|null $limit
150
-	 * @param integer|null $offset
151
-	 */
152
-	function calendarSearch(array $filters, $limit=null, $offset=null) {
153
-		$principalUri = $this->principalInfo['uri'];
154
-		return $this->caldavBackend->calendarSearch($principalUri, $filters, $limit, $offset);
155
-	}
156
-
157
-	/**
158
-	 *
159
-	 */
160
-	public function enableCachedSubscriptionsForThisRequest() {
161
-		$this->returnCachedSubscriptions = true;
162
-	}
40
+    /** @var \OCP\IL10N */
41
+    private $l10n;
42
+
43
+    /** @var \OCP\IConfig */
44
+    private $config;
45
+
46
+    /** @var bool */
47
+    private $returnCachedSubscriptions=false;
48
+
49
+    public function __construct(BackendInterface $caldavBackend, $principalInfo) {
50
+        parent::__construct($caldavBackend, $principalInfo);
51
+        $this->l10n = \OC::$server->getL10N('dav');
52
+        $this->config = \OC::$server->getConfig();
53
+    }
54
+
55
+    /**
56
+     * @return BackendInterface
57
+     */
58
+    public function getCalDAVBackend() {
59
+        return $this->caldavBackend;
60
+    }
61
+
62
+    /**
63
+     * @inheritdoc
64
+     */
65
+    function createExtendedCollection($name, MkCol $mkCol) {
66
+        $reservedNames = [BirthdayService::BIRTHDAY_CALENDAR_URI];
67
+
68
+        if (in_array($name, $reservedNames)) {
69
+            throw new MethodNotAllowed('The resource you tried to create has a reserved name');
70
+        }
71
+
72
+        parent::createExtendedCollection($name, $mkCol);
73
+    }
74
+
75
+    /**
76
+     * @inheritdoc
77
+     */
78
+    function getChildren() {
79
+        $calendars = $this->caldavBackend->getCalendarsForUser($this->principalInfo['uri']);
80
+        $objects = [];
81
+        foreach ($calendars as $calendar) {
82
+            $objects[] = new Calendar($this->caldavBackend, $calendar, $this->l10n, $this->config);
83
+        }
84
+
85
+        if ($this->caldavBackend instanceof SchedulingSupport) {
86
+            $objects[] = new Inbox($this->caldavBackend, $this->principalInfo['uri']);
87
+            $objects[] = new Outbox($this->principalInfo['uri']);
88
+        }
89
+
90
+        // We're adding a notifications node, if it's supported by the backend.
91
+        if ($this->caldavBackend instanceof NotificationSupport) {
92
+            $objects[] = new \Sabre\CalDAV\Notifications\Collection($this->caldavBackend, $this->principalInfo['uri']);
93
+        }
94
+
95
+        // If the backend supports subscriptions, we'll add those as well,
96
+        if ($this->caldavBackend instanceof SubscriptionSupport) {
97
+            foreach ($this->caldavBackend->getSubscriptionsForUser($this->principalInfo['uri']) as $subscription) {
98
+                if ($this->returnCachedSubscriptions) {
99
+                    $objects[] = new CachedSubscription($this->caldavBackend, $subscription);
100
+                } else {
101
+                    $objects[] = new Subscription($this->caldavBackend, $subscription);
102
+                }
103
+            }
104
+        }
105
+
106
+        return $objects;
107
+    }
108
+
109
+    /**
110
+     * @inheritdoc
111
+     */
112
+    function getChild($name) {
113
+        // Special nodes
114
+        if ($name === 'inbox' && $this->caldavBackend instanceof SchedulingSupport) {
115
+            return new Inbox($this->caldavBackend, $this->principalInfo['uri']);
116
+        }
117
+        if ($name === 'outbox' && $this->caldavBackend instanceof SchedulingSupport) {
118
+            return new Outbox($this->principalInfo['uri']);
119
+        }
120
+        if ($name === 'notifications' && $this->caldavBackend instanceof NotificationSupport) {
121
+            return new \Sabre\CalDAv\Notifications\Collection($this->caldavBackend, $this->principalInfo['uri']);
122
+        }
123
+
124
+        // Calendars
125
+        foreach ($this->caldavBackend->getCalendarsForUser($this->principalInfo['uri']) as $calendar) {
126
+            if ($calendar['uri'] === $name) {
127
+                return new Calendar($this->caldavBackend, $calendar, $this->l10n, $this->config);
128
+            }
129
+        }
130
+
131
+        if ($this->caldavBackend instanceof SubscriptionSupport) {
132
+            foreach ($this->caldavBackend->getSubscriptionsForUser($this->principalInfo['uri']) as $subscription) {
133
+                if ($subscription['uri'] === $name) {
134
+                    if ($this->returnCachedSubscriptions) {
135
+                        return new CachedSubscription($this->caldavBackend, $subscription);
136
+                    }
137
+
138
+                    return new Subscription($this->caldavBackend, $subscription);
139
+                }
140
+            }
141
+
142
+        }
143
+
144
+        throw new NotFound('Node with name \'' . $name . '\' could not be found');
145
+    }
146
+
147
+    /**
148
+     * @param array $filters
149
+     * @param integer|null $limit
150
+     * @param integer|null $offset
151
+     */
152
+    function calendarSearch(array $filters, $limit=null, $offset=null) {
153
+        $principalUri = $this->principalInfo['uri'];
154
+        return $this->caldavBackend->calendarSearch($principalUri, $filters, $limit, $offset);
155
+    }
156
+
157
+    /**
158
+     *
159
+     */
160
+    public function enableCachedSubscriptionsForThisRequest() {
161
+        $this->returnCachedSubscriptions = true;
162
+    }
163 163
 }
Please login to merge, or discard this patch.
apps/dav/lib/CalDAV/CachedSubscriptionObject.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -33,32 +33,32 @@
 block discarded – undo
33 33
  */
34 34
 class CachedSubscriptionObject extends \Sabre\CalDAV\CalendarObject {
35 35
 
36
-	/**
37
-	 * @inheritdoc
38
-	 */
39
-	public function get() {
40
-		// Pre-populating the 'calendardata' is optional, if we don't have it
41
-		// already we fetch it from the backend.
42
-		if (!isset($this->objectData['calendardata'])) {
43
-			$this->objectData = $this->caldavBackend->getCachedCalendarObject($this->calendarInfo['id'], $this->objectData['uri']);
44
-		}
36
+    /**
37
+     * @inheritdoc
38
+     */
39
+    public function get() {
40
+        // Pre-populating the 'calendardata' is optional, if we don't have it
41
+        // already we fetch it from the backend.
42
+        if (!isset($this->objectData['calendardata'])) {
43
+            $this->objectData = $this->caldavBackend->getCachedCalendarObject($this->calendarInfo['id'], $this->objectData['uri']);
44
+        }
45 45
 
46
-		return $this->objectData['calendardata'];
47
-	}
46
+        return $this->objectData['calendardata'];
47
+    }
48 48
 
49
-	/**
50
-	 * @param resource|string $calendarData
51
-	 * @return string|void
52
-	 * @throws MethodNotAllowed
53
-	 */
54
-	public function put($calendarData) {
55
-		throw new MethodNotAllowed('Creating objects in cached subscription is not allowed');
56
-	}
49
+    /**
50
+     * @param resource|string $calendarData
51
+     * @return string|void
52
+     * @throws MethodNotAllowed
53
+     */
54
+    public function put($calendarData) {
55
+        throw new MethodNotAllowed('Creating objects in cached subscription is not allowed');
56
+    }
57 57
 
58
-	/**
59
-	 * @throws MethodNotAllowed
60
-	 */
61
-	public function delete() {
62
-		throw new MethodNotAllowed('Deleting objects in cached subscription is not allowed');
63
-	}
58
+    /**
59
+     * @throws MethodNotAllowed
60
+     */
61
+    public function delete() {
62
+        throw new MethodNotAllowed('Deleting objects in cached subscription is not allowed');
63
+    }
64 64
 }
Please login to merge, or discard this patch.
apps/dav/lib/BackgroundJob/RefreshWebcalJob.php 1 patch
Indentation   +126 added lines, -126 removed lines patch added patch discarded remove patch
@@ -34,133 +34,133 @@
 block discarded – undo
34 34
 
35 35
 class RefreshWebcalJob extends TimedJob {
36 36
 
37
-	/** @var CalDavBackend */
38
-	private $calDavBackend;
39
-
40
-	/** @var IClientService */
41
-	private $clientService;
42
-
43
-	/** @var ILogger */
44
-	private $logger;
45
-
46
-	/**
47
-	 * RefreshWebcalJob constructor.
48
-	 *
49
-	 * @param CalDavBackend $calDavBackend
50
-	 * @param IClientService $clientService
51
-	 * @param ILogger $logger
52
-	 */
53
-	public function __construct(CalDavBackend $calDavBackend, IClientService $clientService, ILogger $logger) {
54
-		$this->calDavBackend = $calDavBackend;
55
-		$this->clientService = $clientService;
56
-		$this->logger = $logger;
57
-
58
-		$this->setInterval(60*60*24);
59
-	}
60
-
61
-	/**
62
-	 * @param array $argument
63
-	 */
64
-	protected function run($argument) {
65
-		$principalUri = $argument['principaluri'];
66
-		$uri = $argument['uri'];
67
-
68
-		$subscriptions = array_filter(
69
-			$this->calDavBackend->getSubscriptionsForUser($principalUri),
70
-			function($sub) use ($uri) {
71
-				return $sub['uri'] === $uri;
72
-			}
73
-		);
74
-
75
-		if (\count($subscriptions) === 0) {
76
-			return;
77
-		}
78
-		/** @var array $subscription */
79
-		$subscription = $subscriptions[0];
37
+    /** @var CalDavBackend */
38
+    private $calDavBackend;
39
+
40
+    /** @var IClientService */
41
+    private $clientService;
42
+
43
+    /** @var ILogger */
44
+    private $logger;
45
+
46
+    /**
47
+     * RefreshWebcalJob constructor.
48
+     *
49
+     * @param CalDavBackend $calDavBackend
50
+     * @param IClientService $clientService
51
+     * @param ILogger $logger
52
+     */
53
+    public function __construct(CalDavBackend $calDavBackend, IClientService $clientService, ILogger $logger) {
54
+        $this->calDavBackend = $calDavBackend;
55
+        $this->clientService = $clientService;
56
+        $this->logger = $logger;
57
+
58
+        $this->setInterval(60*60*24);
59
+    }
60
+
61
+    /**
62
+     * @param array $argument
63
+     */
64
+    protected function run($argument) {
65
+        $principalUri = $argument['principaluri'];
66
+        $uri = $argument['uri'];
67
+
68
+        $subscriptions = array_filter(
69
+            $this->calDavBackend->getSubscriptionsForUser($principalUri),
70
+            function($sub) use ($uri) {
71
+                return $sub['uri'] === $uri;
72
+            }
73
+        );
74
+
75
+        if (\count($subscriptions) === 0) {
76
+            return;
77
+        }
78
+        /** @var array $subscription */
79
+        $subscription = $subscriptions[0];
80 80
 
81 81
 //		if ($subscription['refreshrate'])
82 82
 
83
-		$webcalData = $this->queryWebcalFeed($subscription);
84
-		if (!$webcalData) {
85
-			return;
86
-		}
87
-
88
-		$stripTodos = $subscription['striptodos'];
89
-		$stripAlarms = $subscription['stripalarms'];
90
-		$stripAttachments = $subscription['stripattachments'];
91
-
92
-		try {
93
-			$splitter = new ICalendar($webcalData);
94
-
95
-			// we wait with deleting all purged events till we parsed the new ones
96
-			// in case the new calendar is broken and new ICalendar throws a ParseException
97
-			// the user will still see the old data
98
-			$this->calDavBackend->purgeAllCachedEventsForSubscription($subscription['id']);
99
-
100
-			while ($vObject = $splitter->getNext()) {
101
-				/** @var Component $vObject */
102
-				$uid = null;
103
-				$compName = null;
104
-
105
-				foreach ($vObject->getComponents() as $component) {
106
-					if ($component->name === 'VTIMEZONE') {
107
-						continue;
108
-					}
109
-
110
-					$uid = $component->{'UID'}->getValue();
111
-					$compName = $component->name;
112
-
113
-					if ($stripAlarms) {
114
-						unset($component->{'VALARM'});
115
-					}
116
-					if ($stripAttachments) {
117
-						unset($component->{'ATTACH'});
118
-					}
119
-				}
120
-
121
-				if ($stripTodos && $compName === 'VTODO') {
122
-					continue;
123
-				}
124
-
125
-				$uri = $uid . '.ics';
126
-				$calendarData = $vObject->serialize();
127
-				try {
128
-					$this->calDavBackend->addCachedEvent($subscription['id'], $uri, $calendarData);
129
-				} catch(BadRequest $ex) {
130
-					$this->logger->logException($ex);
131
-				}
132
-			}
133
-
134
-		} catch(ParseException $ex) {
135
-			$subscriptionId = $subscription['id'];
136
-
137
-			$this->logger->logException($ex);
138
-			$this->logger->warning("Subscription $subscriptionId could not be refreshed due to a parsing error");
139
-		}
140
-	}
141
-
142
-	/**
143
-	 * @param array $subscription
144
-	 * @return null|resource
145
-	 */
146
-	private function queryWebcalFeed(array $subscription) {
147
-		$client = $this->clientService->newClient();
148
-		try {
149
-			$response = $client->get($subscription['source'], [
150
-				'stream' => true,
151
-				'allow_redirects' => [
152
-					'redirects' => 10
153
-				]
154
-			]);
155
-
156
-			return $response->getBody();
157
-		} catch(\Exception $ex) {
158
-			$subscriptionId = $subscription['id'];
159
-
160
-			$this->logger->logException($ex);
161
-			$this->logger->warning("Subscription $subscriptionId could not be refreshed due to a network error");
162
-
163
-			return null;
164
-		}
165
-	}
83
+        $webcalData = $this->queryWebcalFeed($subscription);
84
+        if (!$webcalData) {
85
+            return;
86
+        }
87
+
88
+        $stripTodos = $subscription['striptodos'];
89
+        $stripAlarms = $subscription['stripalarms'];
90
+        $stripAttachments = $subscription['stripattachments'];
91
+
92
+        try {
93
+            $splitter = new ICalendar($webcalData);
94
+
95
+            // we wait with deleting all purged events till we parsed the new ones
96
+            // in case the new calendar is broken and new ICalendar throws a ParseException
97
+            // the user will still see the old data
98
+            $this->calDavBackend->purgeAllCachedEventsForSubscription($subscription['id']);
99
+
100
+            while ($vObject = $splitter->getNext()) {
101
+                /** @var Component $vObject */
102
+                $uid = null;
103
+                $compName = null;
104
+
105
+                foreach ($vObject->getComponents() as $component) {
106
+                    if ($component->name === 'VTIMEZONE') {
107
+                        continue;
108
+                    }
109
+
110
+                    $uid = $component->{'UID'}->getValue();
111
+                    $compName = $component->name;
112
+
113
+                    if ($stripAlarms) {
114
+                        unset($component->{'VALARM'});
115
+                    }
116
+                    if ($stripAttachments) {
117
+                        unset($component->{'ATTACH'});
118
+                    }
119
+                }
120
+
121
+                if ($stripTodos && $compName === 'VTODO') {
122
+                    continue;
123
+                }
124
+
125
+                $uri = $uid . '.ics';
126
+                $calendarData = $vObject->serialize();
127
+                try {
128
+                    $this->calDavBackend->addCachedEvent($subscription['id'], $uri, $calendarData);
129
+                } catch(BadRequest $ex) {
130
+                    $this->logger->logException($ex);
131
+                }
132
+            }
133
+
134
+        } catch(ParseException $ex) {
135
+            $subscriptionId = $subscription['id'];
136
+
137
+            $this->logger->logException($ex);
138
+            $this->logger->warning("Subscription $subscriptionId could not be refreshed due to a parsing error");
139
+        }
140
+    }
141
+
142
+    /**
143
+     * @param array $subscription
144
+     * @return null|resource
145
+     */
146
+    private function queryWebcalFeed(array $subscription) {
147
+        $client = $this->clientService->newClient();
148
+        try {
149
+            $response = $client->get($subscription['source'], [
150
+                'stream' => true,
151
+                'allow_redirects' => [
152
+                    'redirects' => 10
153
+                ]
154
+            ]);
155
+
156
+            return $response->getBody();
157
+        } catch(\Exception $ex) {
158
+            $subscriptionId = $subscription['id'];
159
+
160
+            $this->logger->logException($ex);
161
+            $this->logger->warning("Subscription $subscriptionId could not be refreshed due to a network error");
162
+
163
+            return null;
164
+        }
165
+    }
166 166
 }
Please login to merge, or discard this patch.
apps/dav/lib/Server.php 1 patch
Indentation   +213 added lines, -213 removed lines patch added patch discarded remove patch
@@ -66,244 +66,244 @@
 block discarded – undo
66 66
 
67 67
 class Server {
68 68
 
69
-	/** @var IRequest */
70
-	private $request;
69
+    /** @var IRequest */
70
+    private $request;
71 71
 
72
-	/** @var  string */
73
-	private $baseUri;
72
+    /** @var  string */
73
+    private $baseUri;
74 74
 
75
-	/** @var Connector\Sabre\Server  */
76
-	public $server;
75
+    /** @var Connector\Sabre\Server  */
76
+    public $server;
77 77
 
78
-	public function __construct(IRequest $request, $baseUri) {
79
-		$this->request = $request;
80
-		$this->baseUri = $baseUri;
81
-		$logger = \OC::$server->getLogger();
82
-		$dispatcher = \OC::$server->getEventDispatcher();
78
+    public function __construct(IRequest $request, $baseUri) {
79
+        $this->request = $request;
80
+        $this->baseUri = $baseUri;
81
+        $logger = \OC::$server->getLogger();
82
+        $dispatcher = \OC::$server->getEventDispatcher();
83 83
 
84
-		$root = new RootCollection();
85
-		$this->server = new \OCA\DAV\Connector\Sabre\Server(new CachingTree($root));
84
+        $root = new RootCollection();
85
+        $this->server = new \OCA\DAV\Connector\Sabre\Server(new CachingTree($root));
86 86
 
87
-		// Add maintenance plugin
88
-		$this->server->addPlugin(new \OCA\DAV\Connector\Sabre\MaintenancePlugin(\OC::$server->getConfig()));
87
+        // Add maintenance plugin
88
+        $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\MaintenancePlugin(\OC::$server->getConfig()));
89 89
 
90
-		// Backends
91
-		$authBackend = new Auth(
92
-			\OC::$server->getSession(),
93
-			\OC::$server->getUserSession(),
94
-			\OC::$server->getRequest(),
95
-			\OC::$server->getTwoFactorAuthManager(),
96
-			\OC::$server->getBruteForceThrottler()
97
-		);
90
+        // Backends
91
+        $authBackend = new Auth(
92
+            \OC::$server->getSession(),
93
+            \OC::$server->getUserSession(),
94
+            \OC::$server->getRequest(),
95
+            \OC::$server->getTwoFactorAuthManager(),
96
+            \OC::$server->getBruteForceThrottler()
97
+        );
98 98
 
99
-		// Set URL explicitly due to reverse-proxy situations
100
-		$this->server->httpRequest->setUrl($this->request->getRequestUri());
101
-		$this->server->setBaseUri($this->baseUri);
99
+        // Set URL explicitly due to reverse-proxy situations
100
+        $this->server->httpRequest->setUrl($this->request->getRequestUri());
101
+        $this->server->setBaseUri($this->baseUri);
102 102
 
103
-		$this->server->addPlugin(new BlockLegacyClientPlugin(\OC::$server->getConfig()));
104
-		$this->server->addPlugin(new AnonymousOptionsPlugin());
105
-		$authPlugin = new Plugin();
106
-		$authPlugin->addBackend(new PublicAuth());
107
-		$this->server->addPlugin($authPlugin);
103
+        $this->server->addPlugin(new BlockLegacyClientPlugin(\OC::$server->getConfig()));
104
+        $this->server->addPlugin(new AnonymousOptionsPlugin());
105
+        $authPlugin = new Plugin();
106
+        $authPlugin->addBackend(new PublicAuth());
107
+        $this->server->addPlugin($authPlugin);
108 108
 
109
-		// allow setup of additional auth backends
110
-		$event = new SabrePluginEvent($this->server);
111
-		$dispatcher->dispatch('OCA\DAV\Connector\Sabre::authInit', $event);
109
+        // allow setup of additional auth backends
110
+        $event = new SabrePluginEvent($this->server);
111
+        $dispatcher->dispatch('OCA\DAV\Connector\Sabre::authInit', $event);
112 112
 
113
-		$bearerAuthBackend = new BearerAuth(
114
-			\OC::$server->getUserSession(),
115
-			\OC::$server->getSession(),
116
-			\OC::$server->getRequest()
117
-		);
118
-		$authPlugin->addBackend($bearerAuthBackend);
119
-		// because we are throwing exceptions this plugin has to be the last one
120
-		$authPlugin->addBackend($authBackend);
113
+        $bearerAuthBackend = new BearerAuth(
114
+            \OC::$server->getUserSession(),
115
+            \OC::$server->getSession(),
116
+            \OC::$server->getRequest()
117
+        );
118
+        $authPlugin->addBackend($bearerAuthBackend);
119
+        // because we are throwing exceptions this plugin has to be the last one
120
+        $authPlugin->addBackend($authBackend);
121 121
 
122
-		// debugging
123
-		if(\OC::$server->getConfig()->getSystemValue('debug', false)) {
124
-			$this->server->addPlugin(new \Sabre\DAV\Browser\Plugin());
125
-		} else {
126
-			$this->server->addPlugin(new DummyGetResponsePlugin());
127
-		}
122
+        // debugging
123
+        if(\OC::$server->getConfig()->getSystemValue('debug', false)) {
124
+            $this->server->addPlugin(new \Sabre\DAV\Browser\Plugin());
125
+        } else {
126
+            $this->server->addPlugin(new DummyGetResponsePlugin());
127
+        }
128 128
 
129
-		$this->server->addPlugin(new \OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin('webdav', $logger));
130
-		$this->server->addPlugin(new \OCA\DAV\Connector\Sabre\LockPlugin());
131
-		$this->server->addPlugin(new \Sabre\DAV\Sync\Plugin());
129
+        $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin('webdav', $logger));
130
+        $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\LockPlugin());
131
+        $this->server->addPlugin(new \Sabre\DAV\Sync\Plugin());
132 132
 
133
-		// acl
134
-		$acl = new DavAclPlugin();
135
-		$acl->principalCollectionSet = [
136
-			'principals/users', 'principals/groups',
137
-			'principals/calendar-resources',
138
-			'principals/calendar-rooms',
139
-		];
140
-		$acl->defaultUsernamePath = 'principals/users';
141
-		$this->server->addPlugin($acl);
133
+        // acl
134
+        $acl = new DavAclPlugin();
135
+        $acl->principalCollectionSet = [
136
+            'principals/users', 'principals/groups',
137
+            'principals/calendar-resources',
138
+            'principals/calendar-rooms',
139
+        ];
140
+        $acl->defaultUsernamePath = 'principals/users';
141
+        $this->server->addPlugin($acl);
142 142
 
143
-		// calendar plugins
144
-		if ($this->requestIsForSubtree(['calendars', 'public-calendars', 'system-calendars', 'principals'])) {
145
-			$this->server->addPlugin(new \OCA\DAV\CalDAV\Plugin());
146
-			$this->server->addPlugin(new \Sabre\CalDAV\ICSExportPlugin());
147
-			$this->server->addPlugin(new \OCA\DAV\CalDAV\Schedule\Plugin());
148
-			if (\OC::$server->getConfig()->getAppValue('dav', 'sendInvitations', 'yes') === 'yes') {
149
-				$this->server->addPlugin(\OC::$server->query(\OCA\DAV\CalDAV\Schedule\IMipPlugin::class));
150
-			}
151
-			$webcalCachingPlugin = new CalDAV\WebcalCaching\Plugin($request);
152
-			$this->server->addPlugin($webcalCachingPlugin);
153
-			if (!$webcalCachingPlugin->isCachingEnabledForThisRequest()) {
154
-				$this->server->addPlugin(new \Sabre\CalDAV\Subscriptions\Plugin());
155
-			}
156
-			$this->server->addPlugin(new \Sabre\CalDAV\Notifications\Plugin());
157
-			$this->server->addPlugin(new DAV\Sharing\Plugin($authBackend, \OC::$server->getRequest()));
158
-			$this->server->addPlugin(new \OCA\DAV\CalDAV\Publishing\PublishPlugin(
159
-				\OC::$server->getConfig(),
160
-				\OC::$server->getURLGenerator()
161
-			));
162
-		}
143
+        // calendar plugins
144
+        if ($this->requestIsForSubtree(['calendars', 'public-calendars', 'system-calendars', 'principals'])) {
145
+            $this->server->addPlugin(new \OCA\DAV\CalDAV\Plugin());
146
+            $this->server->addPlugin(new \Sabre\CalDAV\ICSExportPlugin());
147
+            $this->server->addPlugin(new \OCA\DAV\CalDAV\Schedule\Plugin());
148
+            if (\OC::$server->getConfig()->getAppValue('dav', 'sendInvitations', 'yes') === 'yes') {
149
+                $this->server->addPlugin(\OC::$server->query(\OCA\DAV\CalDAV\Schedule\IMipPlugin::class));
150
+            }
151
+            $webcalCachingPlugin = new CalDAV\WebcalCaching\Plugin($request);
152
+            $this->server->addPlugin($webcalCachingPlugin);
153
+            if (!$webcalCachingPlugin->isCachingEnabledForThisRequest()) {
154
+                $this->server->addPlugin(new \Sabre\CalDAV\Subscriptions\Plugin());
155
+            }
156
+            $this->server->addPlugin(new \Sabre\CalDAV\Notifications\Plugin());
157
+            $this->server->addPlugin(new DAV\Sharing\Plugin($authBackend, \OC::$server->getRequest()));
158
+            $this->server->addPlugin(new \OCA\DAV\CalDAV\Publishing\PublishPlugin(
159
+                \OC::$server->getConfig(),
160
+                \OC::$server->getURLGenerator()
161
+            ));
162
+        }
163 163
 
164
-		// addressbook plugins
165
-		if ($this->requestIsForSubtree(['addressbooks', 'principals'])) {
166
-			$this->server->addPlugin(new DAV\Sharing\Plugin($authBackend, \OC::$server->getRequest()));
167
-			$this->server->addPlugin(new \OCA\DAV\CardDAV\Plugin());
168
-			$this->server->addPlugin(new VCFExportPlugin());
169
-			$this->server->addPlugin(new ImageExportPlugin(new PhotoCache(\OC::$server->getAppDataDir('dav-photocache'))));
170
-		}
164
+        // addressbook plugins
165
+        if ($this->requestIsForSubtree(['addressbooks', 'principals'])) {
166
+            $this->server->addPlugin(new DAV\Sharing\Plugin($authBackend, \OC::$server->getRequest()));
167
+            $this->server->addPlugin(new \OCA\DAV\CardDAV\Plugin());
168
+            $this->server->addPlugin(new VCFExportPlugin());
169
+            $this->server->addPlugin(new ImageExportPlugin(new PhotoCache(\OC::$server->getAppDataDir('dav-photocache'))));
170
+        }
171 171
 
172
-		// system tags plugins
173
-		$this->server->addPlugin(new SystemTagPlugin(
174
-			\OC::$server->getSystemTagManager(),
175
-			\OC::$server->getGroupManager(),
176
-			\OC::$server->getUserSession()
177
-		));
172
+        // system tags plugins
173
+        $this->server->addPlugin(new SystemTagPlugin(
174
+            \OC::$server->getSystemTagManager(),
175
+            \OC::$server->getGroupManager(),
176
+            \OC::$server->getUserSession()
177
+        ));
178 178
 
179
-		// comments plugin
180
-		$this->server->addPlugin(new CommentsPlugin(
181
-			\OC::$server->getCommentsManager(),
182
-			\OC::$server->getUserSession()
183
-		));
179
+        // comments plugin
180
+        $this->server->addPlugin(new CommentsPlugin(
181
+            \OC::$server->getCommentsManager(),
182
+            \OC::$server->getUserSession()
183
+        ));
184 184
 
185
-		$this->server->addPlugin(new CopyEtagHeaderPlugin());
186
-		$this->server->addPlugin(new ChunkingPlugin());
185
+        $this->server->addPlugin(new CopyEtagHeaderPlugin());
186
+        $this->server->addPlugin(new ChunkingPlugin());
187 187
 
188
-		// allow setup of additional plugins
189
-		$dispatcher->dispatch('OCA\DAV\Connector\Sabre::addPlugin', $event);
188
+        // allow setup of additional plugins
189
+        $dispatcher->dispatch('OCA\DAV\Connector\Sabre::addPlugin', $event);
190 190
 
191
-		// Some WebDAV clients do require Class 2 WebDAV support (locking), since
192
-		// we do not provide locking we emulate it using a fake locking plugin.
193
-		if($request->isUserAgent([
194
-			'/WebDAVFS/',
195
-			'/OneNote/',
196
-			'/^Microsoft-WebDAV/',// Microsoft-WebDAV-MiniRedir/6.1.7601
197
-		])) {
198
-			$this->server->addPlugin(new FakeLockerPlugin());
199
-		}
191
+        // Some WebDAV clients do require Class 2 WebDAV support (locking), since
192
+        // we do not provide locking we emulate it using a fake locking plugin.
193
+        if($request->isUserAgent([
194
+            '/WebDAVFS/',
195
+            '/OneNote/',
196
+            '/^Microsoft-WebDAV/',// Microsoft-WebDAV-MiniRedir/6.1.7601
197
+        ])) {
198
+            $this->server->addPlugin(new FakeLockerPlugin());
199
+        }
200 200
 
201
-		if (BrowserErrorPagePlugin::isBrowserRequest($request)) {
202
-			$this->server->addPlugin(new BrowserErrorPagePlugin());
203
-		}
201
+        if (BrowserErrorPagePlugin::isBrowserRequest($request)) {
202
+            $this->server->addPlugin(new BrowserErrorPagePlugin());
203
+        }
204 204
 
205
-		$lazySearchBackend = new LazySearchBackend();
206
-		$this->server->addPlugin(new SearchPlugin($lazySearchBackend));
205
+        $lazySearchBackend = new LazySearchBackend();
206
+        $this->server->addPlugin(new SearchPlugin($lazySearchBackend));
207 207
 
208
-		// wait with registering these until auth is handled and the filesystem is setup
209
-		$this->server->on('beforeMethod', function () use ($root, $lazySearchBackend) {
210
-			// custom properties plugin must be the last one
211
-			$userSession = \OC::$server->getUserSession();
212
-			$user = $userSession->getUser();
213
-			if ($user !== null) {
214
-				$view = \OC\Files\Filesystem::getView();
215
-				$this->server->addPlugin(
216
-					new FilesPlugin(
217
-						$this->server->tree,
218
-						\OC::$server->getConfig(),
219
-						$this->request,
220
-						\OC::$server->getPreviewManager(),
221
-						false,
222
-						!\OC::$server->getConfig()->getSystemValue('debug', false)
223
-					)
224
-				);
208
+        // wait with registering these until auth is handled and the filesystem is setup
209
+        $this->server->on('beforeMethod', function () use ($root, $lazySearchBackend) {
210
+            // custom properties plugin must be the last one
211
+            $userSession = \OC::$server->getUserSession();
212
+            $user = $userSession->getUser();
213
+            if ($user !== null) {
214
+                $view = \OC\Files\Filesystem::getView();
215
+                $this->server->addPlugin(
216
+                    new FilesPlugin(
217
+                        $this->server->tree,
218
+                        \OC::$server->getConfig(),
219
+                        $this->request,
220
+                        \OC::$server->getPreviewManager(),
221
+                        false,
222
+                        !\OC::$server->getConfig()->getSystemValue('debug', false)
223
+                    )
224
+                );
225 225
 
226
-				$this->server->addPlugin(
227
-					new \Sabre\DAV\PropertyStorage\Plugin(
228
-						new CustomPropertiesBackend(
229
-							$this->server->tree,
230
-							\OC::$server->getDatabaseConnection(),
231
-							\OC::$server->getUserSession()->getUser()
232
-						)
233
-					)
234
-				);
235
-				if ($view !== null) {
236
-					$this->server->addPlugin(
237
-						new QuotaPlugin($view, false));
238
-				}
239
-				$this->server->addPlugin(
240
-					new TagsPlugin(
241
-						$this->server->tree, \OC::$server->getTagManager()
242
-					)
243
-				);
244
-				// TODO: switch to LazyUserFolder
245
-				$userFolder = \OC::$server->getUserFolder();
246
-				$this->server->addPlugin(new SharesPlugin(
247
-					$this->server->tree,
248
-					$userSession,
249
-					$userFolder,
250
-					\OC::$server->getShareManager()
251
-				));
252
-				$this->server->addPlugin(new CommentPropertiesPlugin(
253
-					\OC::$server->getCommentsManager(),
254
-					$userSession
255
-				));
256
-				$this->server->addPlugin(new \OCA\DAV\CalDAV\Search\SearchPlugin());
257
-				if ($view !== null) {
258
-					$this->server->addPlugin(new FilesReportPlugin(
259
-						$this->server->tree,
260
-						$view,
261
-						\OC::$server->getSystemTagManager(),
262
-						\OC::$server->getSystemTagObjectMapper(),
263
-						\OC::$server->getTagManager(),
264
-						$userSession,
265
-						\OC::$server->getGroupManager(),
266
-						$userFolder
267
-					));
268
-					$lazySearchBackend->setBackend(new \OCA\DAV\Files\FileSearchBackend(
269
-						$this->server->tree,
270
-						$user,
271
-						\OC::$server->getRootFolder(),
272
-						\OC::$server->getShareManager(),
273
-						$view
274
-					));
275
-				}
276
-				$this->server->addPlugin(new \OCA\DAV\CalDAV\BirthdayCalendar\EnablePlugin(
277
-					\OC::$server->getConfig(),
278
-					\OC::$server->query(BirthdayService::class)
279
-				));
280
-			}
226
+                $this->server->addPlugin(
227
+                    new \Sabre\DAV\PropertyStorage\Plugin(
228
+                        new CustomPropertiesBackend(
229
+                            $this->server->tree,
230
+                            \OC::$server->getDatabaseConnection(),
231
+                            \OC::$server->getUserSession()->getUser()
232
+                        )
233
+                    )
234
+                );
235
+                if ($view !== null) {
236
+                    $this->server->addPlugin(
237
+                        new QuotaPlugin($view, false));
238
+                }
239
+                $this->server->addPlugin(
240
+                    new TagsPlugin(
241
+                        $this->server->tree, \OC::$server->getTagManager()
242
+                    )
243
+                );
244
+                // TODO: switch to LazyUserFolder
245
+                $userFolder = \OC::$server->getUserFolder();
246
+                $this->server->addPlugin(new SharesPlugin(
247
+                    $this->server->tree,
248
+                    $userSession,
249
+                    $userFolder,
250
+                    \OC::$server->getShareManager()
251
+                ));
252
+                $this->server->addPlugin(new CommentPropertiesPlugin(
253
+                    \OC::$server->getCommentsManager(),
254
+                    $userSession
255
+                ));
256
+                $this->server->addPlugin(new \OCA\DAV\CalDAV\Search\SearchPlugin());
257
+                if ($view !== null) {
258
+                    $this->server->addPlugin(new FilesReportPlugin(
259
+                        $this->server->tree,
260
+                        $view,
261
+                        \OC::$server->getSystemTagManager(),
262
+                        \OC::$server->getSystemTagObjectMapper(),
263
+                        \OC::$server->getTagManager(),
264
+                        $userSession,
265
+                        \OC::$server->getGroupManager(),
266
+                        $userFolder
267
+                    ));
268
+                    $lazySearchBackend->setBackend(new \OCA\DAV\Files\FileSearchBackend(
269
+                        $this->server->tree,
270
+                        $user,
271
+                        \OC::$server->getRootFolder(),
272
+                        \OC::$server->getShareManager(),
273
+                        $view
274
+                    ));
275
+                }
276
+                $this->server->addPlugin(new \OCA\DAV\CalDAV\BirthdayCalendar\EnablePlugin(
277
+                    \OC::$server->getConfig(),
278
+                    \OC::$server->query(BirthdayService::class)
279
+                ));
280
+            }
281 281
 
282
-			// register plugins from apps
283
-			$pluginManager = new PluginManager(
284
-				\OC::$server,
285
-				\OC::$server->getAppManager()
286
-			);
287
-			foreach ($pluginManager->getAppPlugins() as $appPlugin) {
288
-				$this->server->addPlugin($appPlugin);
289
-			}
290
-			foreach ($pluginManager->getAppCollections() as $appCollection) {
291
-				$root->addChild($appCollection);
292
-			}
293
-		});
294
-	}
282
+            // register plugins from apps
283
+            $pluginManager = new PluginManager(
284
+                \OC::$server,
285
+                \OC::$server->getAppManager()
286
+            );
287
+            foreach ($pluginManager->getAppPlugins() as $appPlugin) {
288
+                $this->server->addPlugin($appPlugin);
289
+            }
290
+            foreach ($pluginManager->getAppCollections() as $appCollection) {
291
+                $root->addChild($appCollection);
292
+            }
293
+        });
294
+    }
295 295
 
296
-	public function exec() {
297
-		$this->server->exec();
298
-	}
296
+    public function exec() {
297
+        $this->server->exec();
298
+    }
299 299
 
300
-	private function requestIsForSubtree(array $subTrees): bool {
301
-		foreach ($subTrees as $subTree) {
302
-			$subTree = trim($subTree, ' /');
303
-			if (strpos($this->server->getRequestUri(), $subTree.'/') === 0) {
304
-				return true;
305
-			}
306
-		}
307
-		return false;
308
-	}
300
+    private function requestIsForSubtree(array $subTrees): bool {
301
+        foreach ($subTrees as $subTree) {
302
+            $subTree = trim($subTree, ' /');
303
+            if (strpos($this->server->getRequestUri(), $subTree.'/') === 0) {
304
+                return true;
305
+            }
306
+        }
307
+        return false;
308
+    }
309 309
 }
Please login to merge, or discard this patch.
apps/dav/lib/Migration/RefreshWebcalJobRegistrar.php 1 patch
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -32,52 +32,52 @@
 block discarded – undo
32 32
 
33 33
 class RefreshWebcalJobRegistrar implements IRepairStep {
34 34
 
35
-	/** @var IDBConnection */
36
-	private $connection;
35
+    /** @var IDBConnection */
36
+    private $connection;
37 37
 
38
-	/** @var IJobList */
39
-	private $jobList;
38
+    /** @var IJobList */
39
+    private $jobList;
40 40
 
41
-	/**
42
-	 * FixBirthdayCalendarComponent constructor.
43
-	 *
44
-	 * @param IDBConnection $connection
45
-	 * @param IJobList $jobList
46
-	 */
47
-	public function __construct(IDBConnection $connection, IJobList $jobList) {
48
-		$this->connection = $connection;
49
-		$this->jobList = $jobList;
50
-	}
41
+    /**
42
+     * FixBirthdayCalendarComponent constructor.
43
+     *
44
+     * @param IDBConnection $connection
45
+     * @param IJobList $jobList
46
+     */
47
+    public function __construct(IDBConnection $connection, IJobList $jobList) {
48
+        $this->connection = $connection;
49
+        $this->jobList = $jobList;
50
+    }
51 51
 
52
-	/**
53
-	 * @inheritdoc
54
-	 */
55
-	public function getName() {
56
-		return 'Registering background jobs to update cache for webcal calendars';
57
-	}
52
+    /**
53
+     * @inheritdoc
54
+     */
55
+    public function getName() {
56
+        return 'Registering background jobs to update cache for webcal calendars';
57
+    }
58 58
 
59
-	/**
60
-	 * @inheritdoc
61
-	 */
62
-	public function run(IOutput $output) {
63
-		$query = $this->connection->getQueryBuilder();
64
-		$query->select(['principaluri', 'uri'])
65
-			->from('calendarsubscriptions');
66
-		$stmt = $query->execute();
59
+    /**
60
+     * @inheritdoc
61
+     */
62
+    public function run(IOutput $output) {
63
+        $query = $this->connection->getQueryBuilder();
64
+        $query->select(['principaluri', 'uri'])
65
+            ->from('calendarsubscriptions');
66
+        $stmt = $query->execute();
67 67
 
68
-		$count = 0;
69
-		while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
70
-			$args = [
71
-				'principaluri' => $row['principaluri'],
72
-				'uri' => $row['uri'],
73
-			];
68
+        $count = 0;
69
+        while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
70
+            $args = [
71
+                'principaluri' => $row['principaluri'],
72
+                'uri' => $row['uri'],
73
+            ];
74 74
 
75
-			if (!$this->jobList->has(RefreshWebcalJob::class, $args)) {
76
-				$this->jobList->add(RefreshWebcalJob::class, $args);
77
-				$count++;
78
-			}
79
-		}
75
+            if (!$this->jobList->has(RefreshWebcalJob::class, $args)) {
76
+                $this->jobList->add(RefreshWebcalJob::class, $args);
77
+                $count++;
78
+            }
79
+        }
80 80
 
81
-		$output->info("Added $count background jobs to update webcal calendars");
82
-	}
81
+        $output->info("Added $count background jobs to update webcal calendars");
82
+    }
83 83
 }
Please login to merge, or discard this patch.
apps/dav/lib/Migration/Version1006Date20180628111625.php 1 patch
Indentation   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -31,78 +31,78 @@
 block discarded – undo
31 31
 
32 32
 class Version1006Date20180628111625 extends SimpleMigrationStep {
33 33
 
34
-	/**
35
-	 * @param IOutput $output
36
-	 * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
37
-	 * @param array $options
38
-	 * @return null|ISchemaWrapper
39
-	 */
40
-	public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
41
-		/** @var ISchemaWrapper $schema */
42
-		$schema = $schemaClosure();
34
+    /**
35
+     * @param IOutput $output
36
+     * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
37
+     * @param array $options
38
+     * @return null|ISchemaWrapper
39
+     */
40
+    public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
41
+        /** @var ISchemaWrapper $schema */
42
+        $schema = $schemaClosure();
43 43
 
44
-		if (!$schema->hasTable('calendarsubscrobjects')) {
45
-			$table = $schema->createTable('calendarsubscrobjects');
46
-			$table->addColumn('id', Type::BIGINT, [
47
-				'autoincrement' => true,
48
-				'notnull' => true,
49
-				'length' => 11,
50
-				'unsigned' => true,
51
-			]);
52
-			$table->addColumn('calendardata', Type::BLOB, [
53
-				'notnull' => false,
54
-			]);
55
-			$table->addColumn('uri', Type::STRING, [
56
-				'notnull' => false,
57
-				'length' => 255,
58
-			]);
59
-			$table->addColumn('subscriptionid', Type::BIGINT, [
60
-				'notnull' => true,
61
-				'length' => 11,
62
-				'unsigned' => true,
63
-			]);
64
-			$table->addColumn('lastmodified', Type::INTEGER, [
65
-				'notnull' => false,
66
-				'length' => 10,
67
-				'unsigned' => true,
68
-			]);
69
-			$table->addColumn('etag', Type::STRING, [
70
-				'notnull' => false,
71
-				'length' => 32,
72
-			]);
73
-			$table->addColumn('size', Type::BIGINT, [
74
-				'notnull' => true,
75
-				'length' => 11,
76
-				'unsigned' => true,
77
-			]);
78
-			$table->addColumn('componenttype', Type::STRING, [
79
-				'notnull' => false,
80
-				'length' => 8,
81
-			]);
82
-			$table->addColumn('firstoccurence', Type::BIGINT, [
83
-				'notnull' => false,
84
-				'length' => 11,
85
-				'unsigned' => true,
86
-			]);
87
-			$table->addColumn('lastoccurence', Type::BIGINT, [
88
-				'notnull' => false,
89
-				'length' => 11,
90
-				'unsigned' => true,
91
-			]);
92
-			$table->addColumn('uid', Type::STRING, [
93
-				'notnull' => false,
94
-				'length' => 255,
95
-			]);
96
-			$table->addColumn('classification', Type::INTEGER, [
97
-				'notnull' => false,
98
-				'default' => 0,
99
-			]);
100
-			$table->setPrimaryKey(['id']);
101
-			$table->addUniqueIndex(['subscriptionid', 'uri'], 'subobjects_index');
102
-		}
44
+        if (!$schema->hasTable('calendarsubscrobjects')) {
45
+            $table = $schema->createTable('calendarsubscrobjects');
46
+            $table->addColumn('id', Type::BIGINT, [
47
+                'autoincrement' => true,
48
+                'notnull' => true,
49
+                'length' => 11,
50
+                'unsigned' => true,
51
+            ]);
52
+            $table->addColumn('calendardata', Type::BLOB, [
53
+                'notnull' => false,
54
+            ]);
55
+            $table->addColumn('uri', Type::STRING, [
56
+                'notnull' => false,
57
+                'length' => 255,
58
+            ]);
59
+            $table->addColumn('subscriptionid', Type::BIGINT, [
60
+                'notnull' => true,
61
+                'length' => 11,
62
+                'unsigned' => true,
63
+            ]);
64
+            $table->addColumn('lastmodified', Type::INTEGER, [
65
+                'notnull' => false,
66
+                'length' => 10,
67
+                'unsigned' => true,
68
+            ]);
69
+            $table->addColumn('etag', Type::STRING, [
70
+                'notnull' => false,
71
+                'length' => 32,
72
+            ]);
73
+            $table->addColumn('size', Type::BIGINT, [
74
+                'notnull' => true,
75
+                'length' => 11,
76
+                'unsigned' => true,
77
+            ]);
78
+            $table->addColumn('componenttype', Type::STRING, [
79
+                'notnull' => false,
80
+                'length' => 8,
81
+            ]);
82
+            $table->addColumn('firstoccurence', Type::BIGINT, [
83
+                'notnull' => false,
84
+                'length' => 11,
85
+                'unsigned' => true,
86
+            ]);
87
+            $table->addColumn('lastoccurence', Type::BIGINT, [
88
+                'notnull' => false,
89
+                'length' => 11,
90
+                'unsigned' => true,
91
+            ]);
92
+            $table->addColumn('uid', Type::STRING, [
93
+                'notnull' => false,
94
+                'length' => 255,
95
+            ]);
96
+            $table->addColumn('classification', Type::INTEGER, [
97
+                'notnull' => false,
98
+                'default' => 0,
99
+            ]);
100
+            $table->setPrimaryKey(['id']);
101
+            $table->addUniqueIndex(['subscriptionid', 'uri'], 'subobjects_index');
102
+        }
103 103
 
104
-		return $schema;
105
-	}
104
+        return $schema;
105
+    }
106 106
 }
107 107
 
108 108
 
Please login to merge, or discard this patch.