Passed
Push — master ( 927130...9d89f8 )
by Roeland
35:01 queued 22:12
created
apps/dav/composer/composer/autoload_classmap.php 1 patch
Spacing   +167 added lines, -167 removed lines patch added patch discarded remove patch
@@ -6,171 +6,171 @@
 block discarded – undo
6 6
 $baseDir = $vendorDir;
7 7
 
8 8
 return array(
9
-    'OCA\\DAV\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php',
10
-    'OCA\\DAV\\AppInfo\\PluginManager' => $baseDir . '/../lib/AppInfo/PluginManager.php',
11
-    'OCA\\DAV\\Avatars\\AvatarHome' => $baseDir . '/../lib/Avatars/AvatarHome.php',
12
-    'OCA\\DAV\\Avatars\\AvatarNode' => $baseDir . '/../lib/Avatars/AvatarNode.php',
13
-    'OCA\\DAV\\Avatars\\RootCollection' => $baseDir . '/../lib/Avatars/RootCollection.php',
14
-    'OCA\\DAV\\BackgroundJob\\CleanupDirectLinksJob' => $baseDir . '/../lib/BackgroundJob/CleanupDirectLinksJob.php',
15
-    'OCA\\DAV\\BackgroundJob\\CleanupInvitationTokenJob' => $baseDir . '/../lib/BackgroundJob/CleanupInvitationTokenJob.php',
16
-    'OCA\\DAV\\BackgroundJob\\GenerateBirthdayCalendarBackgroundJob' => $baseDir . '/../lib/BackgroundJob/GenerateBirthdayCalendarBackgroundJob.php',
17
-    'OCA\\DAV\\BackgroundJob\\UpdateCalendarResourcesRoomsBackgroundJob' => $baseDir . '/../lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php',
18
-    'OCA\\DAV\\CalDAV\\Activity\\Backend' => $baseDir . '/../lib/CalDAV/Activity/Backend.php',
19
-    'OCA\\DAV\\CalDAV\\Activity\\Filter\\Calendar' => $baseDir . '/../lib/CalDAV/Activity/Filter/Calendar.php',
20
-    'OCA\\DAV\\CalDAV\\Activity\\Filter\\Todo' => $baseDir . '/../lib/CalDAV/Activity/Filter/Todo.php',
21
-    'OCA\\DAV\\CalDAV\\Activity\\Provider\\Base' => $baseDir . '/../lib/CalDAV/Activity/Provider/Base.php',
22
-    'OCA\\DAV\\CalDAV\\Activity\\Provider\\Calendar' => $baseDir . '/../lib/CalDAV/Activity/Provider/Calendar.php',
23
-    'OCA\\DAV\\CalDAV\\Activity\\Provider\\Event' => $baseDir . '/../lib/CalDAV/Activity/Provider/Event.php',
24
-    'OCA\\DAV\\CalDAV\\Activity\\Provider\\Todo' => $baseDir . '/../lib/CalDAV/Activity/Provider/Todo.php',
25
-    'OCA\\DAV\\CalDAV\\Activity\\Setting\\Calendar' => $baseDir . '/../lib/CalDAV/Activity/Setting/Calendar.php',
26
-    'OCA\\DAV\\CalDAV\\Activity\\Setting\\Event' => $baseDir . '/../lib/CalDAV/Activity/Setting/Event.php',
27
-    'OCA\\DAV\\CalDAV\\Activity\\Setting\\Todo' => $baseDir . '/../lib/CalDAV/Activity/Setting/Todo.php',
28
-    'OCA\\DAV\\CalDAV\\BirthdayCalendar\\EnablePlugin' => $baseDir . '/../lib/CalDAV/BirthdayCalendar/EnablePlugin.php',
29
-    'OCA\\DAV\\CalDAV\\BirthdayService' => $baseDir . '/../lib/CalDAV/BirthdayService.php',
30
-    'OCA\\DAV\\CalDAV\\CalDavBackend' => $baseDir . '/../lib/CalDAV/CalDavBackend.php',
31
-    'OCA\\DAV\\CalDAV\\Calendar' => $baseDir . '/../lib/CalDAV/Calendar.php',
32
-    'OCA\\DAV\\CalDAV\\CalendarHome' => $baseDir . '/../lib/CalDAV/CalendarHome.php',
33
-    'OCA\\DAV\\CalDAV\\CalendarImpl' => $baseDir . '/../lib/CalDAV/CalendarImpl.php',
34
-    'OCA\\DAV\\CalDAV\\CalendarManager' => $baseDir . '/../lib/CalDAV/CalendarManager.php',
35
-    'OCA\\DAV\\CalDAV\\CalendarObject' => $baseDir . '/../lib/CalDAV/CalendarObject.php',
36
-    'OCA\\DAV\\CalDAV\\CalendarRoot' => $baseDir . '/../lib/CalDAV/CalendarRoot.php',
37
-    'OCA\\DAV\\CalDAV\\InvitationResponse\\InvitationResponseServer' => $baseDir . '/../lib/CalDAV/InvitationResponse/InvitationResponseServer.php',
38
-    'OCA\\DAV\\CalDAV\\Outbox' => $baseDir . '/../lib/CalDAV/Outbox.php',
39
-    'OCA\\DAV\\CalDAV\\Plugin' => $baseDir . '/../lib/CalDAV/Plugin.php',
40
-    'OCA\\DAV\\CalDAV\\Principal\\Collection' => $baseDir . '/../lib/CalDAV/Principal/Collection.php',
41
-    'OCA\\DAV\\CalDAV\\Principal\\User' => $baseDir . '/../lib/CalDAV/Principal/User.php',
42
-    'OCA\\DAV\\CalDAV\\PublicCalendar' => $baseDir . '/../lib/CalDAV/PublicCalendar.php',
43
-    'OCA\\DAV\\CalDAV\\PublicCalendarObject' => $baseDir . '/../lib/CalDAV/PublicCalendarObject.php',
44
-    'OCA\\DAV\\CalDAV\\PublicCalendarRoot' => $baseDir . '/../lib/CalDAV/PublicCalendarRoot.php',
45
-    'OCA\\DAV\\CalDAV\\Publishing\\PublishPlugin' => $baseDir . '/../lib/CalDAV/Publishing/PublishPlugin.php',
46
-    'OCA\\DAV\\CalDAV\\Publishing\\Xml\\Publisher' => $baseDir . '/../lib/CalDAV/Publishing/Xml/Publisher.php',
47
-    'OCA\\DAV\\CalDAV\\ResourceBooking\\AbstractPrincipalBackend' => $baseDir . '/../lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php',
48
-    'OCA\\DAV\\CalDAV\\ResourceBooking\\ResourcePrincipalBackend' => $baseDir . '/../lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php',
49
-    'OCA\\DAV\\CalDAV\\ResourceBooking\\RoomPrincipalBackend' => $baseDir . '/../lib/CalDAV/ResourceBooking/RoomPrincipalBackend.php',
50
-    'OCA\\DAV\\CalDAV\\Schedule\\IMipPlugin' => $baseDir . '/../lib/CalDAV/Schedule/IMipPlugin.php',
51
-    'OCA\\DAV\\CalDAV\\Schedule\\Plugin' => $baseDir . '/../lib/CalDAV/Schedule/Plugin.php',
52
-    'OCA\\DAV\\CalDAV\\Search\\SearchPlugin' => $baseDir . '/../lib/CalDAV/Search/SearchPlugin.php',
53
-    'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\CompFilter' => $baseDir . '/../lib/CalDAV/Search/Xml/Filter/CompFilter.php',
54
-    'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\LimitFilter' => $baseDir . '/../lib/CalDAV/Search/Xml/Filter/LimitFilter.php',
55
-    'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\OffsetFilter' => $baseDir . '/../lib/CalDAV/Search/Xml/Filter/OffsetFilter.php',
56
-    'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\ParamFilter' => $baseDir . '/../lib/CalDAV/Search/Xml/Filter/ParamFilter.php',
57
-    'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\PropFilter' => $baseDir . '/../lib/CalDAV/Search/Xml/Filter/PropFilter.php',
58
-    'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\SearchTermFilter' => $baseDir . '/../lib/CalDAV/Search/Xml/Filter/SearchTermFilter.php',
59
-    'OCA\\DAV\\CalDAV\\Search\\Xml\\Request\\CalendarSearchReport' => $baseDir . '/../lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php',
60
-    'OCA\\DAV\\Capabilities' => $baseDir . '/../lib/Capabilities.php',
61
-    'OCA\\DAV\\CardDAV\\AddressBook' => $baseDir . '/../lib/CardDAV/AddressBook.php',
62
-    'OCA\\DAV\\CardDAV\\AddressBookImpl' => $baseDir . '/../lib/CardDAV/AddressBookImpl.php',
63
-    'OCA\\DAV\\CardDAV\\AddressBookRoot' => $baseDir . '/../lib/CardDAV/AddressBookRoot.php',
64
-    'OCA\\DAV\\CardDAV\\CardDavBackend' => $baseDir . '/../lib/CardDAV/CardDavBackend.php',
65
-    'OCA\\DAV\\CardDAV\\ContactsManager' => $baseDir . '/../lib/CardDAV/ContactsManager.php',
66
-    'OCA\\DAV\\CardDAV\\Converter' => $baseDir . '/../lib/CardDAV/Converter.php',
67
-    'OCA\\DAV\\CardDAV\\ImageExportPlugin' => $baseDir . '/../lib/CardDAV/ImageExportPlugin.php',
68
-    'OCA\\DAV\\CardDAV\\PhotoCache' => $baseDir . '/../lib/CardDAV/PhotoCache.php',
69
-    'OCA\\DAV\\CardDAV\\Plugin' => $baseDir . '/../lib/CardDAV/Plugin.php',
70
-    'OCA\\DAV\\CardDAV\\SyncService' => $baseDir . '/../lib/CardDAV/SyncService.php',
71
-    'OCA\\DAV\\CardDAV\\UserAddressBooks' => $baseDir . '/../lib/CardDAV/UserAddressBooks.php',
72
-    'OCA\\DAV\\CardDAV\\Xml\\Groups' => $baseDir . '/../lib/CardDAV/Xml/Groups.php',
73
-    'OCA\\DAV\\Command\\CreateAddressBook' => $baseDir . '/../lib/Command/CreateAddressBook.php',
74
-    'OCA\\DAV\\Command\\CreateCalendar' => $baseDir . '/../lib/Command/CreateCalendar.php',
75
-    'OCA\\DAV\\Command\\RemoveInvalidShares' => $baseDir . '/../lib/Command/RemoveInvalidShares.php',
76
-    'OCA\\DAV\\Command\\SyncBirthdayCalendar' => $baseDir . '/../lib/Command/SyncBirthdayCalendar.php',
77
-    'OCA\\DAV\\Command\\SyncSystemAddressBook' => $baseDir . '/../lib/Command/SyncSystemAddressBook.php',
78
-    'OCA\\DAV\\Comments\\CommentNode' => $baseDir . '/../lib/Comments/CommentNode.php',
79
-    'OCA\\DAV\\Comments\\CommentsPlugin' => $baseDir . '/../lib/Comments/CommentsPlugin.php',
80
-    'OCA\\DAV\\Comments\\EntityCollection' => $baseDir . '/../lib/Comments/EntityCollection.php',
81
-    'OCA\\DAV\\Comments\\EntityTypeCollection' => $baseDir . '/../lib/Comments/EntityTypeCollection.php',
82
-    'OCA\\DAV\\Comments\\RootCollection' => $baseDir . '/../lib/Comments/RootCollection.php',
83
-    'OCA\\DAV\\Connector\\LegacyDAVACL' => $baseDir . '/../lib/Connector/LegacyDAVACL.php',
84
-    'OCA\\DAV\\Connector\\PublicAuth' => $baseDir . '/../lib/Connector/PublicAuth.php',
85
-    'OCA\\DAV\\Connector\\Sabre\\AnonymousOptionsPlugin' => $baseDir . '/../lib/Connector/Sabre/AnonymousOptionsPlugin.php',
86
-    'OCA\\DAV\\Connector\\Sabre\\AppEnabledPlugin' => $baseDir . '/../lib/Connector/Sabre/AppEnabledPlugin.php',
87
-    'OCA\\DAV\\Connector\\Sabre\\Auth' => $baseDir . '/../lib/Connector/Sabre/Auth.php',
88
-    'OCA\\DAV\\Connector\\Sabre\\BearerAuth' => $baseDir . '/../lib/Connector/Sabre/BearerAuth.php',
89
-    'OCA\\DAV\\Connector\\Sabre\\BlockLegacyClientPlugin' => $baseDir . '/../lib/Connector/Sabre/BlockLegacyClientPlugin.php',
90
-    'OCA\\DAV\\Connector\\Sabre\\CachingTree' => $baseDir . '/../lib/Connector/Sabre/CachingTree.php',
91
-    'OCA\\DAV\\Connector\\Sabre\\ChecksumList' => $baseDir . '/../lib/Connector/Sabre/ChecksumList.php',
92
-    'OCA\\DAV\\Connector\\Sabre\\CommentPropertiesPlugin' => $baseDir . '/../lib/Connector/Sabre/CommentPropertiesPlugin.php',
93
-    'OCA\\DAV\\Connector\\Sabre\\CopyEtagHeaderPlugin' => $baseDir . '/../lib/Connector/Sabre/CopyEtagHeaderPlugin.php',
94
-    'OCA\\DAV\\Connector\\Sabre\\CustomPropertiesBackend' => $baseDir . '/../lib/Connector/Sabre/CustomPropertiesBackend.php',
95
-    'OCA\\DAV\\Connector\\Sabre\\DavAclPlugin' => $baseDir . '/../lib/Connector/Sabre/DavAclPlugin.php',
96
-    'OCA\\DAV\\Connector\\Sabre\\Directory' => $baseDir . '/../lib/Connector/Sabre/Directory.php',
97
-    'OCA\\DAV\\Connector\\Sabre\\DummyGetResponsePlugin' => $baseDir . '/../lib/Connector/Sabre/DummyGetResponsePlugin.php',
98
-    'OCA\\DAV\\Connector\\Sabre\\ExceptionLoggerPlugin' => $baseDir . '/../lib/Connector/Sabre/ExceptionLoggerPlugin.php',
99
-    'OCA\\DAV\\Connector\\Sabre\\Exception\\EntityTooLarge' => $baseDir . '/../lib/Connector/Sabre/Exception/EntityTooLarge.php',
100
-    'OCA\\DAV\\Connector\\Sabre\\Exception\\FileLocked' => $baseDir . '/../lib/Connector/Sabre/Exception/FileLocked.php',
101
-    'OCA\\DAV\\Connector\\Sabre\\Exception\\Forbidden' => $baseDir . '/../lib/Connector/Sabre/Exception/Forbidden.php',
102
-    'OCA\\DAV\\Connector\\Sabre\\Exception\\InvalidPath' => $baseDir . '/../lib/Connector/Sabre/Exception/InvalidPath.php',
103
-    'OCA\\DAV\\Connector\\Sabre\\Exception\\PasswordLoginForbidden' => $baseDir . '/../lib/Connector/Sabre/Exception/PasswordLoginForbidden.php',
104
-    'OCA\\DAV\\Connector\\Sabre\\Exception\\UnsupportedMediaType' => $baseDir . '/../lib/Connector/Sabre/Exception/UnsupportedMediaType.php',
105
-    'OCA\\DAV\\Connector\\Sabre\\FakeLockerPlugin' => $baseDir . '/../lib/Connector/Sabre/FakeLockerPlugin.php',
106
-    'OCA\\DAV\\Connector\\Sabre\\File' => $baseDir . '/../lib/Connector/Sabre/File.php',
107
-    'OCA\\DAV\\Connector\\Sabre\\FilesPlugin' => $baseDir . '/../lib/Connector/Sabre/FilesPlugin.php',
108
-    'OCA\\DAV\\Connector\\Sabre\\FilesReportPlugin' => $baseDir . '/../lib/Connector/Sabre/FilesReportPlugin.php',
109
-    'OCA\\DAV\\Connector\\Sabre\\LockPlugin' => $baseDir . '/../lib/Connector/Sabre/LockPlugin.php',
110
-    'OCA\\DAV\\Connector\\Sabre\\MaintenancePlugin' => $baseDir . '/../lib/Connector/Sabre/MaintenancePlugin.php',
111
-    'OCA\\DAV\\Connector\\Sabre\\Node' => $baseDir . '/../lib/Connector/Sabre/Node.php',
112
-    'OCA\\DAV\\Connector\\Sabre\\ObjectTree' => $baseDir . '/../lib/Connector/Sabre/ObjectTree.php',
113
-    'OCA\\DAV\\Connector\\Sabre\\Principal' => $baseDir . '/../lib/Connector/Sabre/Principal.php',
114
-    'OCA\\DAV\\Connector\\Sabre\\QuotaPlugin' => $baseDir . '/../lib/Connector/Sabre/QuotaPlugin.php',
115
-    'OCA\\DAV\\Connector\\Sabre\\Server' => $baseDir . '/../lib/Connector/Sabre/Server.php',
116
-    'OCA\\DAV\\Connector\\Sabre\\ServerFactory' => $baseDir . '/../lib/Connector/Sabre/ServerFactory.php',
117
-    'OCA\\DAV\\Connector\\Sabre\\ShareTypeList' => $baseDir . '/../lib/Connector/Sabre/ShareTypeList.php',
118
-    'OCA\\DAV\\Connector\\Sabre\\SharesPlugin' => $baseDir . '/../lib/Connector/Sabre/SharesPlugin.php',
119
-    'OCA\\DAV\\Connector\\Sabre\\TagList' => $baseDir . '/../lib/Connector/Sabre/TagList.php',
120
-    'OCA\\DAV\\Connector\\Sabre\\TagsPlugin' => $baseDir . '/../lib/Connector/Sabre/TagsPlugin.php',
121
-    'OCA\\DAV\\Controller\\BirthdayCalendarController' => $baseDir . '/../lib/Controller/BirthdayCalendarController.php',
122
-    'OCA\\DAV\\Controller\\DirectController' => $baseDir . '/../lib/Controller/DirectController.php',
123
-    'OCA\\DAV\\Controller\\InvitationResponseController' => $baseDir . '/../lib/Controller/InvitationResponseController.php',
124
-    'OCA\\DAV\\DAV\\CustomPropertiesBackend' => $baseDir . '/../lib/DAV/CustomPropertiesBackend.php',
125
-    'OCA\\DAV\\DAV\\GroupPrincipalBackend' => $baseDir . '/../lib/DAV/GroupPrincipalBackend.php',
126
-    'OCA\\DAV\\DAV\\PublicAuth' => $baseDir . '/../lib/DAV/PublicAuth.php',
127
-    'OCA\\DAV\\DAV\\Sharing\\Backend' => $baseDir . '/../lib/DAV/Sharing/Backend.php',
128
-    'OCA\\DAV\\DAV\\Sharing\\IShareable' => $baseDir . '/../lib/DAV/Sharing/IShareable.php',
129
-    'OCA\\DAV\\DAV\\Sharing\\Plugin' => $baseDir . '/../lib/DAV/Sharing/Plugin.php',
130
-    'OCA\\DAV\\DAV\\Sharing\\Xml\\Invite' => $baseDir . '/../lib/DAV/Sharing/Xml/Invite.php',
131
-    'OCA\\DAV\\DAV\\Sharing\\Xml\\ShareRequest' => $baseDir . '/../lib/DAV/Sharing/Xml/ShareRequest.php',
132
-    'OCA\\DAV\\DAV\\SystemPrincipalBackend' => $baseDir . '/../lib/DAV/SystemPrincipalBackend.php',
133
-    'OCA\\DAV\\Db\\Direct' => $baseDir . '/../lib/Db/Direct.php',
134
-    'OCA\\DAV\\Db\\DirectMapper' => $baseDir . '/../lib/Db/DirectMapper.php',
135
-    'OCA\\DAV\\Direct\\DirectFile' => $baseDir . '/../lib/Direct/DirectFile.php',
136
-    'OCA\\DAV\\Direct\\DirectHome' => $baseDir . '/../lib/Direct/DirectHome.php',
137
-    'OCA\\DAV\\Direct\\Server' => $baseDir . '/../lib/Direct/Server.php',
138
-    'OCA\\DAV\\Direct\\ServerFactory' => $baseDir . '/../lib/Direct/ServerFactory.php',
139
-    'OCA\\DAV\\Files\\BrowserErrorPagePlugin' => $baseDir . '/../lib/Files/BrowserErrorPagePlugin.php',
140
-    'OCA\\DAV\\Files\\FileSearchBackend' => $baseDir . '/../lib/Files/FileSearchBackend.php',
141
-    'OCA\\DAV\\Files\\FilesHome' => $baseDir . '/../lib/Files/FilesHome.php',
142
-    'OCA\\DAV\\Files\\LazySearchBackend' => $baseDir . '/../lib/Files/LazySearchBackend.php',
143
-    'OCA\\DAV\\Files\\RootCollection' => $baseDir . '/../lib/Files/RootCollection.php',
144
-    'OCA\\DAV\\Files\\Sharing\\FilesDropPlugin' => $baseDir . '/../lib/Files/Sharing/FilesDropPlugin.php',
145
-    'OCA\\DAV\\Files\\Sharing\\PublicLinkCheckPlugin' => $baseDir . '/../lib/Files/Sharing/PublicLinkCheckPlugin.php',
146
-    'OCA\\DAV\\HookManager' => $baseDir . '/../lib/HookManager.php',
147
-    'OCA\\DAV\\Migration\\BuildCalendarSearchIndex' => $baseDir . '/../lib/Migration/BuildCalendarSearchIndex.php',
148
-    'OCA\\DAV\\Migration\\BuildCalendarSearchIndexBackgroundJob' => $baseDir . '/../lib/Migration/BuildCalendarSearchIndexBackgroundJob.php',
149
-    'OCA\\DAV\\Migration\\CalDAVRemoveEmptyValue' => $baseDir . '/../lib/Migration/CalDAVRemoveEmptyValue.php',
150
-    'OCA\\DAV\\Migration\\FixBirthdayCalendarComponent' => $baseDir . '/../lib/Migration/FixBirthdayCalendarComponent.php',
151
-    'OCA\\DAV\\Migration\\Version1004Date20170825134824' => $baseDir . '/../lib/Migration/Version1004Date20170825134824.php',
152
-    'OCA\\DAV\\Migration\\Version1004Date20170919104507' => $baseDir . '/../lib/Migration/Version1004Date20170919104507.php',
153
-    'OCA\\DAV\\Migration\\Version1004Date20170924124212' => $baseDir . '/../lib/Migration/Version1004Date20170924124212.php',
154
-    'OCA\\DAV\\Migration\\Version1004Date20170926103422' => $baseDir . '/../lib/Migration/Version1004Date20170926103422.php',
155
-    'OCA\\DAV\\Migration\\Version1005Date20180413093149' => $baseDir . '/../lib/Migration/Version1005Date20180413093149.php',
156
-    'OCA\\DAV\\Migration\\Version1005Date20180530124431' => $baseDir . '/../lib/Migration/Version1005Date20180530124431.php',
157
-    'OCA\\DAV\\Migration\\Version1006Date20180619154313' => $baseDir . '/../lib/Migration/Version1006Date20180619154313.php',
158
-    'OCA\\DAV\\Migration\\Version1007Date20181007225117' => $baseDir . '/../lib/Migration/Version1007Date20181007225117.php',
159
-    'OCA\\DAV\\Migration\\Version1008Date20181030113700' => $baseDir . '/../lib/Migration/Version1008Date20181030113700.php',
160
-    'OCA\\DAV\\RootCollection' => $baseDir . '/../lib/RootCollection.php',
161
-    'OCA\\DAV\\Server' => $baseDir . '/../lib/Server.php',
162
-    'OCA\\DAV\\Settings\\CalDAVSettings' => $baseDir . '/../lib/Settings/CalDAVSettings.php',
163
-    'OCA\\DAV\\SystemTag\\SystemTagMappingNode' => $baseDir . '/../lib/SystemTag/SystemTagMappingNode.php',
164
-    'OCA\\DAV\\SystemTag\\SystemTagNode' => $baseDir . '/../lib/SystemTag/SystemTagNode.php',
165
-    'OCA\\DAV\\SystemTag\\SystemTagPlugin' => $baseDir . '/../lib/SystemTag/SystemTagPlugin.php',
166
-    'OCA\\DAV\\SystemTag\\SystemTagsByIdCollection' => $baseDir . '/../lib/SystemTag/SystemTagsByIdCollection.php',
167
-    'OCA\\DAV\\SystemTag\\SystemTagsObjectMappingCollection' => $baseDir . '/../lib/SystemTag/SystemTagsObjectMappingCollection.php',
168
-    'OCA\\DAV\\SystemTag\\SystemTagsObjectTypeCollection' => $baseDir . '/../lib/SystemTag/SystemTagsObjectTypeCollection.php',
169
-    'OCA\\DAV\\SystemTag\\SystemTagsRelationsCollection' => $baseDir . '/../lib/SystemTag/SystemTagsRelationsCollection.php',
170
-    'OCA\\DAV\\Upload\\AssemblyStream' => $baseDir . '/../lib/Upload/AssemblyStream.php',
171
-    'OCA\\DAV\\Upload\\ChunkingPlugin' => $baseDir . '/../lib/Upload/ChunkingPlugin.php',
172
-    'OCA\\DAV\\Upload\\FutureFile' => $baseDir . '/../lib/Upload/FutureFile.php',
173
-    'OCA\\DAV\\Upload\\RootCollection' => $baseDir . '/../lib/Upload/RootCollection.php',
174
-    'OCA\\DAV\\Upload\\UploadFolder' => $baseDir . '/../lib/Upload/UploadFolder.php',
175
-    'OCA\\DAV\\Upload\\UploadHome' => $baseDir . '/../lib/Upload/UploadHome.php',
9
+    'OCA\\DAV\\AppInfo\\Application' => $baseDir.'/../lib/AppInfo/Application.php',
10
+    'OCA\\DAV\\AppInfo\\PluginManager' => $baseDir.'/../lib/AppInfo/PluginManager.php',
11
+    'OCA\\DAV\\Avatars\\AvatarHome' => $baseDir.'/../lib/Avatars/AvatarHome.php',
12
+    'OCA\\DAV\\Avatars\\AvatarNode' => $baseDir.'/../lib/Avatars/AvatarNode.php',
13
+    'OCA\\DAV\\Avatars\\RootCollection' => $baseDir.'/../lib/Avatars/RootCollection.php',
14
+    'OCA\\DAV\\BackgroundJob\\CleanupDirectLinksJob' => $baseDir.'/../lib/BackgroundJob/CleanupDirectLinksJob.php',
15
+    'OCA\\DAV\\BackgroundJob\\CleanupInvitationTokenJob' => $baseDir.'/../lib/BackgroundJob/CleanupInvitationTokenJob.php',
16
+    'OCA\\DAV\\BackgroundJob\\GenerateBirthdayCalendarBackgroundJob' => $baseDir.'/../lib/BackgroundJob/GenerateBirthdayCalendarBackgroundJob.php',
17
+    'OCA\\DAV\\BackgroundJob\\UpdateCalendarResourcesRoomsBackgroundJob' => $baseDir.'/../lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php',
18
+    'OCA\\DAV\\CalDAV\\Activity\\Backend' => $baseDir.'/../lib/CalDAV/Activity/Backend.php',
19
+    'OCA\\DAV\\CalDAV\\Activity\\Filter\\Calendar' => $baseDir.'/../lib/CalDAV/Activity/Filter/Calendar.php',
20
+    'OCA\\DAV\\CalDAV\\Activity\\Filter\\Todo' => $baseDir.'/../lib/CalDAV/Activity/Filter/Todo.php',
21
+    'OCA\\DAV\\CalDAV\\Activity\\Provider\\Base' => $baseDir.'/../lib/CalDAV/Activity/Provider/Base.php',
22
+    'OCA\\DAV\\CalDAV\\Activity\\Provider\\Calendar' => $baseDir.'/../lib/CalDAV/Activity/Provider/Calendar.php',
23
+    'OCA\\DAV\\CalDAV\\Activity\\Provider\\Event' => $baseDir.'/../lib/CalDAV/Activity/Provider/Event.php',
24
+    'OCA\\DAV\\CalDAV\\Activity\\Provider\\Todo' => $baseDir.'/../lib/CalDAV/Activity/Provider/Todo.php',
25
+    'OCA\\DAV\\CalDAV\\Activity\\Setting\\Calendar' => $baseDir.'/../lib/CalDAV/Activity/Setting/Calendar.php',
26
+    'OCA\\DAV\\CalDAV\\Activity\\Setting\\Event' => $baseDir.'/../lib/CalDAV/Activity/Setting/Event.php',
27
+    'OCA\\DAV\\CalDAV\\Activity\\Setting\\Todo' => $baseDir.'/../lib/CalDAV/Activity/Setting/Todo.php',
28
+    'OCA\\DAV\\CalDAV\\BirthdayCalendar\\EnablePlugin' => $baseDir.'/../lib/CalDAV/BirthdayCalendar/EnablePlugin.php',
29
+    'OCA\\DAV\\CalDAV\\BirthdayService' => $baseDir.'/../lib/CalDAV/BirthdayService.php',
30
+    'OCA\\DAV\\CalDAV\\CalDavBackend' => $baseDir.'/../lib/CalDAV/CalDavBackend.php',
31
+    'OCA\\DAV\\CalDAV\\Calendar' => $baseDir.'/../lib/CalDAV/Calendar.php',
32
+    'OCA\\DAV\\CalDAV\\CalendarHome' => $baseDir.'/../lib/CalDAV/CalendarHome.php',
33
+    'OCA\\DAV\\CalDAV\\CalendarImpl' => $baseDir.'/../lib/CalDAV/CalendarImpl.php',
34
+    'OCA\\DAV\\CalDAV\\CalendarManager' => $baseDir.'/../lib/CalDAV/CalendarManager.php',
35
+    'OCA\\DAV\\CalDAV\\CalendarObject' => $baseDir.'/../lib/CalDAV/CalendarObject.php',
36
+    'OCA\\DAV\\CalDAV\\CalendarRoot' => $baseDir.'/../lib/CalDAV/CalendarRoot.php',
37
+    'OCA\\DAV\\CalDAV\\InvitationResponse\\InvitationResponseServer' => $baseDir.'/../lib/CalDAV/InvitationResponse/InvitationResponseServer.php',
38
+    'OCA\\DAV\\CalDAV\\Outbox' => $baseDir.'/../lib/CalDAV/Outbox.php',
39
+    'OCA\\DAV\\CalDAV\\Plugin' => $baseDir.'/../lib/CalDAV/Plugin.php',
40
+    'OCA\\DAV\\CalDAV\\Principal\\Collection' => $baseDir.'/../lib/CalDAV/Principal/Collection.php',
41
+    'OCA\\DAV\\CalDAV\\Principal\\User' => $baseDir.'/../lib/CalDAV/Principal/User.php',
42
+    'OCA\\DAV\\CalDAV\\PublicCalendar' => $baseDir.'/../lib/CalDAV/PublicCalendar.php',
43
+    'OCA\\DAV\\CalDAV\\PublicCalendarObject' => $baseDir.'/../lib/CalDAV/PublicCalendarObject.php',
44
+    'OCA\\DAV\\CalDAV\\PublicCalendarRoot' => $baseDir.'/../lib/CalDAV/PublicCalendarRoot.php',
45
+    'OCA\\DAV\\CalDAV\\Publishing\\PublishPlugin' => $baseDir.'/../lib/CalDAV/Publishing/PublishPlugin.php',
46
+    'OCA\\DAV\\CalDAV\\Publishing\\Xml\\Publisher' => $baseDir.'/../lib/CalDAV/Publishing/Xml/Publisher.php',
47
+    'OCA\\DAV\\CalDAV\\ResourceBooking\\AbstractPrincipalBackend' => $baseDir.'/../lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php',
48
+    'OCA\\DAV\\CalDAV\\ResourceBooking\\ResourcePrincipalBackend' => $baseDir.'/../lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php',
49
+    'OCA\\DAV\\CalDAV\\ResourceBooking\\RoomPrincipalBackend' => $baseDir.'/../lib/CalDAV/ResourceBooking/RoomPrincipalBackend.php',
50
+    'OCA\\DAV\\CalDAV\\Schedule\\IMipPlugin' => $baseDir.'/../lib/CalDAV/Schedule/IMipPlugin.php',
51
+    'OCA\\DAV\\CalDAV\\Schedule\\Plugin' => $baseDir.'/../lib/CalDAV/Schedule/Plugin.php',
52
+    'OCA\\DAV\\CalDAV\\Search\\SearchPlugin' => $baseDir.'/../lib/CalDAV/Search/SearchPlugin.php',
53
+    'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\CompFilter' => $baseDir.'/../lib/CalDAV/Search/Xml/Filter/CompFilter.php',
54
+    'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\LimitFilter' => $baseDir.'/../lib/CalDAV/Search/Xml/Filter/LimitFilter.php',
55
+    'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\OffsetFilter' => $baseDir.'/../lib/CalDAV/Search/Xml/Filter/OffsetFilter.php',
56
+    'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\ParamFilter' => $baseDir.'/../lib/CalDAV/Search/Xml/Filter/ParamFilter.php',
57
+    'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\PropFilter' => $baseDir.'/../lib/CalDAV/Search/Xml/Filter/PropFilter.php',
58
+    'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\SearchTermFilter' => $baseDir.'/../lib/CalDAV/Search/Xml/Filter/SearchTermFilter.php',
59
+    'OCA\\DAV\\CalDAV\\Search\\Xml\\Request\\CalendarSearchReport' => $baseDir.'/../lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php',
60
+    'OCA\\DAV\\Capabilities' => $baseDir.'/../lib/Capabilities.php',
61
+    'OCA\\DAV\\CardDAV\\AddressBook' => $baseDir.'/../lib/CardDAV/AddressBook.php',
62
+    'OCA\\DAV\\CardDAV\\AddressBookImpl' => $baseDir.'/../lib/CardDAV/AddressBookImpl.php',
63
+    'OCA\\DAV\\CardDAV\\AddressBookRoot' => $baseDir.'/../lib/CardDAV/AddressBookRoot.php',
64
+    'OCA\\DAV\\CardDAV\\CardDavBackend' => $baseDir.'/../lib/CardDAV/CardDavBackend.php',
65
+    'OCA\\DAV\\CardDAV\\ContactsManager' => $baseDir.'/../lib/CardDAV/ContactsManager.php',
66
+    'OCA\\DAV\\CardDAV\\Converter' => $baseDir.'/../lib/CardDAV/Converter.php',
67
+    'OCA\\DAV\\CardDAV\\ImageExportPlugin' => $baseDir.'/../lib/CardDAV/ImageExportPlugin.php',
68
+    'OCA\\DAV\\CardDAV\\PhotoCache' => $baseDir.'/../lib/CardDAV/PhotoCache.php',
69
+    'OCA\\DAV\\CardDAV\\Plugin' => $baseDir.'/../lib/CardDAV/Plugin.php',
70
+    'OCA\\DAV\\CardDAV\\SyncService' => $baseDir.'/../lib/CardDAV/SyncService.php',
71
+    'OCA\\DAV\\CardDAV\\UserAddressBooks' => $baseDir.'/../lib/CardDAV/UserAddressBooks.php',
72
+    'OCA\\DAV\\CardDAV\\Xml\\Groups' => $baseDir.'/../lib/CardDAV/Xml/Groups.php',
73
+    'OCA\\DAV\\Command\\CreateAddressBook' => $baseDir.'/../lib/Command/CreateAddressBook.php',
74
+    'OCA\\DAV\\Command\\CreateCalendar' => $baseDir.'/../lib/Command/CreateCalendar.php',
75
+    'OCA\\DAV\\Command\\RemoveInvalidShares' => $baseDir.'/../lib/Command/RemoveInvalidShares.php',
76
+    'OCA\\DAV\\Command\\SyncBirthdayCalendar' => $baseDir.'/../lib/Command/SyncBirthdayCalendar.php',
77
+    'OCA\\DAV\\Command\\SyncSystemAddressBook' => $baseDir.'/../lib/Command/SyncSystemAddressBook.php',
78
+    'OCA\\DAV\\Comments\\CommentNode' => $baseDir.'/../lib/Comments/CommentNode.php',
79
+    'OCA\\DAV\\Comments\\CommentsPlugin' => $baseDir.'/../lib/Comments/CommentsPlugin.php',
80
+    'OCA\\DAV\\Comments\\EntityCollection' => $baseDir.'/../lib/Comments/EntityCollection.php',
81
+    'OCA\\DAV\\Comments\\EntityTypeCollection' => $baseDir.'/../lib/Comments/EntityTypeCollection.php',
82
+    'OCA\\DAV\\Comments\\RootCollection' => $baseDir.'/../lib/Comments/RootCollection.php',
83
+    'OCA\\DAV\\Connector\\LegacyDAVACL' => $baseDir.'/../lib/Connector/LegacyDAVACL.php',
84
+    'OCA\\DAV\\Connector\\PublicAuth' => $baseDir.'/../lib/Connector/PublicAuth.php',
85
+    'OCA\\DAV\\Connector\\Sabre\\AnonymousOptionsPlugin' => $baseDir.'/../lib/Connector/Sabre/AnonymousOptionsPlugin.php',
86
+    'OCA\\DAV\\Connector\\Sabre\\AppEnabledPlugin' => $baseDir.'/../lib/Connector/Sabre/AppEnabledPlugin.php',
87
+    'OCA\\DAV\\Connector\\Sabre\\Auth' => $baseDir.'/../lib/Connector/Sabre/Auth.php',
88
+    'OCA\\DAV\\Connector\\Sabre\\BearerAuth' => $baseDir.'/../lib/Connector/Sabre/BearerAuth.php',
89
+    'OCA\\DAV\\Connector\\Sabre\\BlockLegacyClientPlugin' => $baseDir.'/../lib/Connector/Sabre/BlockLegacyClientPlugin.php',
90
+    'OCA\\DAV\\Connector\\Sabre\\CachingTree' => $baseDir.'/../lib/Connector/Sabre/CachingTree.php',
91
+    'OCA\\DAV\\Connector\\Sabre\\ChecksumList' => $baseDir.'/../lib/Connector/Sabre/ChecksumList.php',
92
+    'OCA\\DAV\\Connector\\Sabre\\CommentPropertiesPlugin' => $baseDir.'/../lib/Connector/Sabre/CommentPropertiesPlugin.php',
93
+    'OCA\\DAV\\Connector\\Sabre\\CopyEtagHeaderPlugin' => $baseDir.'/../lib/Connector/Sabre/CopyEtagHeaderPlugin.php',
94
+    'OCA\\DAV\\Connector\\Sabre\\CustomPropertiesBackend' => $baseDir.'/../lib/Connector/Sabre/CustomPropertiesBackend.php',
95
+    'OCA\\DAV\\Connector\\Sabre\\DavAclPlugin' => $baseDir.'/../lib/Connector/Sabre/DavAclPlugin.php',
96
+    'OCA\\DAV\\Connector\\Sabre\\Directory' => $baseDir.'/../lib/Connector/Sabre/Directory.php',
97
+    'OCA\\DAV\\Connector\\Sabre\\DummyGetResponsePlugin' => $baseDir.'/../lib/Connector/Sabre/DummyGetResponsePlugin.php',
98
+    'OCA\\DAV\\Connector\\Sabre\\ExceptionLoggerPlugin' => $baseDir.'/../lib/Connector/Sabre/ExceptionLoggerPlugin.php',
99
+    'OCA\\DAV\\Connector\\Sabre\\Exception\\EntityTooLarge' => $baseDir.'/../lib/Connector/Sabre/Exception/EntityTooLarge.php',
100
+    'OCA\\DAV\\Connector\\Sabre\\Exception\\FileLocked' => $baseDir.'/../lib/Connector/Sabre/Exception/FileLocked.php',
101
+    'OCA\\DAV\\Connector\\Sabre\\Exception\\Forbidden' => $baseDir.'/../lib/Connector/Sabre/Exception/Forbidden.php',
102
+    'OCA\\DAV\\Connector\\Sabre\\Exception\\InvalidPath' => $baseDir.'/../lib/Connector/Sabre/Exception/InvalidPath.php',
103
+    'OCA\\DAV\\Connector\\Sabre\\Exception\\PasswordLoginForbidden' => $baseDir.'/../lib/Connector/Sabre/Exception/PasswordLoginForbidden.php',
104
+    'OCA\\DAV\\Connector\\Sabre\\Exception\\UnsupportedMediaType' => $baseDir.'/../lib/Connector/Sabre/Exception/UnsupportedMediaType.php',
105
+    'OCA\\DAV\\Connector\\Sabre\\FakeLockerPlugin' => $baseDir.'/../lib/Connector/Sabre/FakeLockerPlugin.php',
106
+    'OCA\\DAV\\Connector\\Sabre\\File' => $baseDir.'/../lib/Connector/Sabre/File.php',
107
+    'OCA\\DAV\\Connector\\Sabre\\FilesPlugin' => $baseDir.'/../lib/Connector/Sabre/FilesPlugin.php',
108
+    'OCA\\DAV\\Connector\\Sabre\\FilesReportPlugin' => $baseDir.'/../lib/Connector/Sabre/FilesReportPlugin.php',
109
+    'OCA\\DAV\\Connector\\Sabre\\LockPlugin' => $baseDir.'/../lib/Connector/Sabre/LockPlugin.php',
110
+    'OCA\\DAV\\Connector\\Sabre\\MaintenancePlugin' => $baseDir.'/../lib/Connector/Sabre/MaintenancePlugin.php',
111
+    'OCA\\DAV\\Connector\\Sabre\\Node' => $baseDir.'/../lib/Connector/Sabre/Node.php',
112
+    'OCA\\DAV\\Connector\\Sabre\\ObjectTree' => $baseDir.'/../lib/Connector/Sabre/ObjectTree.php',
113
+    'OCA\\DAV\\Connector\\Sabre\\Principal' => $baseDir.'/../lib/Connector/Sabre/Principal.php',
114
+    'OCA\\DAV\\Connector\\Sabre\\QuotaPlugin' => $baseDir.'/../lib/Connector/Sabre/QuotaPlugin.php',
115
+    'OCA\\DAV\\Connector\\Sabre\\Server' => $baseDir.'/../lib/Connector/Sabre/Server.php',
116
+    'OCA\\DAV\\Connector\\Sabre\\ServerFactory' => $baseDir.'/../lib/Connector/Sabre/ServerFactory.php',
117
+    'OCA\\DAV\\Connector\\Sabre\\ShareTypeList' => $baseDir.'/../lib/Connector/Sabre/ShareTypeList.php',
118
+    'OCA\\DAV\\Connector\\Sabre\\SharesPlugin' => $baseDir.'/../lib/Connector/Sabre/SharesPlugin.php',
119
+    'OCA\\DAV\\Connector\\Sabre\\TagList' => $baseDir.'/../lib/Connector/Sabre/TagList.php',
120
+    'OCA\\DAV\\Connector\\Sabre\\TagsPlugin' => $baseDir.'/../lib/Connector/Sabre/TagsPlugin.php',
121
+    'OCA\\DAV\\Controller\\BirthdayCalendarController' => $baseDir.'/../lib/Controller/BirthdayCalendarController.php',
122
+    'OCA\\DAV\\Controller\\DirectController' => $baseDir.'/../lib/Controller/DirectController.php',
123
+    'OCA\\DAV\\Controller\\InvitationResponseController' => $baseDir.'/../lib/Controller/InvitationResponseController.php',
124
+    'OCA\\DAV\\DAV\\CustomPropertiesBackend' => $baseDir.'/../lib/DAV/CustomPropertiesBackend.php',
125
+    'OCA\\DAV\\DAV\\GroupPrincipalBackend' => $baseDir.'/../lib/DAV/GroupPrincipalBackend.php',
126
+    'OCA\\DAV\\DAV\\PublicAuth' => $baseDir.'/../lib/DAV/PublicAuth.php',
127
+    'OCA\\DAV\\DAV\\Sharing\\Backend' => $baseDir.'/../lib/DAV/Sharing/Backend.php',
128
+    'OCA\\DAV\\DAV\\Sharing\\IShareable' => $baseDir.'/../lib/DAV/Sharing/IShareable.php',
129
+    'OCA\\DAV\\DAV\\Sharing\\Plugin' => $baseDir.'/../lib/DAV/Sharing/Plugin.php',
130
+    'OCA\\DAV\\DAV\\Sharing\\Xml\\Invite' => $baseDir.'/../lib/DAV/Sharing/Xml/Invite.php',
131
+    'OCA\\DAV\\DAV\\Sharing\\Xml\\ShareRequest' => $baseDir.'/../lib/DAV/Sharing/Xml/ShareRequest.php',
132
+    'OCA\\DAV\\DAV\\SystemPrincipalBackend' => $baseDir.'/../lib/DAV/SystemPrincipalBackend.php',
133
+    'OCA\\DAV\\Db\\Direct' => $baseDir.'/../lib/Db/Direct.php',
134
+    'OCA\\DAV\\Db\\DirectMapper' => $baseDir.'/../lib/Db/DirectMapper.php',
135
+    'OCA\\DAV\\Direct\\DirectFile' => $baseDir.'/../lib/Direct/DirectFile.php',
136
+    'OCA\\DAV\\Direct\\DirectHome' => $baseDir.'/../lib/Direct/DirectHome.php',
137
+    'OCA\\DAV\\Direct\\Server' => $baseDir.'/../lib/Direct/Server.php',
138
+    'OCA\\DAV\\Direct\\ServerFactory' => $baseDir.'/../lib/Direct/ServerFactory.php',
139
+    'OCA\\DAV\\Files\\BrowserErrorPagePlugin' => $baseDir.'/../lib/Files/BrowserErrorPagePlugin.php',
140
+    'OCA\\DAV\\Files\\FileSearchBackend' => $baseDir.'/../lib/Files/FileSearchBackend.php',
141
+    'OCA\\DAV\\Files\\FilesHome' => $baseDir.'/../lib/Files/FilesHome.php',
142
+    'OCA\\DAV\\Files\\LazySearchBackend' => $baseDir.'/../lib/Files/LazySearchBackend.php',
143
+    'OCA\\DAV\\Files\\RootCollection' => $baseDir.'/../lib/Files/RootCollection.php',
144
+    'OCA\\DAV\\Files\\Sharing\\FilesDropPlugin' => $baseDir.'/../lib/Files/Sharing/FilesDropPlugin.php',
145
+    'OCA\\DAV\\Files\\Sharing\\PublicLinkCheckPlugin' => $baseDir.'/../lib/Files/Sharing/PublicLinkCheckPlugin.php',
146
+    'OCA\\DAV\\HookManager' => $baseDir.'/../lib/HookManager.php',
147
+    'OCA\\DAV\\Migration\\BuildCalendarSearchIndex' => $baseDir.'/../lib/Migration/BuildCalendarSearchIndex.php',
148
+    'OCA\\DAV\\Migration\\BuildCalendarSearchIndexBackgroundJob' => $baseDir.'/../lib/Migration/BuildCalendarSearchIndexBackgroundJob.php',
149
+    'OCA\\DAV\\Migration\\CalDAVRemoveEmptyValue' => $baseDir.'/../lib/Migration/CalDAVRemoveEmptyValue.php',
150
+    'OCA\\DAV\\Migration\\FixBirthdayCalendarComponent' => $baseDir.'/../lib/Migration/FixBirthdayCalendarComponent.php',
151
+    'OCA\\DAV\\Migration\\Version1004Date20170825134824' => $baseDir.'/../lib/Migration/Version1004Date20170825134824.php',
152
+    'OCA\\DAV\\Migration\\Version1004Date20170919104507' => $baseDir.'/../lib/Migration/Version1004Date20170919104507.php',
153
+    'OCA\\DAV\\Migration\\Version1004Date20170924124212' => $baseDir.'/../lib/Migration/Version1004Date20170924124212.php',
154
+    'OCA\\DAV\\Migration\\Version1004Date20170926103422' => $baseDir.'/../lib/Migration/Version1004Date20170926103422.php',
155
+    'OCA\\DAV\\Migration\\Version1005Date20180413093149' => $baseDir.'/../lib/Migration/Version1005Date20180413093149.php',
156
+    'OCA\\DAV\\Migration\\Version1005Date20180530124431' => $baseDir.'/../lib/Migration/Version1005Date20180530124431.php',
157
+    'OCA\\DAV\\Migration\\Version1006Date20180619154313' => $baseDir.'/../lib/Migration/Version1006Date20180619154313.php',
158
+    'OCA\\DAV\\Migration\\Version1007Date20181007225117' => $baseDir.'/../lib/Migration/Version1007Date20181007225117.php',
159
+    'OCA\\DAV\\Migration\\Version1008Date20181030113700' => $baseDir.'/../lib/Migration/Version1008Date20181030113700.php',
160
+    'OCA\\DAV\\RootCollection' => $baseDir.'/../lib/RootCollection.php',
161
+    'OCA\\DAV\\Server' => $baseDir.'/../lib/Server.php',
162
+    'OCA\\DAV\\Settings\\CalDAVSettings' => $baseDir.'/../lib/Settings/CalDAVSettings.php',
163
+    'OCA\\DAV\\SystemTag\\SystemTagMappingNode' => $baseDir.'/../lib/SystemTag/SystemTagMappingNode.php',
164
+    'OCA\\DAV\\SystemTag\\SystemTagNode' => $baseDir.'/../lib/SystemTag/SystemTagNode.php',
165
+    'OCA\\DAV\\SystemTag\\SystemTagPlugin' => $baseDir.'/../lib/SystemTag/SystemTagPlugin.php',
166
+    'OCA\\DAV\\SystemTag\\SystemTagsByIdCollection' => $baseDir.'/../lib/SystemTag/SystemTagsByIdCollection.php',
167
+    'OCA\\DAV\\SystemTag\\SystemTagsObjectMappingCollection' => $baseDir.'/../lib/SystemTag/SystemTagsObjectMappingCollection.php',
168
+    'OCA\\DAV\\SystemTag\\SystemTagsObjectTypeCollection' => $baseDir.'/../lib/SystemTag/SystemTagsObjectTypeCollection.php',
169
+    'OCA\\DAV\\SystemTag\\SystemTagsRelationsCollection' => $baseDir.'/../lib/SystemTag/SystemTagsRelationsCollection.php',
170
+    'OCA\\DAV\\Upload\\AssemblyStream' => $baseDir.'/../lib/Upload/AssemblyStream.php',
171
+    'OCA\\DAV\\Upload\\ChunkingPlugin' => $baseDir.'/../lib/Upload/ChunkingPlugin.php',
172
+    'OCA\\DAV\\Upload\\FutureFile' => $baseDir.'/../lib/Upload/FutureFile.php',
173
+    'OCA\\DAV\\Upload\\RootCollection' => $baseDir.'/../lib/Upload/RootCollection.php',
174
+    'OCA\\DAV\\Upload\\UploadFolder' => $baseDir.'/../lib/Upload/UploadFolder.php',
175
+    'OCA\\DAV\\Upload\\UploadHome' => $baseDir.'/../lib/Upload/UploadHome.php',
176 176
 );
Please login to merge, or discard this patch.
apps/dav/composer/composer/autoload_static.php 1 patch
Spacing   +174 added lines, -174 removed lines patch added patch discarded remove patch
@@ -6,193 +6,193 @@
 block discarded – undo
6 6
 
7 7
 class ComposerStaticInitDAV
8 8
 {
9
-    public static $prefixLengthsPsr4 = array (
9
+    public static $prefixLengthsPsr4 = array(
10 10
         'O' => 
11
-        array (
11
+        array(
12 12
             'OCA\\DAV\\' => 8,
13 13
         ),
14 14
     );
15 15
 
16
-    public static $prefixDirsPsr4 = array (
16
+    public static $prefixDirsPsr4 = array(
17 17
         'OCA\\DAV\\' => 
18
-        array (
19
-            0 => __DIR__ . '/..' . '/../lib',
18
+        array(
19
+            0 => __DIR__.'/..'.'/../lib',
20 20
         ),
21 21
     );
22 22
 
23
-    public static $classMap = array (
24
-        'OCA\\DAV\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php',
25
-        'OCA\\DAV\\AppInfo\\PluginManager' => __DIR__ . '/..' . '/../lib/AppInfo/PluginManager.php',
26
-        'OCA\\DAV\\Avatars\\AvatarHome' => __DIR__ . '/..' . '/../lib/Avatars/AvatarHome.php',
27
-        'OCA\\DAV\\Avatars\\AvatarNode' => __DIR__ . '/..' . '/../lib/Avatars/AvatarNode.php',
28
-        'OCA\\DAV\\Avatars\\RootCollection' => __DIR__ . '/..' . '/../lib/Avatars/RootCollection.php',
29
-        'OCA\\DAV\\BackgroundJob\\CleanupDirectLinksJob' => __DIR__ . '/..' . '/../lib/BackgroundJob/CleanupDirectLinksJob.php',
30
-        'OCA\\DAV\\BackgroundJob\\CleanupInvitationTokenJob' => __DIR__ . '/..' . '/../lib/BackgroundJob/CleanupInvitationTokenJob.php',
31
-        'OCA\\DAV\\BackgroundJob\\GenerateBirthdayCalendarBackgroundJob' => __DIR__ . '/..' . '/../lib/BackgroundJob/GenerateBirthdayCalendarBackgroundJob.php',
32
-        'OCA\\DAV\\BackgroundJob\\UpdateCalendarResourcesRoomsBackgroundJob' => __DIR__ . '/..' . '/../lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php',
33
-        'OCA\\DAV\\CalDAV\\Activity\\Backend' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Backend.php',
34
-        'OCA\\DAV\\CalDAV\\Activity\\Filter\\Calendar' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Filter/Calendar.php',
35
-        'OCA\\DAV\\CalDAV\\Activity\\Filter\\Todo' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Filter/Todo.php',
36
-        'OCA\\DAV\\CalDAV\\Activity\\Provider\\Base' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Provider/Base.php',
37
-        'OCA\\DAV\\CalDAV\\Activity\\Provider\\Calendar' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Provider/Calendar.php',
38
-        'OCA\\DAV\\CalDAV\\Activity\\Provider\\Event' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Provider/Event.php',
39
-        'OCA\\DAV\\CalDAV\\Activity\\Provider\\Todo' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Provider/Todo.php',
40
-        'OCA\\DAV\\CalDAV\\Activity\\Setting\\Calendar' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Setting/Calendar.php',
41
-        'OCA\\DAV\\CalDAV\\Activity\\Setting\\Event' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Setting/Event.php',
42
-        'OCA\\DAV\\CalDAV\\Activity\\Setting\\Todo' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Setting/Todo.php',
43
-        'OCA\\DAV\\CalDAV\\BirthdayCalendar\\EnablePlugin' => __DIR__ . '/..' . '/../lib/CalDAV/BirthdayCalendar/EnablePlugin.php',
44
-        'OCA\\DAV\\CalDAV\\BirthdayService' => __DIR__ . '/..' . '/../lib/CalDAV/BirthdayService.php',
45
-        'OCA\\DAV\\CalDAV\\CalDavBackend' => __DIR__ . '/..' . '/../lib/CalDAV/CalDavBackend.php',
46
-        'OCA\\DAV\\CalDAV\\Calendar' => __DIR__ . '/..' . '/../lib/CalDAV/Calendar.php',
47
-        'OCA\\DAV\\CalDAV\\CalendarHome' => __DIR__ . '/..' . '/../lib/CalDAV/CalendarHome.php',
48
-        'OCA\\DAV\\CalDAV\\CalendarImpl' => __DIR__ . '/..' . '/../lib/CalDAV/CalendarImpl.php',
49
-        'OCA\\DAV\\CalDAV\\CalendarManager' => __DIR__ . '/..' . '/../lib/CalDAV/CalendarManager.php',
50
-        'OCA\\DAV\\CalDAV\\CalendarObject' => __DIR__ . '/..' . '/../lib/CalDAV/CalendarObject.php',
51
-        'OCA\\DAV\\CalDAV\\CalendarRoot' => __DIR__ . '/..' . '/../lib/CalDAV/CalendarRoot.php',
52
-        'OCA\\DAV\\CalDAV\\InvitationResponse\\InvitationResponseServer' => __DIR__ . '/..' . '/../lib/CalDAV/InvitationResponse/InvitationResponseServer.php',
53
-        'OCA\\DAV\\CalDAV\\Outbox' => __DIR__ . '/..' . '/../lib/CalDAV/Outbox.php',
54
-        'OCA\\DAV\\CalDAV\\Plugin' => __DIR__ . '/..' . '/../lib/CalDAV/Plugin.php',
55
-        'OCA\\DAV\\CalDAV\\Principal\\Collection' => __DIR__ . '/..' . '/../lib/CalDAV/Principal/Collection.php',
56
-        'OCA\\DAV\\CalDAV\\Principal\\User' => __DIR__ . '/..' . '/../lib/CalDAV/Principal/User.php',
57
-        'OCA\\DAV\\CalDAV\\PublicCalendar' => __DIR__ . '/..' . '/../lib/CalDAV/PublicCalendar.php',
58
-        'OCA\\DAV\\CalDAV\\PublicCalendarObject' => __DIR__ . '/..' . '/../lib/CalDAV/PublicCalendarObject.php',
59
-        'OCA\\DAV\\CalDAV\\PublicCalendarRoot' => __DIR__ . '/..' . '/../lib/CalDAV/PublicCalendarRoot.php',
60
-        'OCA\\DAV\\CalDAV\\Publishing\\PublishPlugin' => __DIR__ . '/..' . '/../lib/CalDAV/Publishing/PublishPlugin.php',
61
-        'OCA\\DAV\\CalDAV\\Publishing\\Xml\\Publisher' => __DIR__ . '/..' . '/../lib/CalDAV/Publishing/Xml/Publisher.php',
62
-        'OCA\\DAV\\CalDAV\\ResourceBooking\\AbstractPrincipalBackend' => __DIR__ . '/..' . '/../lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php',
63
-        'OCA\\DAV\\CalDAV\\ResourceBooking\\ResourcePrincipalBackend' => __DIR__ . '/..' . '/../lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php',
64
-        'OCA\\DAV\\CalDAV\\ResourceBooking\\RoomPrincipalBackend' => __DIR__ . '/..' . '/../lib/CalDAV/ResourceBooking/RoomPrincipalBackend.php',
65
-        'OCA\\DAV\\CalDAV\\Schedule\\IMipPlugin' => __DIR__ . '/..' . '/../lib/CalDAV/Schedule/IMipPlugin.php',
66
-        'OCA\\DAV\\CalDAV\\Schedule\\Plugin' => __DIR__ . '/..' . '/../lib/CalDAV/Schedule/Plugin.php',
67
-        'OCA\\DAV\\CalDAV\\Search\\SearchPlugin' => __DIR__ . '/..' . '/../lib/CalDAV/Search/SearchPlugin.php',
68
-        'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\CompFilter' => __DIR__ . '/..' . '/../lib/CalDAV/Search/Xml/Filter/CompFilter.php',
69
-        'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\LimitFilter' => __DIR__ . '/..' . '/../lib/CalDAV/Search/Xml/Filter/LimitFilter.php',
70
-        'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\OffsetFilter' => __DIR__ . '/..' . '/../lib/CalDAV/Search/Xml/Filter/OffsetFilter.php',
71
-        'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\ParamFilter' => __DIR__ . '/..' . '/../lib/CalDAV/Search/Xml/Filter/ParamFilter.php',
72
-        'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\PropFilter' => __DIR__ . '/..' . '/../lib/CalDAV/Search/Xml/Filter/PropFilter.php',
73
-        'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\SearchTermFilter' => __DIR__ . '/..' . '/../lib/CalDAV/Search/Xml/Filter/SearchTermFilter.php',
74
-        'OCA\\DAV\\CalDAV\\Search\\Xml\\Request\\CalendarSearchReport' => __DIR__ . '/..' . '/../lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php',
75
-        'OCA\\DAV\\Capabilities' => __DIR__ . '/..' . '/../lib/Capabilities.php',
76
-        'OCA\\DAV\\CardDAV\\AddressBook' => __DIR__ . '/..' . '/../lib/CardDAV/AddressBook.php',
77
-        'OCA\\DAV\\CardDAV\\AddressBookImpl' => __DIR__ . '/..' . '/../lib/CardDAV/AddressBookImpl.php',
78
-        'OCA\\DAV\\CardDAV\\AddressBookRoot' => __DIR__ . '/..' . '/../lib/CardDAV/AddressBookRoot.php',
79
-        'OCA\\DAV\\CardDAV\\CardDavBackend' => __DIR__ . '/..' . '/../lib/CardDAV/CardDavBackend.php',
80
-        'OCA\\DAV\\CardDAV\\ContactsManager' => __DIR__ . '/..' . '/../lib/CardDAV/ContactsManager.php',
81
-        'OCA\\DAV\\CardDAV\\Converter' => __DIR__ . '/..' . '/../lib/CardDAV/Converter.php',
82
-        'OCA\\DAV\\CardDAV\\ImageExportPlugin' => __DIR__ . '/..' . '/../lib/CardDAV/ImageExportPlugin.php',
83
-        'OCA\\DAV\\CardDAV\\PhotoCache' => __DIR__ . '/..' . '/../lib/CardDAV/PhotoCache.php',
84
-        'OCA\\DAV\\CardDAV\\Plugin' => __DIR__ . '/..' . '/../lib/CardDAV/Plugin.php',
85
-        'OCA\\DAV\\CardDAV\\SyncService' => __DIR__ . '/..' . '/../lib/CardDAV/SyncService.php',
86
-        'OCA\\DAV\\CardDAV\\UserAddressBooks' => __DIR__ . '/..' . '/../lib/CardDAV/UserAddressBooks.php',
87
-        'OCA\\DAV\\CardDAV\\Xml\\Groups' => __DIR__ . '/..' . '/../lib/CardDAV/Xml/Groups.php',
88
-        'OCA\\DAV\\Command\\CreateAddressBook' => __DIR__ . '/..' . '/../lib/Command/CreateAddressBook.php',
89
-        'OCA\\DAV\\Command\\CreateCalendar' => __DIR__ . '/..' . '/../lib/Command/CreateCalendar.php',
90
-        'OCA\\DAV\\Command\\RemoveInvalidShares' => __DIR__ . '/..' . '/../lib/Command/RemoveInvalidShares.php',
91
-        'OCA\\DAV\\Command\\SyncBirthdayCalendar' => __DIR__ . '/..' . '/../lib/Command/SyncBirthdayCalendar.php',
92
-        'OCA\\DAV\\Command\\SyncSystemAddressBook' => __DIR__ . '/..' . '/../lib/Command/SyncSystemAddressBook.php',
93
-        'OCA\\DAV\\Comments\\CommentNode' => __DIR__ . '/..' . '/../lib/Comments/CommentNode.php',
94
-        'OCA\\DAV\\Comments\\CommentsPlugin' => __DIR__ . '/..' . '/../lib/Comments/CommentsPlugin.php',
95
-        'OCA\\DAV\\Comments\\EntityCollection' => __DIR__ . '/..' . '/../lib/Comments/EntityCollection.php',
96
-        'OCA\\DAV\\Comments\\EntityTypeCollection' => __DIR__ . '/..' . '/../lib/Comments/EntityTypeCollection.php',
97
-        'OCA\\DAV\\Comments\\RootCollection' => __DIR__ . '/..' . '/../lib/Comments/RootCollection.php',
98
-        'OCA\\DAV\\Connector\\LegacyDAVACL' => __DIR__ . '/..' . '/../lib/Connector/LegacyDAVACL.php',
99
-        'OCA\\DAV\\Connector\\PublicAuth' => __DIR__ . '/..' . '/../lib/Connector/PublicAuth.php',
100
-        'OCA\\DAV\\Connector\\Sabre\\AnonymousOptionsPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/AnonymousOptionsPlugin.php',
101
-        'OCA\\DAV\\Connector\\Sabre\\AppEnabledPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/AppEnabledPlugin.php',
102
-        'OCA\\DAV\\Connector\\Sabre\\Auth' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Auth.php',
103
-        'OCA\\DAV\\Connector\\Sabre\\BearerAuth' => __DIR__ . '/..' . '/../lib/Connector/Sabre/BearerAuth.php',
104
-        'OCA\\DAV\\Connector\\Sabre\\BlockLegacyClientPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/BlockLegacyClientPlugin.php',
105
-        'OCA\\DAV\\Connector\\Sabre\\CachingTree' => __DIR__ . '/..' . '/../lib/Connector/Sabre/CachingTree.php',
106
-        'OCA\\DAV\\Connector\\Sabre\\ChecksumList' => __DIR__ . '/..' . '/../lib/Connector/Sabre/ChecksumList.php',
107
-        'OCA\\DAV\\Connector\\Sabre\\CommentPropertiesPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/CommentPropertiesPlugin.php',
108
-        'OCA\\DAV\\Connector\\Sabre\\CopyEtagHeaderPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/CopyEtagHeaderPlugin.php',
109
-        'OCA\\DAV\\Connector\\Sabre\\CustomPropertiesBackend' => __DIR__ . '/..' . '/../lib/Connector/Sabre/CustomPropertiesBackend.php',
110
-        'OCA\\DAV\\Connector\\Sabre\\DavAclPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/DavAclPlugin.php',
111
-        'OCA\\DAV\\Connector\\Sabre\\Directory' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Directory.php',
112
-        'OCA\\DAV\\Connector\\Sabre\\DummyGetResponsePlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/DummyGetResponsePlugin.php',
113
-        'OCA\\DAV\\Connector\\Sabre\\ExceptionLoggerPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/ExceptionLoggerPlugin.php',
114
-        'OCA\\DAV\\Connector\\Sabre\\Exception\\EntityTooLarge' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Exception/EntityTooLarge.php',
115
-        'OCA\\DAV\\Connector\\Sabre\\Exception\\FileLocked' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Exception/FileLocked.php',
116
-        'OCA\\DAV\\Connector\\Sabre\\Exception\\Forbidden' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Exception/Forbidden.php',
117
-        'OCA\\DAV\\Connector\\Sabre\\Exception\\InvalidPath' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Exception/InvalidPath.php',
118
-        'OCA\\DAV\\Connector\\Sabre\\Exception\\PasswordLoginForbidden' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Exception/PasswordLoginForbidden.php',
119
-        'OCA\\DAV\\Connector\\Sabre\\Exception\\UnsupportedMediaType' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Exception/UnsupportedMediaType.php',
120
-        'OCA\\DAV\\Connector\\Sabre\\FakeLockerPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/FakeLockerPlugin.php',
121
-        'OCA\\DAV\\Connector\\Sabre\\File' => __DIR__ . '/..' . '/../lib/Connector/Sabre/File.php',
122
-        'OCA\\DAV\\Connector\\Sabre\\FilesPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/FilesPlugin.php',
123
-        'OCA\\DAV\\Connector\\Sabre\\FilesReportPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/FilesReportPlugin.php',
124
-        'OCA\\DAV\\Connector\\Sabre\\LockPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/LockPlugin.php',
125
-        'OCA\\DAV\\Connector\\Sabre\\MaintenancePlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/MaintenancePlugin.php',
126
-        'OCA\\DAV\\Connector\\Sabre\\Node' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Node.php',
127
-        'OCA\\DAV\\Connector\\Sabre\\ObjectTree' => __DIR__ . '/..' . '/../lib/Connector/Sabre/ObjectTree.php',
128
-        'OCA\\DAV\\Connector\\Sabre\\Principal' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Principal.php',
129
-        'OCA\\DAV\\Connector\\Sabre\\QuotaPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/QuotaPlugin.php',
130
-        'OCA\\DAV\\Connector\\Sabre\\Server' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Server.php',
131
-        'OCA\\DAV\\Connector\\Sabre\\ServerFactory' => __DIR__ . '/..' . '/../lib/Connector/Sabre/ServerFactory.php',
132
-        'OCA\\DAV\\Connector\\Sabre\\ShareTypeList' => __DIR__ . '/..' . '/../lib/Connector/Sabre/ShareTypeList.php',
133
-        'OCA\\DAV\\Connector\\Sabre\\SharesPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/SharesPlugin.php',
134
-        'OCA\\DAV\\Connector\\Sabre\\TagList' => __DIR__ . '/..' . '/../lib/Connector/Sabre/TagList.php',
135
-        'OCA\\DAV\\Connector\\Sabre\\TagsPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/TagsPlugin.php',
136
-        'OCA\\DAV\\Controller\\BirthdayCalendarController' => __DIR__ . '/..' . '/../lib/Controller/BirthdayCalendarController.php',
137
-        'OCA\\DAV\\Controller\\DirectController' => __DIR__ . '/..' . '/../lib/Controller/DirectController.php',
138
-        'OCA\\DAV\\Controller\\InvitationResponseController' => __DIR__ . '/..' . '/../lib/Controller/InvitationResponseController.php',
139
-        'OCA\\DAV\\DAV\\CustomPropertiesBackend' => __DIR__ . '/..' . '/../lib/DAV/CustomPropertiesBackend.php',
140
-        'OCA\\DAV\\DAV\\GroupPrincipalBackend' => __DIR__ . '/..' . '/../lib/DAV/GroupPrincipalBackend.php',
141
-        'OCA\\DAV\\DAV\\PublicAuth' => __DIR__ . '/..' . '/../lib/DAV/PublicAuth.php',
142
-        'OCA\\DAV\\DAV\\Sharing\\Backend' => __DIR__ . '/..' . '/../lib/DAV/Sharing/Backend.php',
143
-        'OCA\\DAV\\DAV\\Sharing\\IShareable' => __DIR__ . '/..' . '/../lib/DAV/Sharing/IShareable.php',
144
-        'OCA\\DAV\\DAV\\Sharing\\Plugin' => __DIR__ . '/..' . '/../lib/DAV/Sharing/Plugin.php',
145
-        'OCA\\DAV\\DAV\\Sharing\\Xml\\Invite' => __DIR__ . '/..' . '/../lib/DAV/Sharing/Xml/Invite.php',
146
-        'OCA\\DAV\\DAV\\Sharing\\Xml\\ShareRequest' => __DIR__ . '/..' . '/../lib/DAV/Sharing/Xml/ShareRequest.php',
147
-        'OCA\\DAV\\DAV\\SystemPrincipalBackend' => __DIR__ . '/..' . '/../lib/DAV/SystemPrincipalBackend.php',
148
-        'OCA\\DAV\\Db\\Direct' => __DIR__ . '/..' . '/../lib/Db/Direct.php',
149
-        'OCA\\DAV\\Db\\DirectMapper' => __DIR__ . '/..' . '/../lib/Db/DirectMapper.php',
150
-        'OCA\\DAV\\Direct\\DirectFile' => __DIR__ . '/..' . '/../lib/Direct/DirectFile.php',
151
-        'OCA\\DAV\\Direct\\DirectHome' => __DIR__ . '/..' . '/../lib/Direct/DirectHome.php',
152
-        'OCA\\DAV\\Direct\\Server' => __DIR__ . '/..' . '/../lib/Direct/Server.php',
153
-        'OCA\\DAV\\Direct\\ServerFactory' => __DIR__ . '/..' . '/../lib/Direct/ServerFactory.php',
154
-        'OCA\\DAV\\Files\\BrowserErrorPagePlugin' => __DIR__ . '/..' . '/../lib/Files/BrowserErrorPagePlugin.php',
155
-        'OCA\\DAV\\Files\\FileSearchBackend' => __DIR__ . '/..' . '/../lib/Files/FileSearchBackend.php',
156
-        'OCA\\DAV\\Files\\FilesHome' => __DIR__ . '/..' . '/../lib/Files/FilesHome.php',
157
-        'OCA\\DAV\\Files\\LazySearchBackend' => __DIR__ . '/..' . '/../lib/Files/LazySearchBackend.php',
158
-        'OCA\\DAV\\Files\\RootCollection' => __DIR__ . '/..' . '/../lib/Files/RootCollection.php',
159
-        'OCA\\DAV\\Files\\Sharing\\FilesDropPlugin' => __DIR__ . '/..' . '/../lib/Files/Sharing/FilesDropPlugin.php',
160
-        'OCA\\DAV\\Files\\Sharing\\PublicLinkCheckPlugin' => __DIR__ . '/..' . '/../lib/Files/Sharing/PublicLinkCheckPlugin.php',
161
-        'OCA\\DAV\\HookManager' => __DIR__ . '/..' . '/../lib/HookManager.php',
162
-        'OCA\\DAV\\Migration\\BuildCalendarSearchIndex' => __DIR__ . '/..' . '/../lib/Migration/BuildCalendarSearchIndex.php',
163
-        'OCA\\DAV\\Migration\\BuildCalendarSearchIndexBackgroundJob' => __DIR__ . '/..' . '/../lib/Migration/BuildCalendarSearchIndexBackgroundJob.php',
164
-        'OCA\\DAV\\Migration\\CalDAVRemoveEmptyValue' => __DIR__ . '/..' . '/../lib/Migration/CalDAVRemoveEmptyValue.php',
165
-        'OCA\\DAV\\Migration\\FixBirthdayCalendarComponent' => __DIR__ . '/..' . '/../lib/Migration/FixBirthdayCalendarComponent.php',
166
-        'OCA\\DAV\\Migration\\Version1004Date20170825134824' => __DIR__ . '/..' . '/../lib/Migration/Version1004Date20170825134824.php',
167
-        'OCA\\DAV\\Migration\\Version1004Date20170919104507' => __DIR__ . '/..' . '/../lib/Migration/Version1004Date20170919104507.php',
168
-        'OCA\\DAV\\Migration\\Version1004Date20170924124212' => __DIR__ . '/..' . '/../lib/Migration/Version1004Date20170924124212.php',
169
-        'OCA\\DAV\\Migration\\Version1004Date20170926103422' => __DIR__ . '/..' . '/../lib/Migration/Version1004Date20170926103422.php',
170
-        'OCA\\DAV\\Migration\\Version1005Date20180413093149' => __DIR__ . '/..' . '/../lib/Migration/Version1005Date20180413093149.php',
171
-        'OCA\\DAV\\Migration\\Version1005Date20180530124431' => __DIR__ . '/..' . '/../lib/Migration/Version1005Date20180530124431.php',
172
-        'OCA\\DAV\\Migration\\Version1006Date20180619154313' => __DIR__ . '/..' . '/../lib/Migration/Version1006Date20180619154313.php',
173
-        'OCA\\DAV\\Migration\\Version1007Date20181007225117' => __DIR__ . '/..' . '/../lib/Migration/Version1007Date20181007225117.php',
174
-        'OCA\\DAV\\Migration\\Version1008Date20181030113700' => __DIR__ . '/..' . '/../lib/Migration/Version1008Date20181030113700.php',
175
-        'OCA\\DAV\\RootCollection' => __DIR__ . '/..' . '/../lib/RootCollection.php',
176
-        'OCA\\DAV\\Server' => __DIR__ . '/..' . '/../lib/Server.php',
177
-        'OCA\\DAV\\Settings\\CalDAVSettings' => __DIR__ . '/..' . '/../lib/Settings/CalDAVSettings.php',
178
-        'OCA\\DAV\\SystemTag\\SystemTagMappingNode' => __DIR__ . '/..' . '/../lib/SystemTag/SystemTagMappingNode.php',
179
-        'OCA\\DAV\\SystemTag\\SystemTagNode' => __DIR__ . '/..' . '/../lib/SystemTag/SystemTagNode.php',
180
-        'OCA\\DAV\\SystemTag\\SystemTagPlugin' => __DIR__ . '/..' . '/../lib/SystemTag/SystemTagPlugin.php',
181
-        'OCA\\DAV\\SystemTag\\SystemTagsByIdCollection' => __DIR__ . '/..' . '/../lib/SystemTag/SystemTagsByIdCollection.php',
182
-        'OCA\\DAV\\SystemTag\\SystemTagsObjectMappingCollection' => __DIR__ . '/..' . '/../lib/SystemTag/SystemTagsObjectMappingCollection.php',
183
-        'OCA\\DAV\\SystemTag\\SystemTagsObjectTypeCollection' => __DIR__ . '/..' . '/../lib/SystemTag/SystemTagsObjectTypeCollection.php',
184
-        'OCA\\DAV\\SystemTag\\SystemTagsRelationsCollection' => __DIR__ . '/..' . '/../lib/SystemTag/SystemTagsRelationsCollection.php',
185
-        'OCA\\DAV\\Upload\\AssemblyStream' => __DIR__ . '/..' . '/../lib/Upload/AssemblyStream.php',
186
-        'OCA\\DAV\\Upload\\ChunkingPlugin' => __DIR__ . '/..' . '/../lib/Upload/ChunkingPlugin.php',
187
-        'OCA\\DAV\\Upload\\FutureFile' => __DIR__ . '/..' . '/../lib/Upload/FutureFile.php',
188
-        'OCA\\DAV\\Upload\\RootCollection' => __DIR__ . '/..' . '/../lib/Upload/RootCollection.php',
189
-        'OCA\\DAV\\Upload\\UploadFolder' => __DIR__ . '/..' . '/../lib/Upload/UploadFolder.php',
190
-        'OCA\\DAV\\Upload\\UploadHome' => __DIR__ . '/..' . '/../lib/Upload/UploadHome.php',
23
+    public static $classMap = array(
24
+        'OCA\\DAV\\AppInfo\\Application' => __DIR__.'/..'.'/../lib/AppInfo/Application.php',
25
+        'OCA\\DAV\\AppInfo\\PluginManager' => __DIR__.'/..'.'/../lib/AppInfo/PluginManager.php',
26
+        'OCA\\DAV\\Avatars\\AvatarHome' => __DIR__.'/..'.'/../lib/Avatars/AvatarHome.php',
27
+        'OCA\\DAV\\Avatars\\AvatarNode' => __DIR__.'/..'.'/../lib/Avatars/AvatarNode.php',
28
+        'OCA\\DAV\\Avatars\\RootCollection' => __DIR__.'/..'.'/../lib/Avatars/RootCollection.php',
29
+        'OCA\\DAV\\BackgroundJob\\CleanupDirectLinksJob' => __DIR__.'/..'.'/../lib/BackgroundJob/CleanupDirectLinksJob.php',
30
+        'OCA\\DAV\\BackgroundJob\\CleanupInvitationTokenJob' => __DIR__.'/..'.'/../lib/BackgroundJob/CleanupInvitationTokenJob.php',
31
+        'OCA\\DAV\\BackgroundJob\\GenerateBirthdayCalendarBackgroundJob' => __DIR__.'/..'.'/../lib/BackgroundJob/GenerateBirthdayCalendarBackgroundJob.php',
32
+        'OCA\\DAV\\BackgroundJob\\UpdateCalendarResourcesRoomsBackgroundJob' => __DIR__.'/..'.'/../lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php',
33
+        'OCA\\DAV\\CalDAV\\Activity\\Backend' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Backend.php',
34
+        'OCA\\DAV\\CalDAV\\Activity\\Filter\\Calendar' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Filter/Calendar.php',
35
+        'OCA\\DAV\\CalDAV\\Activity\\Filter\\Todo' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Filter/Todo.php',
36
+        'OCA\\DAV\\CalDAV\\Activity\\Provider\\Base' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Provider/Base.php',
37
+        'OCA\\DAV\\CalDAV\\Activity\\Provider\\Calendar' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Provider/Calendar.php',
38
+        'OCA\\DAV\\CalDAV\\Activity\\Provider\\Event' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Provider/Event.php',
39
+        'OCA\\DAV\\CalDAV\\Activity\\Provider\\Todo' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Provider/Todo.php',
40
+        'OCA\\DAV\\CalDAV\\Activity\\Setting\\Calendar' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Setting/Calendar.php',
41
+        'OCA\\DAV\\CalDAV\\Activity\\Setting\\Event' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Setting/Event.php',
42
+        'OCA\\DAV\\CalDAV\\Activity\\Setting\\Todo' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Setting/Todo.php',
43
+        'OCA\\DAV\\CalDAV\\BirthdayCalendar\\EnablePlugin' => __DIR__.'/..'.'/../lib/CalDAV/BirthdayCalendar/EnablePlugin.php',
44
+        'OCA\\DAV\\CalDAV\\BirthdayService' => __DIR__.'/..'.'/../lib/CalDAV/BirthdayService.php',
45
+        'OCA\\DAV\\CalDAV\\CalDavBackend' => __DIR__.'/..'.'/../lib/CalDAV/CalDavBackend.php',
46
+        'OCA\\DAV\\CalDAV\\Calendar' => __DIR__.'/..'.'/../lib/CalDAV/Calendar.php',
47
+        'OCA\\DAV\\CalDAV\\CalendarHome' => __DIR__.'/..'.'/../lib/CalDAV/CalendarHome.php',
48
+        'OCA\\DAV\\CalDAV\\CalendarImpl' => __DIR__.'/..'.'/../lib/CalDAV/CalendarImpl.php',
49
+        'OCA\\DAV\\CalDAV\\CalendarManager' => __DIR__.'/..'.'/../lib/CalDAV/CalendarManager.php',
50
+        'OCA\\DAV\\CalDAV\\CalendarObject' => __DIR__.'/..'.'/../lib/CalDAV/CalendarObject.php',
51
+        'OCA\\DAV\\CalDAV\\CalendarRoot' => __DIR__.'/..'.'/../lib/CalDAV/CalendarRoot.php',
52
+        'OCA\\DAV\\CalDAV\\InvitationResponse\\InvitationResponseServer' => __DIR__.'/..'.'/../lib/CalDAV/InvitationResponse/InvitationResponseServer.php',
53
+        'OCA\\DAV\\CalDAV\\Outbox' => __DIR__.'/..'.'/../lib/CalDAV/Outbox.php',
54
+        'OCA\\DAV\\CalDAV\\Plugin' => __DIR__.'/..'.'/../lib/CalDAV/Plugin.php',
55
+        'OCA\\DAV\\CalDAV\\Principal\\Collection' => __DIR__.'/..'.'/../lib/CalDAV/Principal/Collection.php',
56
+        'OCA\\DAV\\CalDAV\\Principal\\User' => __DIR__.'/..'.'/../lib/CalDAV/Principal/User.php',
57
+        'OCA\\DAV\\CalDAV\\PublicCalendar' => __DIR__.'/..'.'/../lib/CalDAV/PublicCalendar.php',
58
+        'OCA\\DAV\\CalDAV\\PublicCalendarObject' => __DIR__.'/..'.'/../lib/CalDAV/PublicCalendarObject.php',
59
+        'OCA\\DAV\\CalDAV\\PublicCalendarRoot' => __DIR__.'/..'.'/../lib/CalDAV/PublicCalendarRoot.php',
60
+        'OCA\\DAV\\CalDAV\\Publishing\\PublishPlugin' => __DIR__.'/..'.'/../lib/CalDAV/Publishing/PublishPlugin.php',
61
+        'OCA\\DAV\\CalDAV\\Publishing\\Xml\\Publisher' => __DIR__.'/..'.'/../lib/CalDAV/Publishing/Xml/Publisher.php',
62
+        'OCA\\DAV\\CalDAV\\ResourceBooking\\AbstractPrincipalBackend' => __DIR__.'/..'.'/../lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php',
63
+        'OCA\\DAV\\CalDAV\\ResourceBooking\\ResourcePrincipalBackend' => __DIR__.'/..'.'/../lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php',
64
+        'OCA\\DAV\\CalDAV\\ResourceBooking\\RoomPrincipalBackend' => __DIR__.'/..'.'/../lib/CalDAV/ResourceBooking/RoomPrincipalBackend.php',
65
+        'OCA\\DAV\\CalDAV\\Schedule\\IMipPlugin' => __DIR__.'/..'.'/../lib/CalDAV/Schedule/IMipPlugin.php',
66
+        'OCA\\DAV\\CalDAV\\Schedule\\Plugin' => __DIR__.'/..'.'/../lib/CalDAV/Schedule/Plugin.php',
67
+        'OCA\\DAV\\CalDAV\\Search\\SearchPlugin' => __DIR__.'/..'.'/../lib/CalDAV/Search/SearchPlugin.php',
68
+        'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\CompFilter' => __DIR__.'/..'.'/../lib/CalDAV/Search/Xml/Filter/CompFilter.php',
69
+        'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\LimitFilter' => __DIR__.'/..'.'/../lib/CalDAV/Search/Xml/Filter/LimitFilter.php',
70
+        'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\OffsetFilter' => __DIR__.'/..'.'/../lib/CalDAV/Search/Xml/Filter/OffsetFilter.php',
71
+        'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\ParamFilter' => __DIR__.'/..'.'/../lib/CalDAV/Search/Xml/Filter/ParamFilter.php',
72
+        'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\PropFilter' => __DIR__.'/..'.'/../lib/CalDAV/Search/Xml/Filter/PropFilter.php',
73
+        'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\SearchTermFilter' => __DIR__.'/..'.'/../lib/CalDAV/Search/Xml/Filter/SearchTermFilter.php',
74
+        'OCA\\DAV\\CalDAV\\Search\\Xml\\Request\\CalendarSearchReport' => __DIR__.'/..'.'/../lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php',
75
+        'OCA\\DAV\\Capabilities' => __DIR__.'/..'.'/../lib/Capabilities.php',
76
+        'OCA\\DAV\\CardDAV\\AddressBook' => __DIR__.'/..'.'/../lib/CardDAV/AddressBook.php',
77
+        'OCA\\DAV\\CardDAV\\AddressBookImpl' => __DIR__.'/..'.'/../lib/CardDAV/AddressBookImpl.php',
78
+        'OCA\\DAV\\CardDAV\\AddressBookRoot' => __DIR__.'/..'.'/../lib/CardDAV/AddressBookRoot.php',
79
+        'OCA\\DAV\\CardDAV\\CardDavBackend' => __DIR__.'/..'.'/../lib/CardDAV/CardDavBackend.php',
80
+        'OCA\\DAV\\CardDAV\\ContactsManager' => __DIR__.'/..'.'/../lib/CardDAV/ContactsManager.php',
81
+        'OCA\\DAV\\CardDAV\\Converter' => __DIR__.'/..'.'/../lib/CardDAV/Converter.php',
82
+        'OCA\\DAV\\CardDAV\\ImageExportPlugin' => __DIR__.'/..'.'/../lib/CardDAV/ImageExportPlugin.php',
83
+        'OCA\\DAV\\CardDAV\\PhotoCache' => __DIR__.'/..'.'/../lib/CardDAV/PhotoCache.php',
84
+        'OCA\\DAV\\CardDAV\\Plugin' => __DIR__.'/..'.'/../lib/CardDAV/Plugin.php',
85
+        'OCA\\DAV\\CardDAV\\SyncService' => __DIR__.'/..'.'/../lib/CardDAV/SyncService.php',
86
+        'OCA\\DAV\\CardDAV\\UserAddressBooks' => __DIR__.'/..'.'/../lib/CardDAV/UserAddressBooks.php',
87
+        'OCA\\DAV\\CardDAV\\Xml\\Groups' => __DIR__.'/..'.'/../lib/CardDAV/Xml/Groups.php',
88
+        'OCA\\DAV\\Command\\CreateAddressBook' => __DIR__.'/..'.'/../lib/Command/CreateAddressBook.php',
89
+        'OCA\\DAV\\Command\\CreateCalendar' => __DIR__.'/..'.'/../lib/Command/CreateCalendar.php',
90
+        'OCA\\DAV\\Command\\RemoveInvalidShares' => __DIR__.'/..'.'/../lib/Command/RemoveInvalidShares.php',
91
+        'OCA\\DAV\\Command\\SyncBirthdayCalendar' => __DIR__.'/..'.'/../lib/Command/SyncBirthdayCalendar.php',
92
+        'OCA\\DAV\\Command\\SyncSystemAddressBook' => __DIR__.'/..'.'/../lib/Command/SyncSystemAddressBook.php',
93
+        'OCA\\DAV\\Comments\\CommentNode' => __DIR__.'/..'.'/../lib/Comments/CommentNode.php',
94
+        'OCA\\DAV\\Comments\\CommentsPlugin' => __DIR__.'/..'.'/../lib/Comments/CommentsPlugin.php',
95
+        'OCA\\DAV\\Comments\\EntityCollection' => __DIR__.'/..'.'/../lib/Comments/EntityCollection.php',
96
+        'OCA\\DAV\\Comments\\EntityTypeCollection' => __DIR__.'/..'.'/../lib/Comments/EntityTypeCollection.php',
97
+        'OCA\\DAV\\Comments\\RootCollection' => __DIR__.'/..'.'/../lib/Comments/RootCollection.php',
98
+        'OCA\\DAV\\Connector\\LegacyDAVACL' => __DIR__.'/..'.'/../lib/Connector/LegacyDAVACL.php',
99
+        'OCA\\DAV\\Connector\\PublicAuth' => __DIR__.'/..'.'/../lib/Connector/PublicAuth.php',
100
+        'OCA\\DAV\\Connector\\Sabre\\AnonymousOptionsPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/AnonymousOptionsPlugin.php',
101
+        'OCA\\DAV\\Connector\\Sabre\\AppEnabledPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/AppEnabledPlugin.php',
102
+        'OCA\\DAV\\Connector\\Sabre\\Auth' => __DIR__.'/..'.'/../lib/Connector/Sabre/Auth.php',
103
+        'OCA\\DAV\\Connector\\Sabre\\BearerAuth' => __DIR__.'/..'.'/../lib/Connector/Sabre/BearerAuth.php',
104
+        'OCA\\DAV\\Connector\\Sabre\\BlockLegacyClientPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/BlockLegacyClientPlugin.php',
105
+        'OCA\\DAV\\Connector\\Sabre\\CachingTree' => __DIR__.'/..'.'/../lib/Connector/Sabre/CachingTree.php',
106
+        'OCA\\DAV\\Connector\\Sabre\\ChecksumList' => __DIR__.'/..'.'/../lib/Connector/Sabre/ChecksumList.php',
107
+        'OCA\\DAV\\Connector\\Sabre\\CommentPropertiesPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/CommentPropertiesPlugin.php',
108
+        'OCA\\DAV\\Connector\\Sabre\\CopyEtagHeaderPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/CopyEtagHeaderPlugin.php',
109
+        'OCA\\DAV\\Connector\\Sabre\\CustomPropertiesBackend' => __DIR__.'/..'.'/../lib/Connector/Sabre/CustomPropertiesBackend.php',
110
+        'OCA\\DAV\\Connector\\Sabre\\DavAclPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/DavAclPlugin.php',
111
+        'OCA\\DAV\\Connector\\Sabre\\Directory' => __DIR__.'/..'.'/../lib/Connector/Sabre/Directory.php',
112
+        'OCA\\DAV\\Connector\\Sabre\\DummyGetResponsePlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/DummyGetResponsePlugin.php',
113
+        'OCA\\DAV\\Connector\\Sabre\\ExceptionLoggerPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/ExceptionLoggerPlugin.php',
114
+        'OCA\\DAV\\Connector\\Sabre\\Exception\\EntityTooLarge' => __DIR__.'/..'.'/../lib/Connector/Sabre/Exception/EntityTooLarge.php',
115
+        'OCA\\DAV\\Connector\\Sabre\\Exception\\FileLocked' => __DIR__.'/..'.'/../lib/Connector/Sabre/Exception/FileLocked.php',
116
+        'OCA\\DAV\\Connector\\Sabre\\Exception\\Forbidden' => __DIR__.'/..'.'/../lib/Connector/Sabre/Exception/Forbidden.php',
117
+        'OCA\\DAV\\Connector\\Sabre\\Exception\\InvalidPath' => __DIR__.'/..'.'/../lib/Connector/Sabre/Exception/InvalidPath.php',
118
+        'OCA\\DAV\\Connector\\Sabre\\Exception\\PasswordLoginForbidden' => __DIR__.'/..'.'/../lib/Connector/Sabre/Exception/PasswordLoginForbidden.php',
119
+        'OCA\\DAV\\Connector\\Sabre\\Exception\\UnsupportedMediaType' => __DIR__.'/..'.'/../lib/Connector/Sabre/Exception/UnsupportedMediaType.php',
120
+        'OCA\\DAV\\Connector\\Sabre\\FakeLockerPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/FakeLockerPlugin.php',
121
+        'OCA\\DAV\\Connector\\Sabre\\File' => __DIR__.'/..'.'/../lib/Connector/Sabre/File.php',
122
+        'OCA\\DAV\\Connector\\Sabre\\FilesPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/FilesPlugin.php',
123
+        'OCA\\DAV\\Connector\\Sabre\\FilesReportPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/FilesReportPlugin.php',
124
+        'OCA\\DAV\\Connector\\Sabre\\LockPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/LockPlugin.php',
125
+        'OCA\\DAV\\Connector\\Sabre\\MaintenancePlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/MaintenancePlugin.php',
126
+        'OCA\\DAV\\Connector\\Sabre\\Node' => __DIR__.'/..'.'/../lib/Connector/Sabre/Node.php',
127
+        'OCA\\DAV\\Connector\\Sabre\\ObjectTree' => __DIR__.'/..'.'/../lib/Connector/Sabre/ObjectTree.php',
128
+        'OCA\\DAV\\Connector\\Sabre\\Principal' => __DIR__.'/..'.'/../lib/Connector/Sabre/Principal.php',
129
+        'OCA\\DAV\\Connector\\Sabre\\QuotaPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/QuotaPlugin.php',
130
+        'OCA\\DAV\\Connector\\Sabre\\Server' => __DIR__.'/..'.'/../lib/Connector/Sabre/Server.php',
131
+        'OCA\\DAV\\Connector\\Sabre\\ServerFactory' => __DIR__.'/..'.'/../lib/Connector/Sabre/ServerFactory.php',
132
+        'OCA\\DAV\\Connector\\Sabre\\ShareTypeList' => __DIR__.'/..'.'/../lib/Connector/Sabre/ShareTypeList.php',
133
+        'OCA\\DAV\\Connector\\Sabre\\SharesPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/SharesPlugin.php',
134
+        'OCA\\DAV\\Connector\\Sabre\\TagList' => __DIR__.'/..'.'/../lib/Connector/Sabre/TagList.php',
135
+        'OCA\\DAV\\Connector\\Sabre\\TagsPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/TagsPlugin.php',
136
+        'OCA\\DAV\\Controller\\BirthdayCalendarController' => __DIR__.'/..'.'/../lib/Controller/BirthdayCalendarController.php',
137
+        'OCA\\DAV\\Controller\\DirectController' => __DIR__.'/..'.'/../lib/Controller/DirectController.php',
138
+        'OCA\\DAV\\Controller\\InvitationResponseController' => __DIR__.'/..'.'/../lib/Controller/InvitationResponseController.php',
139
+        'OCA\\DAV\\DAV\\CustomPropertiesBackend' => __DIR__.'/..'.'/../lib/DAV/CustomPropertiesBackend.php',
140
+        'OCA\\DAV\\DAV\\GroupPrincipalBackend' => __DIR__.'/..'.'/../lib/DAV/GroupPrincipalBackend.php',
141
+        'OCA\\DAV\\DAV\\PublicAuth' => __DIR__.'/..'.'/../lib/DAV/PublicAuth.php',
142
+        'OCA\\DAV\\DAV\\Sharing\\Backend' => __DIR__.'/..'.'/../lib/DAV/Sharing/Backend.php',
143
+        'OCA\\DAV\\DAV\\Sharing\\IShareable' => __DIR__.'/..'.'/../lib/DAV/Sharing/IShareable.php',
144
+        'OCA\\DAV\\DAV\\Sharing\\Plugin' => __DIR__.'/..'.'/../lib/DAV/Sharing/Plugin.php',
145
+        'OCA\\DAV\\DAV\\Sharing\\Xml\\Invite' => __DIR__.'/..'.'/../lib/DAV/Sharing/Xml/Invite.php',
146
+        'OCA\\DAV\\DAV\\Sharing\\Xml\\ShareRequest' => __DIR__.'/..'.'/../lib/DAV/Sharing/Xml/ShareRequest.php',
147
+        'OCA\\DAV\\DAV\\SystemPrincipalBackend' => __DIR__.'/..'.'/../lib/DAV/SystemPrincipalBackend.php',
148
+        'OCA\\DAV\\Db\\Direct' => __DIR__.'/..'.'/../lib/Db/Direct.php',
149
+        'OCA\\DAV\\Db\\DirectMapper' => __DIR__.'/..'.'/../lib/Db/DirectMapper.php',
150
+        'OCA\\DAV\\Direct\\DirectFile' => __DIR__.'/..'.'/../lib/Direct/DirectFile.php',
151
+        'OCA\\DAV\\Direct\\DirectHome' => __DIR__.'/..'.'/../lib/Direct/DirectHome.php',
152
+        'OCA\\DAV\\Direct\\Server' => __DIR__.'/..'.'/../lib/Direct/Server.php',
153
+        'OCA\\DAV\\Direct\\ServerFactory' => __DIR__.'/..'.'/../lib/Direct/ServerFactory.php',
154
+        'OCA\\DAV\\Files\\BrowserErrorPagePlugin' => __DIR__.'/..'.'/../lib/Files/BrowserErrorPagePlugin.php',
155
+        'OCA\\DAV\\Files\\FileSearchBackend' => __DIR__.'/..'.'/../lib/Files/FileSearchBackend.php',
156
+        'OCA\\DAV\\Files\\FilesHome' => __DIR__.'/..'.'/../lib/Files/FilesHome.php',
157
+        'OCA\\DAV\\Files\\LazySearchBackend' => __DIR__.'/..'.'/../lib/Files/LazySearchBackend.php',
158
+        'OCA\\DAV\\Files\\RootCollection' => __DIR__.'/..'.'/../lib/Files/RootCollection.php',
159
+        'OCA\\DAV\\Files\\Sharing\\FilesDropPlugin' => __DIR__.'/..'.'/../lib/Files/Sharing/FilesDropPlugin.php',
160
+        'OCA\\DAV\\Files\\Sharing\\PublicLinkCheckPlugin' => __DIR__.'/..'.'/../lib/Files/Sharing/PublicLinkCheckPlugin.php',
161
+        'OCA\\DAV\\HookManager' => __DIR__.'/..'.'/../lib/HookManager.php',
162
+        'OCA\\DAV\\Migration\\BuildCalendarSearchIndex' => __DIR__.'/..'.'/../lib/Migration/BuildCalendarSearchIndex.php',
163
+        'OCA\\DAV\\Migration\\BuildCalendarSearchIndexBackgroundJob' => __DIR__.'/..'.'/../lib/Migration/BuildCalendarSearchIndexBackgroundJob.php',
164
+        'OCA\\DAV\\Migration\\CalDAVRemoveEmptyValue' => __DIR__.'/..'.'/../lib/Migration/CalDAVRemoveEmptyValue.php',
165
+        'OCA\\DAV\\Migration\\FixBirthdayCalendarComponent' => __DIR__.'/..'.'/../lib/Migration/FixBirthdayCalendarComponent.php',
166
+        'OCA\\DAV\\Migration\\Version1004Date20170825134824' => __DIR__.'/..'.'/../lib/Migration/Version1004Date20170825134824.php',
167
+        'OCA\\DAV\\Migration\\Version1004Date20170919104507' => __DIR__.'/..'.'/../lib/Migration/Version1004Date20170919104507.php',
168
+        'OCA\\DAV\\Migration\\Version1004Date20170924124212' => __DIR__.'/..'.'/../lib/Migration/Version1004Date20170924124212.php',
169
+        'OCA\\DAV\\Migration\\Version1004Date20170926103422' => __DIR__.'/..'.'/../lib/Migration/Version1004Date20170926103422.php',
170
+        'OCA\\DAV\\Migration\\Version1005Date20180413093149' => __DIR__.'/..'.'/../lib/Migration/Version1005Date20180413093149.php',
171
+        'OCA\\DAV\\Migration\\Version1005Date20180530124431' => __DIR__.'/..'.'/../lib/Migration/Version1005Date20180530124431.php',
172
+        'OCA\\DAV\\Migration\\Version1006Date20180619154313' => __DIR__.'/..'.'/../lib/Migration/Version1006Date20180619154313.php',
173
+        'OCA\\DAV\\Migration\\Version1007Date20181007225117' => __DIR__.'/..'.'/../lib/Migration/Version1007Date20181007225117.php',
174
+        'OCA\\DAV\\Migration\\Version1008Date20181030113700' => __DIR__.'/..'.'/../lib/Migration/Version1008Date20181030113700.php',
175
+        'OCA\\DAV\\RootCollection' => __DIR__.'/..'.'/../lib/RootCollection.php',
176
+        'OCA\\DAV\\Server' => __DIR__.'/..'.'/../lib/Server.php',
177
+        'OCA\\DAV\\Settings\\CalDAVSettings' => __DIR__.'/..'.'/../lib/Settings/CalDAVSettings.php',
178
+        'OCA\\DAV\\SystemTag\\SystemTagMappingNode' => __DIR__.'/..'.'/../lib/SystemTag/SystemTagMappingNode.php',
179
+        'OCA\\DAV\\SystemTag\\SystemTagNode' => __DIR__.'/..'.'/../lib/SystemTag/SystemTagNode.php',
180
+        'OCA\\DAV\\SystemTag\\SystemTagPlugin' => __DIR__.'/..'.'/../lib/SystemTag/SystemTagPlugin.php',
181
+        'OCA\\DAV\\SystemTag\\SystemTagsByIdCollection' => __DIR__.'/..'.'/../lib/SystemTag/SystemTagsByIdCollection.php',
182
+        'OCA\\DAV\\SystemTag\\SystemTagsObjectMappingCollection' => __DIR__.'/..'.'/../lib/SystemTag/SystemTagsObjectMappingCollection.php',
183
+        'OCA\\DAV\\SystemTag\\SystemTagsObjectTypeCollection' => __DIR__.'/..'.'/../lib/SystemTag/SystemTagsObjectTypeCollection.php',
184
+        'OCA\\DAV\\SystemTag\\SystemTagsRelationsCollection' => __DIR__.'/..'.'/../lib/SystemTag/SystemTagsRelationsCollection.php',
185
+        'OCA\\DAV\\Upload\\AssemblyStream' => __DIR__.'/..'.'/../lib/Upload/AssemblyStream.php',
186
+        'OCA\\DAV\\Upload\\ChunkingPlugin' => __DIR__.'/..'.'/../lib/Upload/ChunkingPlugin.php',
187
+        'OCA\\DAV\\Upload\\FutureFile' => __DIR__.'/..'.'/../lib/Upload/FutureFile.php',
188
+        'OCA\\DAV\\Upload\\RootCollection' => __DIR__.'/..'.'/../lib/Upload/RootCollection.php',
189
+        'OCA\\DAV\\Upload\\UploadFolder' => __DIR__.'/..'.'/../lib/Upload/UploadFolder.php',
190
+        'OCA\\DAV\\Upload\\UploadHome' => __DIR__.'/..'.'/../lib/Upload/UploadHome.php',
191 191
     );
192 192
 
193 193
     public static function getInitializer(ClassLoader $loader)
194 194
     {
195
-        return \Closure::bind(function () use ($loader) {
195
+        return \Closure::bind(function() use ($loader) {
196 196
             $loader->prefixLengthsPsr4 = ComposerStaticInitDAV::$prefixLengthsPsr4;
197 197
             $loader->prefixDirsPsr4 = ComposerStaticInitDAV::$prefixDirsPsr4;
198 198
             $loader->classMap = ComposerStaticInitDAV::$classMap;
Please login to merge, or discard this patch.
apps/dav/lib/CardDAV/CardDavBackend.php 1 patch
Indentation   +1097 added lines, -1097 removed lines patch added patch discarded remove patch
@@ -53,1101 +53,1101 @@
 block discarded – undo
53 53
 
54 54
 class CardDavBackend implements BackendInterface, SyncSupport {
55 55
 
56
-	const PERSONAL_ADDRESSBOOK_URI = 'contacts';
57
-	const PERSONAL_ADDRESSBOOK_NAME = 'Contacts';
58
-
59
-	/** @var Principal */
60
-	private $principalBackend;
61
-
62
-	/** @var string */
63
-	private $dbCardsTable = 'cards';
64
-
65
-	/** @var string */
66
-	private $dbCardsPropertiesTable = 'cards_properties';
67
-
68
-	/** @var IDBConnection */
69
-	private $db;
70
-
71
-	/** @var Backend */
72
-	private $sharingBackend;
73
-
74
-	/** @var array properties to index */
75
-	public static $indexProperties = array(
76
-			'BDAY', 'UID', 'N', 'FN', 'TITLE', 'ROLE', 'NOTE', 'NICKNAME',
77
-			'ORG', 'CATEGORIES', 'EMAIL', 'TEL', 'IMPP', 'ADR', 'URL', 'GEO', 'CLOUD');
78
-
79
-	/**
80
-	 * @var string[] Map of uid => display name
81
-	 */
82
-	protected $userDisplayNames;
83
-
84
-	/** @var IUserManager */
85
-	private $userManager;
86
-
87
-	/** @var EventDispatcherInterface */
88
-	private $dispatcher;
89
-
90
-	/**
91
-	 * CardDavBackend constructor.
92
-	 *
93
-	 * @param IDBConnection $db
94
-	 * @param Principal $principalBackend
95
-	 * @param IUserManager $userManager
96
-	 * @param IGroupManager $groupManager
97
-	 * @param EventDispatcherInterface $dispatcher
98
-	 */
99
-	public function __construct(IDBConnection $db,
100
-								Principal $principalBackend,
101
-								IUserManager $userManager,
102
-								IGroupManager $groupManager,
103
-								EventDispatcherInterface $dispatcher) {
104
-		$this->db = $db;
105
-		$this->principalBackend = $principalBackend;
106
-		$this->userManager = $userManager;
107
-		$this->dispatcher = $dispatcher;
108
-		$this->sharingBackend = new Backend($this->db, $this->userManager, $groupManager, $principalBackend, 'addressbook');
109
-	}
110
-
111
-	/**
112
-	 * Return the number of address books for a principal
113
-	 *
114
-	 * @param $principalUri
115
-	 * @return int
116
-	 */
117
-	public function getAddressBooksForUserCount($principalUri) {
118
-		$principalUri = $this->convertPrincipal($principalUri, true);
119
-		$query = $this->db->getQueryBuilder();
120
-		$query->select($query->createFunction('COUNT(*)'))
121
-			->from('addressbooks')
122
-			->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri)));
123
-
124
-		return (int)$query->execute()->fetchColumn();
125
-	}
126
-
127
-	/**
128
-	 * Returns the list of address books for a specific user.
129
-	 *
130
-	 * Every addressbook should have the following properties:
131
-	 *   id - an arbitrary unique id
132
-	 *   uri - the 'basename' part of the url
133
-	 *   principaluri - Same as the passed parameter
134
-	 *
135
-	 * Any additional clark-notation property may be passed besides this. Some
136
-	 * common ones are :
137
-	 *   {DAV:}displayname
138
-	 *   {urn:ietf:params:xml:ns:carddav}addressbook-description
139
-	 *   {http://calendarserver.org/ns/}getctag
140
-	 *
141
-	 * @param string $principalUri
142
-	 * @return array
143
-	 */
144
-	function getAddressBooksForUser($principalUri) {
145
-		$principalUriOriginal = $principalUri;
146
-		$principalUri = $this->convertPrincipal($principalUri, true);
147
-		$query = $this->db->getQueryBuilder();
148
-		$query->select(['id', 'uri', 'displayname', 'principaluri', 'description', 'synctoken'])
149
-			->from('addressbooks')
150
-			->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri)));
151
-
152
-		$addressBooks = [];
153
-
154
-		$result = $query->execute();
155
-		while($row = $result->fetch()) {
156
-			$addressBooks[$row['id']] = [
157
-				'id'  => $row['id'],
158
-				'uri' => $row['uri'],
159
-				'principaluri' => $this->convertPrincipal($row['principaluri'], false),
160
-				'{DAV:}displayname' => $row['displayname'],
161
-				'{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
162
-				'{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
163
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
164
-			];
165
-
166
-			$this->addOwnerPrincipal($addressBooks[$row['id']]);
167
-		}
168
-		$result->closeCursor();
169
-
170
-		// query for shared calendars
171
-		$principals = $this->principalBackend->getGroupMembership($principalUriOriginal, true);
172
-		$principals = array_map(function($principal) {
173
-			return urldecode($principal);
174
-		}, $principals);
175
-		$principals[]= $principalUri;
176
-
177
-		$query = $this->db->getQueryBuilder();
178
-		$result = $query->select(['a.id', 'a.uri', 'a.displayname', 'a.principaluri', 'a.description', 'a.synctoken', 's.access'])
179
-			->from('dav_shares', 's')
180
-			->join('s', 'addressbooks', 'a', $query->expr()->eq('s.resourceid', 'a.id'))
181
-			->where($query->expr()->in('s.principaluri', $query->createParameter('principaluri')))
182
-			->andWhere($query->expr()->eq('s.type', $query->createParameter('type')))
183
-			->setParameter('type', 'addressbook')
184
-			->setParameter('principaluri', $principals, IQueryBuilder::PARAM_STR_ARRAY)
185
-			->execute();
186
-
187
-		$readOnlyPropertyName = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only';
188
-		while($row = $result->fetch()) {
189
-			if ($row['principaluri'] === $principalUri) {
190
-				continue;
191
-			}
192
-
193
-			$readOnly = (int) $row['access'] === Backend::ACCESS_READ;
194
-			if (isset($addressBooks[$row['id']])) {
195
-				if ($readOnly) {
196
-					// New share can not have more permissions then the old one.
197
-					continue;
198
-				}
199
-				if (isset($addressBooks[$row['id']][$readOnlyPropertyName]) &&
200
-					$addressBooks[$row['id']][$readOnlyPropertyName] === 0) {
201
-					// Old share is already read-write, no more permissions can be gained
202
-					continue;
203
-				}
204
-			}
205
-
206
-			list(, $name) = \Sabre\Uri\split($row['principaluri']);
207
-			$uri = $row['uri'] . '_shared_by_' . $name;
208
-			$displayName = $row['displayname'] . ' (' . $this->getUserDisplayName($name) . ')';
209
-
210
-			$addressBooks[$row['id']] = [
211
-				'id'  => $row['id'],
212
-				'uri' => $uri,
213
-				'principaluri' => $principalUriOriginal,
214
-				'{DAV:}displayname' => $displayName,
215
-				'{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
216
-				'{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
217
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
218
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $row['principaluri'],
219
-				$readOnlyPropertyName => $readOnly,
220
-			];
221
-
222
-			$this->addOwnerPrincipal($addressBooks[$row['id']]);
223
-		}
224
-		$result->closeCursor();
225
-
226
-		return array_values($addressBooks);
227
-	}
228
-
229
-	public function getUsersOwnAddressBooks($principalUri) {
230
-		$principalUri = $this->convertPrincipal($principalUri, true);
231
-		$query = $this->db->getQueryBuilder();
232
-		$query->select(['id', 'uri', 'displayname', 'principaluri', 'description', 'synctoken'])
233
-			  ->from('addressbooks')
234
-			  ->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri)));
235
-
236
-		$addressBooks = [];
237
-
238
-		$result = $query->execute();
239
-		while($row = $result->fetch()) {
240
-			$addressBooks[$row['id']] = [
241
-				'id'  => $row['id'],
242
-				'uri' => $row['uri'],
243
-				'principaluri' => $this->convertPrincipal($row['principaluri'], false),
244
-				'{DAV:}displayname' => $row['displayname'],
245
-				'{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
246
-				'{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
247
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
248
-			];
249
-
250
-			$this->addOwnerPrincipal($addressBooks[$row['id']]);
251
-		}
252
-		$result->closeCursor();
253
-
254
-		return array_values($addressBooks);
255
-	}
256
-
257
-	private function getUserDisplayName($uid) {
258
-		if (!isset($this->userDisplayNames[$uid])) {
259
-			$user = $this->userManager->get($uid);
260
-
261
-			if ($user instanceof IUser) {
262
-				$this->userDisplayNames[$uid] = $user->getDisplayName();
263
-			} else {
264
-				$this->userDisplayNames[$uid] = $uid;
265
-			}
266
-		}
267
-
268
-		return $this->userDisplayNames[$uid];
269
-	}
270
-
271
-	/**
272
-	 * @param int $addressBookId
273
-	 */
274
-	public function getAddressBookById($addressBookId) {
275
-		$query = $this->db->getQueryBuilder();
276
-		$result = $query->select(['id', 'uri', 'displayname', 'principaluri', 'description', 'synctoken'])
277
-			->from('addressbooks')
278
-			->where($query->expr()->eq('id', $query->createNamedParameter($addressBookId)))
279
-			->execute();
280
-
281
-		$row = $result->fetch();
282
-		$result->closeCursor();
283
-		if ($row === false) {
284
-			return null;
285
-		}
286
-
287
-		$addressBook = [
288
-			'id'  => $row['id'],
289
-			'uri' => $row['uri'],
290
-			'principaluri' => $row['principaluri'],
291
-			'{DAV:}displayname' => $row['displayname'],
292
-			'{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
293
-			'{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
294
-			'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
295
-		];
296
-
297
-		$this->addOwnerPrincipal($addressBook);
298
-
299
-		return $addressBook;
300
-	}
301
-
302
-	/**
303
-	 * @param $addressBookUri
304
-	 * @return array|null
305
-	 */
306
-	public function getAddressBooksByUri($principal, $addressBookUri) {
307
-		$query = $this->db->getQueryBuilder();
308
-		$result = $query->select(['id', 'uri', 'displayname', 'principaluri', 'description', 'synctoken'])
309
-			->from('addressbooks')
310
-			->where($query->expr()->eq('uri', $query->createNamedParameter($addressBookUri)))
311
-			->andWhere($query->expr()->eq('principaluri', $query->createNamedParameter($principal)))
312
-			->setMaxResults(1)
313
-			->execute();
314
-
315
-		$row = $result->fetch();
316
-		$result->closeCursor();
317
-		if ($row === false) {
318
-			return null;
319
-		}
320
-
321
-		$addressBook = [
322
-			'id'  => $row['id'],
323
-			'uri' => $row['uri'],
324
-			'principaluri' => $row['principaluri'],
325
-			'{DAV:}displayname' => $row['displayname'],
326
-			'{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
327
-			'{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
328
-			'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
329
-		];
330
-
331
-		$this->addOwnerPrincipal($addressBook);
332
-
333
-		return $addressBook;
334
-	}
335
-
336
-	/**
337
-	 * Updates properties for an address book.
338
-	 *
339
-	 * The list of mutations is stored in a Sabre\DAV\PropPatch object.
340
-	 * To do the actual updates, you must tell this object which properties
341
-	 * you're going to process with the handle() method.
342
-	 *
343
-	 * Calling the handle method is like telling the PropPatch object "I
344
-	 * promise I can handle updating this property".
345
-	 *
346
-	 * Read the PropPatch documentation for more info and examples.
347
-	 *
348
-	 * @param string $addressBookId
349
-	 * @param \Sabre\DAV\PropPatch $propPatch
350
-	 * @return void
351
-	 */
352
-	function updateAddressBook($addressBookId, \Sabre\DAV\PropPatch $propPatch) {
353
-		$supportedProperties = [
354
-			'{DAV:}displayname',
355
-			'{' . Plugin::NS_CARDDAV . '}addressbook-description',
356
-		];
357
-
358
-		/**
359
-		 * @suppress SqlInjectionChecker
360
-		 */
361
-		$propPatch->handle($supportedProperties, function($mutations) use ($addressBookId) {
362
-
363
-			$updates = [];
364
-			foreach($mutations as $property=>$newValue) {
365
-
366
-				switch($property) {
367
-					case '{DAV:}displayname' :
368
-						$updates['displayname'] = $newValue;
369
-						break;
370
-					case '{' . Plugin::NS_CARDDAV . '}addressbook-description' :
371
-						$updates['description'] = $newValue;
372
-						break;
373
-				}
374
-			}
375
-			$query = $this->db->getQueryBuilder();
376
-			$query->update('addressbooks');
377
-
378
-			foreach($updates as $key=>$value) {
379
-				$query->set($key, $query->createNamedParameter($value));
380
-			}
381
-			$query->where($query->expr()->eq('id', $query->createNamedParameter($addressBookId)))
382
-			->execute();
383
-
384
-			$this->addChange($addressBookId, "", 2);
385
-
386
-			return true;
387
-
388
-		});
389
-	}
390
-
391
-	/**
392
-	 * Creates a new address book
393
-	 *
394
-	 * @param string $principalUri
395
-	 * @param string $url Just the 'basename' of the url.
396
-	 * @param array $properties
397
-	 * @return int
398
-	 * @throws BadRequest
399
-	 */
400
-	function createAddressBook($principalUri, $url, array $properties) {
401
-		$values = [
402
-			'displayname' => null,
403
-			'description' => null,
404
-			'principaluri' => $principalUri,
405
-			'uri' => $url,
406
-			'synctoken' => 1
407
-		];
408
-
409
-		foreach($properties as $property=>$newValue) {
410
-
411
-			switch($property) {
412
-				case '{DAV:}displayname' :
413
-					$values['displayname'] = $newValue;
414
-					break;
415
-				case '{' . Plugin::NS_CARDDAV . '}addressbook-description' :
416
-					$values['description'] = $newValue;
417
-					break;
418
-				default :
419
-					throw new BadRequest('Unknown property: ' . $property);
420
-			}
421
-
422
-		}
423
-
424
-		// Fallback to make sure the displayname is set. Some clients may refuse
425
-		// to work with addressbooks not having a displayname.
426
-		if(is_null($values['displayname'])) {
427
-			$values['displayname'] = $url;
428
-		}
429
-
430
-		$query = $this->db->getQueryBuilder();
431
-		$query->insert('addressbooks')
432
-			->values([
433
-				'uri' => $query->createParameter('uri'),
434
-				'displayname' => $query->createParameter('displayname'),
435
-				'description' => $query->createParameter('description'),
436
-				'principaluri' => $query->createParameter('principaluri'),
437
-				'synctoken' => $query->createParameter('synctoken'),
438
-			])
439
-			->setParameters($values)
440
-			->execute();
441
-
442
-		return $query->getLastInsertId();
443
-	}
444
-
445
-	/**
446
-	 * Deletes an entire addressbook and all its contents
447
-	 *
448
-	 * @param mixed $addressBookId
449
-	 * @return void
450
-	 */
451
-	function deleteAddressBook($addressBookId) {
452
-		$query = $this->db->getQueryBuilder();
453
-		$query->delete('cards')
454
-			->where($query->expr()->eq('addressbookid', $query->createParameter('addressbookid')))
455
-			->setParameter('addressbookid', $addressBookId)
456
-			->execute();
457
-
458
-		$query->delete('addressbookchanges')
459
-			->where($query->expr()->eq('addressbookid', $query->createParameter('addressbookid')))
460
-			->setParameter('addressbookid', $addressBookId)
461
-			->execute();
462
-
463
-		$query->delete('addressbooks')
464
-			->where($query->expr()->eq('id', $query->createParameter('id')))
465
-			->setParameter('id', $addressBookId)
466
-			->execute();
467
-
468
-		$this->sharingBackend->deleteAllShares($addressBookId);
469
-
470
-		$query->delete($this->dbCardsPropertiesTable)
471
-			->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
472
-			->execute();
473
-
474
-	}
475
-
476
-	/**
477
-	 * Returns all cards for a specific addressbook id.
478
-	 *
479
-	 * This method should return the following properties for each card:
480
-	 *   * carddata - raw vcard data
481
-	 *   * uri - Some unique url
482
-	 *   * lastmodified - A unix timestamp
483
-	 *
484
-	 * It's recommended to also return the following properties:
485
-	 *   * etag - A unique etag. This must change every time the card changes.
486
-	 *   * size - The size of the card in bytes.
487
-	 *
488
-	 * If these last two properties are provided, less time will be spent
489
-	 * calculating them. If they are specified, you can also ommit carddata.
490
-	 * This may speed up certain requests, especially with large cards.
491
-	 *
492
-	 * @param mixed $addressBookId
493
-	 * @return array
494
-	 */
495
-	function getCards($addressBookId) {
496
-		$query = $this->db->getQueryBuilder();
497
-		$query->select(['id', 'uri', 'lastmodified', 'etag', 'size', 'carddata', 'uid'])
498
-			->from('cards')
499
-			->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)));
500
-
501
-		$cards = [];
502
-
503
-		$result = $query->execute();
504
-		while($row = $result->fetch()) {
505
-			$row['etag'] = '"' . $row['etag'] . '"';
506
-			$row['carddata'] = $this->readBlob($row['carddata']);
507
-			$cards[] = $row;
508
-		}
509
-		$result->closeCursor();
510
-
511
-		return $cards;
512
-	}
513
-
514
-	/**
515
-	 * Returns a specific card.
516
-	 *
517
-	 * The same set of properties must be returned as with getCards. The only
518
-	 * exception is that 'carddata' is absolutely required.
519
-	 *
520
-	 * If the card does not exist, you must return false.
521
-	 *
522
-	 * @param mixed $addressBookId
523
-	 * @param string $cardUri
524
-	 * @return array
525
-	 */
526
-	function getCard($addressBookId, $cardUri) {
527
-		$query = $this->db->getQueryBuilder();
528
-		$query->select(['id', 'uri', 'lastmodified', 'etag', 'size', 'carddata', 'uid'])
529
-			->from('cards')
530
-			->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
531
-			->andWhere($query->expr()->eq('uri', $query->createNamedParameter($cardUri)))
532
-			->setMaxResults(1);
533
-
534
-		$result = $query->execute();
535
-		$row = $result->fetch();
536
-		if (!$row) {
537
-			return false;
538
-		}
539
-		$row['etag'] = '"' . $row['etag'] . '"';
540
-		$row['carddata'] = $this->readBlob($row['carddata']);
541
-
542
-		return $row;
543
-	}
544
-
545
-	/**
546
-	 * Returns a list of cards.
547
-	 *
548
-	 * This method should work identical to getCard, but instead return all the
549
-	 * cards in the list as an array.
550
-	 *
551
-	 * If the backend supports this, it may allow for some speed-ups.
552
-	 *
553
-	 * @param mixed $addressBookId
554
-	 * @param string[] $uris
555
-	 * @return array
556
-	 */
557
-	function getMultipleCards($addressBookId, array $uris) {
558
-		if (empty($uris)) {
559
-			return [];
560
-		}
561
-
562
-		$chunks = array_chunk($uris, 100);
563
-		$cards = [];
564
-
565
-		$query = $this->db->getQueryBuilder();
566
-		$query->select(['id', 'uri', 'lastmodified', 'etag', 'size', 'carddata', 'uid'])
567
-			->from('cards')
568
-			->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
569
-			->andWhere($query->expr()->in('uri', $query->createParameter('uri')));
570
-
571
-		foreach ($chunks as $uris) {
572
-			$query->setParameter('uri', $uris, IQueryBuilder::PARAM_STR_ARRAY);
573
-			$result = $query->execute();
574
-
575
-			while ($row = $result->fetch()) {
576
-				$row['etag'] = '"' . $row['etag'] . '"';
577
-				$row['carddata'] = $this->readBlob($row['carddata']);
578
-				$cards[] = $row;
579
-			}
580
-			$result->closeCursor();
581
-		}
582
-		return $cards;
583
-	}
584
-
585
-	/**
586
-	 * Creates a new card.
587
-	 *
588
-	 * The addressbook id will be passed as the first argument. This is the
589
-	 * same id as it is returned from the getAddressBooksForUser method.
590
-	 *
591
-	 * The cardUri is a base uri, and doesn't include the full path. The
592
-	 * cardData argument is the vcard body, and is passed as a string.
593
-	 *
594
-	 * It is possible to return an ETag from this method. This ETag is for the
595
-	 * newly created resource, and must be enclosed with double quotes (that
596
-	 * is, the string itself must contain the double quotes).
597
-	 *
598
-	 * You should only return the ETag if you store the carddata as-is. If a
599
-	 * subsequent GET request on the same card does not have the same body,
600
-	 * byte-by-byte and you did return an ETag here, clients tend to get
601
-	 * confused.
602
-	 *
603
-	 * If you don't return an ETag, you can just return null.
604
-	 *
605
-	 * @param mixed $addressBookId
606
-	 * @param string $cardUri
607
-	 * @param string $cardData
608
-	 * @return string
609
-	 */
610
-	function createCard($addressBookId, $cardUri, $cardData) {
611
-		$etag = md5($cardData);
612
-		$uid = $this->getUID($cardData);
613
-
614
-		$query = $this->db->getQueryBuilder();
615
-		$query->insert('cards')
616
-			->values([
617
-				'carddata' => $query->createNamedParameter($cardData, IQueryBuilder::PARAM_LOB),
618
-				'uri' => $query->createNamedParameter($cardUri),
619
-				'lastmodified' => $query->createNamedParameter(time()),
620
-				'addressbookid' => $query->createNamedParameter($addressBookId),
621
-				'size' => $query->createNamedParameter(strlen($cardData)),
622
-				'etag' => $query->createNamedParameter($etag),
623
-				'uid' => $query->createNamedParameter($uid),
624
-			])
625
-			->execute();
626
-
627
-		$this->addChange($addressBookId, $cardUri, 1);
628
-		$this->updateProperties($addressBookId, $cardUri, $cardData);
629
-
630
-		$this->dispatcher->dispatch('\OCA\DAV\CardDAV\CardDavBackend::createCard',
631
-			new GenericEvent(null, [
632
-				'addressBookId' => $addressBookId,
633
-				'cardUri' => $cardUri,
634
-				'cardData' => $cardData]));
635
-
636
-		return '"' . $etag . '"';
637
-	}
638
-
639
-	/**
640
-	 * Updates a card.
641
-	 *
642
-	 * The addressbook id will be passed as the first argument. This is the
643
-	 * same id as it is returned from the getAddressBooksForUser method.
644
-	 *
645
-	 * The cardUri is a base uri, and doesn't include the full path. The
646
-	 * cardData argument is the vcard body, and is passed as a string.
647
-	 *
648
-	 * It is possible to return an ETag from this method. This ETag should
649
-	 * match that of the updated resource, and must be enclosed with double
650
-	 * quotes (that is: the string itself must contain the actual quotes).
651
-	 *
652
-	 * You should only return the ETag if you store the carddata as-is. If a
653
-	 * subsequent GET request on the same card does not have the same body,
654
-	 * byte-by-byte and you did return an ETag here, clients tend to get
655
-	 * confused.
656
-	 *
657
-	 * If you don't return an ETag, you can just return null.
658
-	 *
659
-	 * @param mixed $addressBookId
660
-	 * @param string $cardUri
661
-	 * @param string $cardData
662
-	 * @return string
663
-	 */
664
-	function updateCard($addressBookId, $cardUri, $cardData) {
665
-
666
-		$uid = $this->getUID($cardData);
667
-		$etag = md5($cardData);
668
-		$query = $this->db->getQueryBuilder();
669
-		$query->update('cards')
670
-			->set('carddata', $query->createNamedParameter($cardData, IQueryBuilder::PARAM_LOB))
671
-			->set('lastmodified', $query->createNamedParameter(time()))
672
-			->set('size', $query->createNamedParameter(strlen($cardData)))
673
-			->set('etag', $query->createNamedParameter($etag))
674
-			->set('uid', $query->createNamedParameter($uid))
675
-			->where($query->expr()->eq('uri', $query->createNamedParameter($cardUri)))
676
-			->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
677
-			->execute();
678
-
679
-		$this->addChange($addressBookId, $cardUri, 2);
680
-		$this->updateProperties($addressBookId, $cardUri, $cardData);
681
-
682
-		$this->dispatcher->dispatch('\OCA\DAV\CardDAV\CardDavBackend::updateCard',
683
-			new GenericEvent(null, [
684
-				'addressBookId' => $addressBookId,
685
-				'cardUri' => $cardUri,
686
-				'cardData' => $cardData]));
687
-
688
-		return '"' . $etag . '"';
689
-	}
690
-
691
-	/**
692
-	 * Deletes a card
693
-	 *
694
-	 * @param mixed $addressBookId
695
-	 * @param string $cardUri
696
-	 * @return bool
697
-	 */
698
-	function deleteCard($addressBookId, $cardUri) {
699
-		try {
700
-			$cardId = $this->getCardId($addressBookId, $cardUri);
701
-		} catch (\InvalidArgumentException $e) {
702
-			$cardId = null;
703
-		}
704
-		$query = $this->db->getQueryBuilder();
705
-		$ret = $query->delete('cards')
706
-			->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
707
-			->andWhere($query->expr()->eq('uri', $query->createNamedParameter($cardUri)))
708
-			->execute();
709
-
710
-		$this->addChange($addressBookId, $cardUri, 3);
711
-
712
-		$this->dispatcher->dispatch('\OCA\DAV\CardDAV\CardDavBackend::deleteCard',
713
-			new GenericEvent(null, [
714
-				'addressBookId' => $addressBookId,
715
-				'cardUri' => $cardUri]));
716
-
717
-		if ($ret === 1) {
718
-			if ($cardId !== null) {
719
-				$this->purgeProperties($addressBookId, $cardId);
720
-			}
721
-			return true;
722
-		}
723
-
724
-		return false;
725
-	}
726
-
727
-	/**
728
-	 * The getChanges method returns all the changes that have happened, since
729
-	 * the specified syncToken in the specified address book.
730
-	 *
731
-	 * This function should return an array, such as the following:
732
-	 *
733
-	 * [
734
-	 *   'syncToken' => 'The current synctoken',
735
-	 *   'added'   => [
736
-	 *      'new.txt',
737
-	 *   ],
738
-	 *   'modified'   => [
739
-	 *      'modified.txt',
740
-	 *   ],
741
-	 *   'deleted' => [
742
-	 *      'foo.php.bak',
743
-	 *      'old.txt'
744
-	 *   ]
745
-	 * ];
746
-	 *
747
-	 * The returned syncToken property should reflect the *current* syncToken
748
-	 * of the calendar, as reported in the {http://sabredav.org/ns}sync-token
749
-	 * property. This is needed here too, to ensure the operation is atomic.
750
-	 *
751
-	 * If the $syncToken argument is specified as null, this is an initial
752
-	 * sync, and all members should be reported.
753
-	 *
754
-	 * The modified property is an array of nodenames that have changed since
755
-	 * the last token.
756
-	 *
757
-	 * The deleted property is an array with nodenames, that have been deleted
758
-	 * from collection.
759
-	 *
760
-	 * The $syncLevel argument is basically the 'depth' of the report. If it's
761
-	 * 1, you only have to report changes that happened only directly in
762
-	 * immediate descendants. If it's 2, it should also include changes from
763
-	 * the nodes below the child collections. (grandchildren)
764
-	 *
765
-	 * The $limit argument allows a client to specify how many results should
766
-	 * be returned at most. If the limit is not specified, it should be treated
767
-	 * as infinite.
768
-	 *
769
-	 * If the limit (infinite or not) is higher than you're willing to return,
770
-	 * you should throw a Sabre\DAV\Exception\TooMuchMatches() exception.
771
-	 *
772
-	 * If the syncToken is expired (due to data cleanup) or unknown, you must
773
-	 * return null.
774
-	 *
775
-	 * The limit is 'suggestive'. You are free to ignore it.
776
-	 *
777
-	 * @param string $addressBookId
778
-	 * @param string $syncToken
779
-	 * @param int $syncLevel
780
-	 * @param int $limit
781
-	 * @return array
782
-	 */
783
-	function getChangesForAddressBook($addressBookId, $syncToken, $syncLevel, $limit = null) {
784
-		// Current synctoken
785
-		$stmt = $this->db->prepare('SELECT `synctoken` FROM `*PREFIX*addressbooks` WHERE `id` = ?');
786
-		$stmt->execute([ $addressBookId ]);
787
-		$currentToken = $stmt->fetchColumn(0);
788
-
789
-		if (is_null($currentToken)) return null;
790
-
791
-		$result = [
792
-			'syncToken' => $currentToken,
793
-			'added'     => [],
794
-			'modified'  => [],
795
-			'deleted'   => [],
796
-		];
797
-
798
-		if ($syncToken) {
799
-
800
-			$query = "SELECT `uri`, `operation` FROM `*PREFIX*addressbookchanges` WHERE `synctoken` >= ? AND `synctoken` < ? AND `addressbookid` = ? ORDER BY `synctoken`";
801
-			if ($limit>0) {
802
-				$query .= " `LIMIT` " . (int)$limit;
803
-			}
804
-
805
-			// Fetching all changes
806
-			$stmt = $this->db->prepare($query);
807
-			$stmt->execute([$syncToken, $currentToken, $addressBookId]);
808
-
809
-			$changes = [];
810
-
811
-			// This loop ensures that any duplicates are overwritten, only the
812
-			// last change on a node is relevant.
813
-			while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
814
-
815
-				$changes[$row['uri']] = $row['operation'];
816
-
817
-			}
818
-
819
-			foreach($changes as $uri => $operation) {
820
-
821
-				switch($operation) {
822
-					case 1:
823
-						$result['added'][] = $uri;
824
-						break;
825
-					case 2:
826
-						$result['modified'][] = $uri;
827
-						break;
828
-					case 3:
829
-						$result['deleted'][] = $uri;
830
-						break;
831
-				}
832
-
833
-			}
834
-		} else {
835
-			// No synctoken supplied, this is the initial sync.
836
-			$query = "SELECT `uri` FROM `*PREFIX*cards` WHERE `addressbookid` = ?";
837
-			$stmt = $this->db->prepare($query);
838
-			$stmt->execute([$addressBookId]);
839
-
840
-			$result['added'] = $stmt->fetchAll(\PDO::FETCH_COLUMN);
841
-		}
842
-		return $result;
843
-	}
844
-
845
-	/**
846
-	 * Adds a change record to the addressbookchanges table.
847
-	 *
848
-	 * @param mixed $addressBookId
849
-	 * @param string $objectUri
850
-	 * @param int $operation 1 = add, 2 = modify, 3 = delete
851
-	 * @return void
852
-	 */
853
-	protected function addChange($addressBookId, $objectUri, $operation) {
854
-		$sql = 'INSERT INTO `*PREFIX*addressbookchanges`(`uri`, `synctoken`, `addressbookid`, `operation`) SELECT ?, `synctoken`, ?, ? FROM `*PREFIX*addressbooks` WHERE `id` = ?';
855
-		$stmt = $this->db->prepare($sql);
856
-		$stmt->execute([
857
-			$objectUri,
858
-			$addressBookId,
859
-			$operation,
860
-			$addressBookId
861
-		]);
862
-		$stmt = $this->db->prepare('UPDATE `*PREFIX*addressbooks` SET `synctoken` = `synctoken` + 1 WHERE `id` = ?');
863
-		$stmt->execute([
864
-			$addressBookId
865
-		]);
866
-	}
867
-
868
-	private function readBlob($cardData) {
869
-		if (is_resource($cardData)) {
870
-			return stream_get_contents($cardData);
871
-		}
872
-
873
-		return $cardData;
874
-	}
875
-
876
-	/**
877
-	 * @param IShareable $shareable
878
-	 * @param string[] $add
879
-	 * @param string[] $remove
880
-	 */
881
-	public function updateShares(IShareable $shareable, $add, $remove) {
882
-		$this->sharingBackend->updateShares($shareable, $add, $remove);
883
-	}
884
-
885
-	/**
886
-	 * search contact
887
-	 *
888
-	 * @param int $addressBookId
889
-	 * @param string $pattern which should match within the $searchProperties
890
-	 * @param array $searchProperties defines the properties within the query pattern should match
891
-	 * @return array an array of contacts which are arrays of key-value-pairs
892
-	 */
893
-	public function search($addressBookId, $pattern, $searchProperties) {
894
-		$query = $this->db->getQueryBuilder();
895
-		$query2 = $this->db->getQueryBuilder();
896
-
897
-		$query2->selectDistinct('cp.cardid')->from($this->dbCardsPropertiesTable, 'cp');
898
-		$query2->andWhere($query2->expr()->eq('cp.addressbookid', $query->createNamedParameter($addressBookId)));
899
-		$or = $query2->expr()->orX();
900
-		foreach ($searchProperties as $property) {
901
-			$or->add($query2->expr()->eq('cp.name', $query->createNamedParameter($property)));
902
-		}
903
-		$query2->andWhere($or);
904
-
905
-		// No need for like when the pattern is empty
906
-		if ('' !== $pattern) {
907
-			$query2->andWhere($query2->expr()->ilike('cp.value', $query->createNamedParameter('%' . $this->db->escapeLikeParameter($pattern) . '%')));
908
-		}
909
-
910
-		$query->select('c.carddata', 'c.uri')->from($this->dbCardsTable, 'c')
911
-			->where($query->expr()->in('c.id', $query->createFunction($query2->getSQL())));
912
-
913
-		$result = $query->execute();
914
-		$cards = $result->fetchAll();
915
-
916
-		$result->closeCursor();
917
-
918
-		return array_map(function($array) {
919
-			$array['carddata'] = $this->readBlob($array['carddata']);
920
-			return $array;
921
-		}, $cards);
922
-	}
923
-
924
-	/**
925
-	 * @param int $bookId
926
-	 * @param string $name
927
-	 * @return array
928
-	 */
929
-	public function collectCardProperties($bookId, $name) {
930
-		$query = $this->db->getQueryBuilder();
931
-		$result = $query->selectDistinct('value')
932
-			->from($this->dbCardsPropertiesTable)
933
-			->where($query->expr()->eq('name', $query->createNamedParameter($name)))
934
-			->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($bookId)))
935
-			->execute();
936
-
937
-		$all = $result->fetchAll(PDO::FETCH_COLUMN);
938
-		$result->closeCursor();
939
-
940
-		return $all;
941
-	}
942
-
943
-	/**
944
-	 * get URI from a given contact
945
-	 *
946
-	 * @param int $id
947
-	 * @return string
948
-	 */
949
-	public function getCardUri($id) {
950
-		$query = $this->db->getQueryBuilder();
951
-		$query->select('uri')->from($this->dbCardsTable)
952
-				->where($query->expr()->eq('id', $query->createParameter('id')))
953
-				->setParameter('id', $id);
954
-
955
-		$result = $query->execute();
956
-		$uri = $result->fetch();
957
-		$result->closeCursor();
958
-
959
-		if (!isset($uri['uri'])) {
960
-			throw new \InvalidArgumentException('Card does not exists: ' . $id);
961
-		}
962
-
963
-		return $uri['uri'];
964
-	}
965
-
966
-	/**
967
-	 * return contact with the given URI
968
-	 *
969
-	 * @param int $addressBookId
970
-	 * @param string $uri
971
-	 * @returns array
972
-	 */
973
-	public function getContact($addressBookId, $uri) {
974
-		$result = [];
975
-		$query = $this->db->getQueryBuilder();
976
-		$query->select('*')->from($this->dbCardsTable)
977
-				->where($query->expr()->eq('uri', $query->createNamedParameter($uri)))
978
-				->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)));
979
-		$queryResult = $query->execute();
980
-		$contact = $queryResult->fetch();
981
-		$queryResult->closeCursor();
982
-
983
-		if (is_array($contact)) {
984
-			$result = $contact;
985
-		}
986
-
987
-		return $result;
988
-	}
989
-
990
-	/**
991
-	 * Returns the list of people whom this address book is shared with.
992
-	 *
993
-	 * Every element in this array should have the following properties:
994
-	 *   * href - Often a mailto: address
995
-	 *   * commonName - Optional, for example a first + last name
996
-	 *   * status - See the Sabre\CalDAV\SharingPlugin::STATUS_ constants.
997
-	 *   * readOnly - boolean
998
-	 *   * summary - Optional, a description for the share
999
-	 *
1000
-	 * @return array
1001
-	 */
1002
-	public function getShares($addressBookId) {
1003
-		return $this->sharingBackend->getShares($addressBookId);
1004
-	}
1005
-
1006
-	/**
1007
-	 * update properties table
1008
-	 *
1009
-	 * @param int $addressBookId
1010
-	 * @param string $cardUri
1011
-	 * @param string $vCardSerialized
1012
-	 */
1013
-	protected function updateProperties($addressBookId, $cardUri, $vCardSerialized) {
1014
-		$cardId = $this->getCardId($addressBookId, $cardUri);
1015
-		$vCard = $this->readCard($vCardSerialized);
1016
-
1017
-		$this->purgeProperties($addressBookId, $cardId);
1018
-
1019
-		$query = $this->db->getQueryBuilder();
1020
-		$query->insert($this->dbCardsPropertiesTable)
1021
-			->values(
1022
-				[
1023
-					'addressbookid' => $query->createNamedParameter($addressBookId),
1024
-					'cardid' => $query->createNamedParameter($cardId),
1025
-					'name' => $query->createParameter('name'),
1026
-					'value' => $query->createParameter('value'),
1027
-					'preferred' => $query->createParameter('preferred')
1028
-				]
1029
-			);
1030
-
1031
-		foreach ($vCard->children() as $property) {
1032
-			if(!in_array($property->name, self::$indexProperties)) {
1033
-				continue;
1034
-			}
1035
-			$preferred = 0;
1036
-			foreach($property->parameters as $parameter) {
1037
-				if ($parameter->name === 'TYPE' && strtoupper($parameter->getValue()) === 'PREF') {
1038
-					$preferred = 1;
1039
-					break;
1040
-				}
1041
-			}
1042
-			$query->setParameter('name', $property->name);
1043
-			$query->setParameter('value', substr($property->getValue(), 0, 254));
1044
-			$query->setParameter('preferred', $preferred);
1045
-			$query->execute();
1046
-		}
1047
-	}
1048
-
1049
-	/**
1050
-	 * read vCard data into a vCard object
1051
-	 *
1052
-	 * @param string $cardData
1053
-	 * @return VCard
1054
-	 */
1055
-	protected function readCard($cardData) {
1056
-		return  Reader::read($cardData);
1057
-	}
1058
-
1059
-	/**
1060
-	 * delete all properties from a given card
1061
-	 *
1062
-	 * @param int $addressBookId
1063
-	 * @param int $cardId
1064
-	 */
1065
-	protected function purgeProperties($addressBookId, $cardId) {
1066
-		$query = $this->db->getQueryBuilder();
1067
-		$query->delete($this->dbCardsPropertiesTable)
1068
-			->where($query->expr()->eq('cardid', $query->createNamedParameter($cardId)))
1069
-			->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)));
1070
-		$query->execute();
1071
-	}
1072
-
1073
-	/**
1074
-	 * get ID from a given contact
1075
-	 *
1076
-	 * @param int $addressBookId
1077
-	 * @param string $uri
1078
-	 * @return int
1079
-	 */
1080
-	protected function getCardId($addressBookId, $uri) {
1081
-		$query = $this->db->getQueryBuilder();
1082
-		$query->select('id')->from($this->dbCardsTable)
1083
-			->where($query->expr()->eq('uri', $query->createNamedParameter($uri)))
1084
-			->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)));
1085
-
1086
-		$result = $query->execute();
1087
-		$cardIds = $result->fetch();
1088
-		$result->closeCursor();
1089
-
1090
-		if (!isset($cardIds['id'])) {
1091
-			throw new \InvalidArgumentException('Card does not exists: ' . $uri);
1092
-		}
1093
-
1094
-		return (int)$cardIds['id'];
1095
-	}
1096
-
1097
-	/**
1098
-	 * For shared address books the sharee is set in the ACL of the address book
1099
-	 * @param $addressBookId
1100
-	 * @param $acl
1101
-	 * @return array
1102
-	 */
1103
-	public function applyShareAcl($addressBookId, $acl) {
1104
-		return $this->sharingBackend->applyShareAcl($addressBookId, $acl);
1105
-	}
1106
-
1107
-	private function convertPrincipal($principalUri, $toV2) {
1108
-		if ($this->principalBackend->getPrincipalPrefix() === 'principals') {
1109
-			list(, $name) = \Sabre\Uri\split($principalUri);
1110
-			if ($toV2 === true) {
1111
-				return "principals/users/$name";
1112
-			}
1113
-			return "principals/$name";
1114
-		}
1115
-		return $principalUri;
1116
-	}
1117
-
1118
-	private function addOwnerPrincipal(&$addressbookInfo) {
1119
-		$ownerPrincipalKey = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal';
1120
-		$displaynameKey = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD . '}owner-displayname';
1121
-		if (isset($addressbookInfo[$ownerPrincipalKey])) {
1122
-			$uri = $addressbookInfo[$ownerPrincipalKey];
1123
-		} else {
1124
-			$uri = $addressbookInfo['principaluri'];
1125
-		}
1126
-
1127
-		$principalInformation = $this->principalBackend->getPrincipalByPath($uri);
1128
-		if (isset($principalInformation['{DAV:}displayname'])) {
1129
-			$addressbookInfo[$displaynameKey] = $principalInformation['{DAV:}displayname'];
1130
-		}
1131
-	}
1132
-
1133
-	/**
1134
-	 * Extract UID from vcard
1135
-	 *
1136
-	 * @param string $cardData the vcard raw data
1137
-	 * @return string the uid
1138
-	 * @throws BadRequest if no UID is available
1139
-	 */
1140
-	private function getUID($cardData) {
1141
-		if ($cardData != '') {
1142
-			$vCard = Reader::read($cardData);
1143
-			if ($vCard->UID) {
1144
-				$uid = $vCard->UID->getValue();
1145
-				return $uid;
1146
-			}
1147
-			// should already be handled, but just in case
1148
-			throw new BadRequest('vCards on CardDAV servers MUST have a UID property');
1149
-		}
1150
-		// should already be handled, but just in case
1151
-		throw new BadRequest('vCard can not be empty');
1152
-	}
56
+    const PERSONAL_ADDRESSBOOK_URI = 'contacts';
57
+    const PERSONAL_ADDRESSBOOK_NAME = 'Contacts';
58
+
59
+    /** @var Principal */
60
+    private $principalBackend;
61
+
62
+    /** @var string */
63
+    private $dbCardsTable = 'cards';
64
+
65
+    /** @var string */
66
+    private $dbCardsPropertiesTable = 'cards_properties';
67
+
68
+    /** @var IDBConnection */
69
+    private $db;
70
+
71
+    /** @var Backend */
72
+    private $sharingBackend;
73
+
74
+    /** @var array properties to index */
75
+    public static $indexProperties = array(
76
+            'BDAY', 'UID', 'N', 'FN', 'TITLE', 'ROLE', 'NOTE', 'NICKNAME',
77
+            'ORG', 'CATEGORIES', 'EMAIL', 'TEL', 'IMPP', 'ADR', 'URL', 'GEO', 'CLOUD');
78
+
79
+    /**
80
+     * @var string[] Map of uid => display name
81
+     */
82
+    protected $userDisplayNames;
83
+
84
+    /** @var IUserManager */
85
+    private $userManager;
86
+
87
+    /** @var EventDispatcherInterface */
88
+    private $dispatcher;
89
+
90
+    /**
91
+     * CardDavBackend constructor.
92
+     *
93
+     * @param IDBConnection $db
94
+     * @param Principal $principalBackend
95
+     * @param IUserManager $userManager
96
+     * @param IGroupManager $groupManager
97
+     * @param EventDispatcherInterface $dispatcher
98
+     */
99
+    public function __construct(IDBConnection $db,
100
+                                Principal $principalBackend,
101
+                                IUserManager $userManager,
102
+                                IGroupManager $groupManager,
103
+                                EventDispatcherInterface $dispatcher) {
104
+        $this->db = $db;
105
+        $this->principalBackend = $principalBackend;
106
+        $this->userManager = $userManager;
107
+        $this->dispatcher = $dispatcher;
108
+        $this->sharingBackend = new Backend($this->db, $this->userManager, $groupManager, $principalBackend, 'addressbook');
109
+    }
110
+
111
+    /**
112
+     * Return the number of address books for a principal
113
+     *
114
+     * @param $principalUri
115
+     * @return int
116
+     */
117
+    public function getAddressBooksForUserCount($principalUri) {
118
+        $principalUri = $this->convertPrincipal($principalUri, true);
119
+        $query = $this->db->getQueryBuilder();
120
+        $query->select($query->createFunction('COUNT(*)'))
121
+            ->from('addressbooks')
122
+            ->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri)));
123
+
124
+        return (int)$query->execute()->fetchColumn();
125
+    }
126
+
127
+    /**
128
+     * Returns the list of address books for a specific user.
129
+     *
130
+     * Every addressbook should have the following properties:
131
+     *   id - an arbitrary unique id
132
+     *   uri - the 'basename' part of the url
133
+     *   principaluri - Same as the passed parameter
134
+     *
135
+     * Any additional clark-notation property may be passed besides this. Some
136
+     * common ones are :
137
+     *   {DAV:}displayname
138
+     *   {urn:ietf:params:xml:ns:carddav}addressbook-description
139
+     *   {http://calendarserver.org/ns/}getctag
140
+     *
141
+     * @param string $principalUri
142
+     * @return array
143
+     */
144
+    function getAddressBooksForUser($principalUri) {
145
+        $principalUriOriginal = $principalUri;
146
+        $principalUri = $this->convertPrincipal($principalUri, true);
147
+        $query = $this->db->getQueryBuilder();
148
+        $query->select(['id', 'uri', 'displayname', 'principaluri', 'description', 'synctoken'])
149
+            ->from('addressbooks')
150
+            ->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri)));
151
+
152
+        $addressBooks = [];
153
+
154
+        $result = $query->execute();
155
+        while($row = $result->fetch()) {
156
+            $addressBooks[$row['id']] = [
157
+                'id'  => $row['id'],
158
+                'uri' => $row['uri'],
159
+                'principaluri' => $this->convertPrincipal($row['principaluri'], false),
160
+                '{DAV:}displayname' => $row['displayname'],
161
+                '{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
162
+                '{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
163
+                '{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
164
+            ];
165
+
166
+            $this->addOwnerPrincipal($addressBooks[$row['id']]);
167
+        }
168
+        $result->closeCursor();
169
+
170
+        // query for shared calendars
171
+        $principals = $this->principalBackend->getGroupMembership($principalUriOriginal, true);
172
+        $principals = array_map(function($principal) {
173
+            return urldecode($principal);
174
+        }, $principals);
175
+        $principals[]= $principalUri;
176
+
177
+        $query = $this->db->getQueryBuilder();
178
+        $result = $query->select(['a.id', 'a.uri', 'a.displayname', 'a.principaluri', 'a.description', 'a.synctoken', 's.access'])
179
+            ->from('dav_shares', 's')
180
+            ->join('s', 'addressbooks', 'a', $query->expr()->eq('s.resourceid', 'a.id'))
181
+            ->where($query->expr()->in('s.principaluri', $query->createParameter('principaluri')))
182
+            ->andWhere($query->expr()->eq('s.type', $query->createParameter('type')))
183
+            ->setParameter('type', 'addressbook')
184
+            ->setParameter('principaluri', $principals, IQueryBuilder::PARAM_STR_ARRAY)
185
+            ->execute();
186
+
187
+        $readOnlyPropertyName = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only';
188
+        while($row = $result->fetch()) {
189
+            if ($row['principaluri'] === $principalUri) {
190
+                continue;
191
+            }
192
+
193
+            $readOnly = (int) $row['access'] === Backend::ACCESS_READ;
194
+            if (isset($addressBooks[$row['id']])) {
195
+                if ($readOnly) {
196
+                    // New share can not have more permissions then the old one.
197
+                    continue;
198
+                }
199
+                if (isset($addressBooks[$row['id']][$readOnlyPropertyName]) &&
200
+                    $addressBooks[$row['id']][$readOnlyPropertyName] === 0) {
201
+                    // Old share is already read-write, no more permissions can be gained
202
+                    continue;
203
+                }
204
+            }
205
+
206
+            list(, $name) = \Sabre\Uri\split($row['principaluri']);
207
+            $uri = $row['uri'] . '_shared_by_' . $name;
208
+            $displayName = $row['displayname'] . ' (' . $this->getUserDisplayName($name) . ')';
209
+
210
+            $addressBooks[$row['id']] = [
211
+                'id'  => $row['id'],
212
+                'uri' => $uri,
213
+                'principaluri' => $principalUriOriginal,
214
+                '{DAV:}displayname' => $displayName,
215
+                '{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
216
+                '{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
217
+                '{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
218
+                '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $row['principaluri'],
219
+                $readOnlyPropertyName => $readOnly,
220
+            ];
221
+
222
+            $this->addOwnerPrincipal($addressBooks[$row['id']]);
223
+        }
224
+        $result->closeCursor();
225
+
226
+        return array_values($addressBooks);
227
+    }
228
+
229
+    public function getUsersOwnAddressBooks($principalUri) {
230
+        $principalUri = $this->convertPrincipal($principalUri, true);
231
+        $query = $this->db->getQueryBuilder();
232
+        $query->select(['id', 'uri', 'displayname', 'principaluri', 'description', 'synctoken'])
233
+                ->from('addressbooks')
234
+                ->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri)));
235
+
236
+        $addressBooks = [];
237
+
238
+        $result = $query->execute();
239
+        while($row = $result->fetch()) {
240
+            $addressBooks[$row['id']] = [
241
+                'id'  => $row['id'],
242
+                'uri' => $row['uri'],
243
+                'principaluri' => $this->convertPrincipal($row['principaluri'], false),
244
+                '{DAV:}displayname' => $row['displayname'],
245
+                '{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
246
+                '{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
247
+                '{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
248
+            ];
249
+
250
+            $this->addOwnerPrincipal($addressBooks[$row['id']]);
251
+        }
252
+        $result->closeCursor();
253
+
254
+        return array_values($addressBooks);
255
+    }
256
+
257
+    private function getUserDisplayName($uid) {
258
+        if (!isset($this->userDisplayNames[$uid])) {
259
+            $user = $this->userManager->get($uid);
260
+
261
+            if ($user instanceof IUser) {
262
+                $this->userDisplayNames[$uid] = $user->getDisplayName();
263
+            } else {
264
+                $this->userDisplayNames[$uid] = $uid;
265
+            }
266
+        }
267
+
268
+        return $this->userDisplayNames[$uid];
269
+    }
270
+
271
+    /**
272
+     * @param int $addressBookId
273
+     */
274
+    public function getAddressBookById($addressBookId) {
275
+        $query = $this->db->getQueryBuilder();
276
+        $result = $query->select(['id', 'uri', 'displayname', 'principaluri', 'description', 'synctoken'])
277
+            ->from('addressbooks')
278
+            ->where($query->expr()->eq('id', $query->createNamedParameter($addressBookId)))
279
+            ->execute();
280
+
281
+        $row = $result->fetch();
282
+        $result->closeCursor();
283
+        if ($row === false) {
284
+            return null;
285
+        }
286
+
287
+        $addressBook = [
288
+            'id'  => $row['id'],
289
+            'uri' => $row['uri'],
290
+            'principaluri' => $row['principaluri'],
291
+            '{DAV:}displayname' => $row['displayname'],
292
+            '{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
293
+            '{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
294
+            '{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
295
+        ];
296
+
297
+        $this->addOwnerPrincipal($addressBook);
298
+
299
+        return $addressBook;
300
+    }
301
+
302
+    /**
303
+     * @param $addressBookUri
304
+     * @return array|null
305
+     */
306
+    public function getAddressBooksByUri($principal, $addressBookUri) {
307
+        $query = $this->db->getQueryBuilder();
308
+        $result = $query->select(['id', 'uri', 'displayname', 'principaluri', 'description', 'synctoken'])
309
+            ->from('addressbooks')
310
+            ->where($query->expr()->eq('uri', $query->createNamedParameter($addressBookUri)))
311
+            ->andWhere($query->expr()->eq('principaluri', $query->createNamedParameter($principal)))
312
+            ->setMaxResults(1)
313
+            ->execute();
314
+
315
+        $row = $result->fetch();
316
+        $result->closeCursor();
317
+        if ($row === false) {
318
+            return null;
319
+        }
320
+
321
+        $addressBook = [
322
+            'id'  => $row['id'],
323
+            'uri' => $row['uri'],
324
+            'principaluri' => $row['principaluri'],
325
+            '{DAV:}displayname' => $row['displayname'],
326
+            '{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
327
+            '{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
328
+            '{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
329
+        ];
330
+
331
+        $this->addOwnerPrincipal($addressBook);
332
+
333
+        return $addressBook;
334
+    }
335
+
336
+    /**
337
+     * Updates properties for an address book.
338
+     *
339
+     * The list of mutations is stored in a Sabre\DAV\PropPatch object.
340
+     * To do the actual updates, you must tell this object which properties
341
+     * you're going to process with the handle() method.
342
+     *
343
+     * Calling the handle method is like telling the PropPatch object "I
344
+     * promise I can handle updating this property".
345
+     *
346
+     * Read the PropPatch documentation for more info and examples.
347
+     *
348
+     * @param string $addressBookId
349
+     * @param \Sabre\DAV\PropPatch $propPatch
350
+     * @return void
351
+     */
352
+    function updateAddressBook($addressBookId, \Sabre\DAV\PropPatch $propPatch) {
353
+        $supportedProperties = [
354
+            '{DAV:}displayname',
355
+            '{' . Plugin::NS_CARDDAV . '}addressbook-description',
356
+        ];
357
+
358
+        /**
359
+         * @suppress SqlInjectionChecker
360
+         */
361
+        $propPatch->handle($supportedProperties, function($mutations) use ($addressBookId) {
362
+
363
+            $updates = [];
364
+            foreach($mutations as $property=>$newValue) {
365
+
366
+                switch($property) {
367
+                    case '{DAV:}displayname' :
368
+                        $updates['displayname'] = $newValue;
369
+                        break;
370
+                    case '{' . Plugin::NS_CARDDAV . '}addressbook-description' :
371
+                        $updates['description'] = $newValue;
372
+                        break;
373
+                }
374
+            }
375
+            $query = $this->db->getQueryBuilder();
376
+            $query->update('addressbooks');
377
+
378
+            foreach($updates as $key=>$value) {
379
+                $query->set($key, $query->createNamedParameter($value));
380
+            }
381
+            $query->where($query->expr()->eq('id', $query->createNamedParameter($addressBookId)))
382
+            ->execute();
383
+
384
+            $this->addChange($addressBookId, "", 2);
385
+
386
+            return true;
387
+
388
+        });
389
+    }
390
+
391
+    /**
392
+     * Creates a new address book
393
+     *
394
+     * @param string $principalUri
395
+     * @param string $url Just the 'basename' of the url.
396
+     * @param array $properties
397
+     * @return int
398
+     * @throws BadRequest
399
+     */
400
+    function createAddressBook($principalUri, $url, array $properties) {
401
+        $values = [
402
+            'displayname' => null,
403
+            'description' => null,
404
+            'principaluri' => $principalUri,
405
+            'uri' => $url,
406
+            'synctoken' => 1
407
+        ];
408
+
409
+        foreach($properties as $property=>$newValue) {
410
+
411
+            switch($property) {
412
+                case '{DAV:}displayname' :
413
+                    $values['displayname'] = $newValue;
414
+                    break;
415
+                case '{' . Plugin::NS_CARDDAV . '}addressbook-description' :
416
+                    $values['description'] = $newValue;
417
+                    break;
418
+                default :
419
+                    throw new BadRequest('Unknown property: ' . $property);
420
+            }
421
+
422
+        }
423
+
424
+        // Fallback to make sure the displayname is set. Some clients may refuse
425
+        // to work with addressbooks not having a displayname.
426
+        if(is_null($values['displayname'])) {
427
+            $values['displayname'] = $url;
428
+        }
429
+
430
+        $query = $this->db->getQueryBuilder();
431
+        $query->insert('addressbooks')
432
+            ->values([
433
+                'uri' => $query->createParameter('uri'),
434
+                'displayname' => $query->createParameter('displayname'),
435
+                'description' => $query->createParameter('description'),
436
+                'principaluri' => $query->createParameter('principaluri'),
437
+                'synctoken' => $query->createParameter('synctoken'),
438
+            ])
439
+            ->setParameters($values)
440
+            ->execute();
441
+
442
+        return $query->getLastInsertId();
443
+    }
444
+
445
+    /**
446
+     * Deletes an entire addressbook and all its contents
447
+     *
448
+     * @param mixed $addressBookId
449
+     * @return void
450
+     */
451
+    function deleteAddressBook($addressBookId) {
452
+        $query = $this->db->getQueryBuilder();
453
+        $query->delete('cards')
454
+            ->where($query->expr()->eq('addressbookid', $query->createParameter('addressbookid')))
455
+            ->setParameter('addressbookid', $addressBookId)
456
+            ->execute();
457
+
458
+        $query->delete('addressbookchanges')
459
+            ->where($query->expr()->eq('addressbookid', $query->createParameter('addressbookid')))
460
+            ->setParameter('addressbookid', $addressBookId)
461
+            ->execute();
462
+
463
+        $query->delete('addressbooks')
464
+            ->where($query->expr()->eq('id', $query->createParameter('id')))
465
+            ->setParameter('id', $addressBookId)
466
+            ->execute();
467
+
468
+        $this->sharingBackend->deleteAllShares($addressBookId);
469
+
470
+        $query->delete($this->dbCardsPropertiesTable)
471
+            ->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
472
+            ->execute();
473
+
474
+    }
475
+
476
+    /**
477
+     * Returns all cards for a specific addressbook id.
478
+     *
479
+     * This method should return the following properties for each card:
480
+     *   * carddata - raw vcard data
481
+     *   * uri - Some unique url
482
+     *   * lastmodified - A unix timestamp
483
+     *
484
+     * It's recommended to also return the following properties:
485
+     *   * etag - A unique etag. This must change every time the card changes.
486
+     *   * size - The size of the card in bytes.
487
+     *
488
+     * If these last two properties are provided, less time will be spent
489
+     * calculating them. If they are specified, you can also ommit carddata.
490
+     * This may speed up certain requests, especially with large cards.
491
+     *
492
+     * @param mixed $addressBookId
493
+     * @return array
494
+     */
495
+    function getCards($addressBookId) {
496
+        $query = $this->db->getQueryBuilder();
497
+        $query->select(['id', 'uri', 'lastmodified', 'etag', 'size', 'carddata', 'uid'])
498
+            ->from('cards')
499
+            ->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)));
500
+
501
+        $cards = [];
502
+
503
+        $result = $query->execute();
504
+        while($row = $result->fetch()) {
505
+            $row['etag'] = '"' . $row['etag'] . '"';
506
+            $row['carddata'] = $this->readBlob($row['carddata']);
507
+            $cards[] = $row;
508
+        }
509
+        $result->closeCursor();
510
+
511
+        return $cards;
512
+    }
513
+
514
+    /**
515
+     * Returns a specific card.
516
+     *
517
+     * The same set of properties must be returned as with getCards. The only
518
+     * exception is that 'carddata' is absolutely required.
519
+     *
520
+     * If the card does not exist, you must return false.
521
+     *
522
+     * @param mixed $addressBookId
523
+     * @param string $cardUri
524
+     * @return array
525
+     */
526
+    function getCard($addressBookId, $cardUri) {
527
+        $query = $this->db->getQueryBuilder();
528
+        $query->select(['id', 'uri', 'lastmodified', 'etag', 'size', 'carddata', 'uid'])
529
+            ->from('cards')
530
+            ->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
531
+            ->andWhere($query->expr()->eq('uri', $query->createNamedParameter($cardUri)))
532
+            ->setMaxResults(1);
533
+
534
+        $result = $query->execute();
535
+        $row = $result->fetch();
536
+        if (!$row) {
537
+            return false;
538
+        }
539
+        $row['etag'] = '"' . $row['etag'] . '"';
540
+        $row['carddata'] = $this->readBlob($row['carddata']);
541
+
542
+        return $row;
543
+    }
544
+
545
+    /**
546
+     * Returns a list of cards.
547
+     *
548
+     * This method should work identical to getCard, but instead return all the
549
+     * cards in the list as an array.
550
+     *
551
+     * If the backend supports this, it may allow for some speed-ups.
552
+     *
553
+     * @param mixed $addressBookId
554
+     * @param string[] $uris
555
+     * @return array
556
+     */
557
+    function getMultipleCards($addressBookId, array $uris) {
558
+        if (empty($uris)) {
559
+            return [];
560
+        }
561
+
562
+        $chunks = array_chunk($uris, 100);
563
+        $cards = [];
564
+
565
+        $query = $this->db->getQueryBuilder();
566
+        $query->select(['id', 'uri', 'lastmodified', 'etag', 'size', 'carddata', 'uid'])
567
+            ->from('cards')
568
+            ->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
569
+            ->andWhere($query->expr()->in('uri', $query->createParameter('uri')));
570
+
571
+        foreach ($chunks as $uris) {
572
+            $query->setParameter('uri', $uris, IQueryBuilder::PARAM_STR_ARRAY);
573
+            $result = $query->execute();
574
+
575
+            while ($row = $result->fetch()) {
576
+                $row['etag'] = '"' . $row['etag'] . '"';
577
+                $row['carddata'] = $this->readBlob($row['carddata']);
578
+                $cards[] = $row;
579
+            }
580
+            $result->closeCursor();
581
+        }
582
+        return $cards;
583
+    }
584
+
585
+    /**
586
+     * Creates a new card.
587
+     *
588
+     * The addressbook id will be passed as the first argument. This is the
589
+     * same id as it is returned from the getAddressBooksForUser method.
590
+     *
591
+     * The cardUri is a base uri, and doesn't include the full path. The
592
+     * cardData argument is the vcard body, and is passed as a string.
593
+     *
594
+     * It is possible to return an ETag from this method. This ETag is for the
595
+     * newly created resource, and must be enclosed with double quotes (that
596
+     * is, the string itself must contain the double quotes).
597
+     *
598
+     * You should only return the ETag if you store the carddata as-is. If a
599
+     * subsequent GET request on the same card does not have the same body,
600
+     * byte-by-byte and you did return an ETag here, clients tend to get
601
+     * confused.
602
+     *
603
+     * If you don't return an ETag, you can just return null.
604
+     *
605
+     * @param mixed $addressBookId
606
+     * @param string $cardUri
607
+     * @param string $cardData
608
+     * @return string
609
+     */
610
+    function createCard($addressBookId, $cardUri, $cardData) {
611
+        $etag = md5($cardData);
612
+        $uid = $this->getUID($cardData);
613
+
614
+        $query = $this->db->getQueryBuilder();
615
+        $query->insert('cards')
616
+            ->values([
617
+                'carddata' => $query->createNamedParameter($cardData, IQueryBuilder::PARAM_LOB),
618
+                'uri' => $query->createNamedParameter($cardUri),
619
+                'lastmodified' => $query->createNamedParameter(time()),
620
+                'addressbookid' => $query->createNamedParameter($addressBookId),
621
+                'size' => $query->createNamedParameter(strlen($cardData)),
622
+                'etag' => $query->createNamedParameter($etag),
623
+                'uid' => $query->createNamedParameter($uid),
624
+            ])
625
+            ->execute();
626
+
627
+        $this->addChange($addressBookId, $cardUri, 1);
628
+        $this->updateProperties($addressBookId, $cardUri, $cardData);
629
+
630
+        $this->dispatcher->dispatch('\OCA\DAV\CardDAV\CardDavBackend::createCard',
631
+            new GenericEvent(null, [
632
+                'addressBookId' => $addressBookId,
633
+                'cardUri' => $cardUri,
634
+                'cardData' => $cardData]));
635
+
636
+        return '"' . $etag . '"';
637
+    }
638
+
639
+    /**
640
+     * Updates a card.
641
+     *
642
+     * The addressbook id will be passed as the first argument. This is the
643
+     * same id as it is returned from the getAddressBooksForUser method.
644
+     *
645
+     * The cardUri is a base uri, and doesn't include the full path. The
646
+     * cardData argument is the vcard body, and is passed as a string.
647
+     *
648
+     * It is possible to return an ETag from this method. This ETag should
649
+     * match that of the updated resource, and must be enclosed with double
650
+     * quotes (that is: the string itself must contain the actual quotes).
651
+     *
652
+     * You should only return the ETag if you store the carddata as-is. If a
653
+     * subsequent GET request on the same card does not have the same body,
654
+     * byte-by-byte and you did return an ETag here, clients tend to get
655
+     * confused.
656
+     *
657
+     * If you don't return an ETag, you can just return null.
658
+     *
659
+     * @param mixed $addressBookId
660
+     * @param string $cardUri
661
+     * @param string $cardData
662
+     * @return string
663
+     */
664
+    function updateCard($addressBookId, $cardUri, $cardData) {
665
+
666
+        $uid = $this->getUID($cardData);
667
+        $etag = md5($cardData);
668
+        $query = $this->db->getQueryBuilder();
669
+        $query->update('cards')
670
+            ->set('carddata', $query->createNamedParameter($cardData, IQueryBuilder::PARAM_LOB))
671
+            ->set('lastmodified', $query->createNamedParameter(time()))
672
+            ->set('size', $query->createNamedParameter(strlen($cardData)))
673
+            ->set('etag', $query->createNamedParameter($etag))
674
+            ->set('uid', $query->createNamedParameter($uid))
675
+            ->where($query->expr()->eq('uri', $query->createNamedParameter($cardUri)))
676
+            ->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
677
+            ->execute();
678
+
679
+        $this->addChange($addressBookId, $cardUri, 2);
680
+        $this->updateProperties($addressBookId, $cardUri, $cardData);
681
+
682
+        $this->dispatcher->dispatch('\OCA\DAV\CardDAV\CardDavBackend::updateCard',
683
+            new GenericEvent(null, [
684
+                'addressBookId' => $addressBookId,
685
+                'cardUri' => $cardUri,
686
+                'cardData' => $cardData]));
687
+
688
+        return '"' . $etag . '"';
689
+    }
690
+
691
+    /**
692
+     * Deletes a card
693
+     *
694
+     * @param mixed $addressBookId
695
+     * @param string $cardUri
696
+     * @return bool
697
+     */
698
+    function deleteCard($addressBookId, $cardUri) {
699
+        try {
700
+            $cardId = $this->getCardId($addressBookId, $cardUri);
701
+        } catch (\InvalidArgumentException $e) {
702
+            $cardId = null;
703
+        }
704
+        $query = $this->db->getQueryBuilder();
705
+        $ret = $query->delete('cards')
706
+            ->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
707
+            ->andWhere($query->expr()->eq('uri', $query->createNamedParameter($cardUri)))
708
+            ->execute();
709
+
710
+        $this->addChange($addressBookId, $cardUri, 3);
711
+
712
+        $this->dispatcher->dispatch('\OCA\DAV\CardDAV\CardDavBackend::deleteCard',
713
+            new GenericEvent(null, [
714
+                'addressBookId' => $addressBookId,
715
+                'cardUri' => $cardUri]));
716
+
717
+        if ($ret === 1) {
718
+            if ($cardId !== null) {
719
+                $this->purgeProperties($addressBookId, $cardId);
720
+            }
721
+            return true;
722
+        }
723
+
724
+        return false;
725
+    }
726
+
727
+    /**
728
+     * The getChanges method returns all the changes that have happened, since
729
+     * the specified syncToken in the specified address book.
730
+     *
731
+     * This function should return an array, such as the following:
732
+     *
733
+     * [
734
+     *   'syncToken' => 'The current synctoken',
735
+     *   'added'   => [
736
+     *      'new.txt',
737
+     *   ],
738
+     *   'modified'   => [
739
+     *      'modified.txt',
740
+     *   ],
741
+     *   'deleted' => [
742
+     *      'foo.php.bak',
743
+     *      'old.txt'
744
+     *   ]
745
+     * ];
746
+     *
747
+     * The returned syncToken property should reflect the *current* syncToken
748
+     * of the calendar, as reported in the {http://sabredav.org/ns}sync-token
749
+     * property. This is needed here too, to ensure the operation is atomic.
750
+     *
751
+     * If the $syncToken argument is specified as null, this is an initial
752
+     * sync, and all members should be reported.
753
+     *
754
+     * The modified property is an array of nodenames that have changed since
755
+     * the last token.
756
+     *
757
+     * The deleted property is an array with nodenames, that have been deleted
758
+     * from collection.
759
+     *
760
+     * The $syncLevel argument is basically the 'depth' of the report. If it's
761
+     * 1, you only have to report changes that happened only directly in
762
+     * immediate descendants. If it's 2, it should also include changes from
763
+     * the nodes below the child collections. (grandchildren)
764
+     *
765
+     * The $limit argument allows a client to specify how many results should
766
+     * be returned at most. If the limit is not specified, it should be treated
767
+     * as infinite.
768
+     *
769
+     * If the limit (infinite or not) is higher than you're willing to return,
770
+     * you should throw a Sabre\DAV\Exception\TooMuchMatches() exception.
771
+     *
772
+     * If the syncToken is expired (due to data cleanup) or unknown, you must
773
+     * return null.
774
+     *
775
+     * The limit is 'suggestive'. You are free to ignore it.
776
+     *
777
+     * @param string $addressBookId
778
+     * @param string $syncToken
779
+     * @param int $syncLevel
780
+     * @param int $limit
781
+     * @return array
782
+     */
783
+    function getChangesForAddressBook($addressBookId, $syncToken, $syncLevel, $limit = null) {
784
+        // Current synctoken
785
+        $stmt = $this->db->prepare('SELECT `synctoken` FROM `*PREFIX*addressbooks` WHERE `id` = ?');
786
+        $stmt->execute([ $addressBookId ]);
787
+        $currentToken = $stmt->fetchColumn(0);
788
+
789
+        if (is_null($currentToken)) return null;
790
+
791
+        $result = [
792
+            'syncToken' => $currentToken,
793
+            'added'     => [],
794
+            'modified'  => [],
795
+            'deleted'   => [],
796
+        ];
797
+
798
+        if ($syncToken) {
799
+
800
+            $query = "SELECT `uri`, `operation` FROM `*PREFIX*addressbookchanges` WHERE `synctoken` >= ? AND `synctoken` < ? AND `addressbookid` = ? ORDER BY `synctoken`";
801
+            if ($limit>0) {
802
+                $query .= " `LIMIT` " . (int)$limit;
803
+            }
804
+
805
+            // Fetching all changes
806
+            $stmt = $this->db->prepare($query);
807
+            $stmt->execute([$syncToken, $currentToken, $addressBookId]);
808
+
809
+            $changes = [];
810
+
811
+            // This loop ensures that any duplicates are overwritten, only the
812
+            // last change on a node is relevant.
813
+            while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
814
+
815
+                $changes[$row['uri']] = $row['operation'];
816
+
817
+            }
818
+
819
+            foreach($changes as $uri => $operation) {
820
+
821
+                switch($operation) {
822
+                    case 1:
823
+                        $result['added'][] = $uri;
824
+                        break;
825
+                    case 2:
826
+                        $result['modified'][] = $uri;
827
+                        break;
828
+                    case 3:
829
+                        $result['deleted'][] = $uri;
830
+                        break;
831
+                }
832
+
833
+            }
834
+        } else {
835
+            // No synctoken supplied, this is the initial sync.
836
+            $query = "SELECT `uri` FROM `*PREFIX*cards` WHERE `addressbookid` = ?";
837
+            $stmt = $this->db->prepare($query);
838
+            $stmt->execute([$addressBookId]);
839
+
840
+            $result['added'] = $stmt->fetchAll(\PDO::FETCH_COLUMN);
841
+        }
842
+        return $result;
843
+    }
844
+
845
+    /**
846
+     * Adds a change record to the addressbookchanges table.
847
+     *
848
+     * @param mixed $addressBookId
849
+     * @param string $objectUri
850
+     * @param int $operation 1 = add, 2 = modify, 3 = delete
851
+     * @return void
852
+     */
853
+    protected function addChange($addressBookId, $objectUri, $operation) {
854
+        $sql = 'INSERT INTO `*PREFIX*addressbookchanges`(`uri`, `synctoken`, `addressbookid`, `operation`) SELECT ?, `synctoken`, ?, ? FROM `*PREFIX*addressbooks` WHERE `id` = ?';
855
+        $stmt = $this->db->prepare($sql);
856
+        $stmt->execute([
857
+            $objectUri,
858
+            $addressBookId,
859
+            $operation,
860
+            $addressBookId
861
+        ]);
862
+        $stmt = $this->db->prepare('UPDATE `*PREFIX*addressbooks` SET `synctoken` = `synctoken` + 1 WHERE `id` = ?');
863
+        $stmt->execute([
864
+            $addressBookId
865
+        ]);
866
+    }
867
+
868
+    private function readBlob($cardData) {
869
+        if (is_resource($cardData)) {
870
+            return stream_get_contents($cardData);
871
+        }
872
+
873
+        return $cardData;
874
+    }
875
+
876
+    /**
877
+     * @param IShareable $shareable
878
+     * @param string[] $add
879
+     * @param string[] $remove
880
+     */
881
+    public function updateShares(IShareable $shareable, $add, $remove) {
882
+        $this->sharingBackend->updateShares($shareable, $add, $remove);
883
+    }
884
+
885
+    /**
886
+     * search contact
887
+     *
888
+     * @param int $addressBookId
889
+     * @param string $pattern which should match within the $searchProperties
890
+     * @param array $searchProperties defines the properties within the query pattern should match
891
+     * @return array an array of contacts which are arrays of key-value-pairs
892
+     */
893
+    public function search($addressBookId, $pattern, $searchProperties) {
894
+        $query = $this->db->getQueryBuilder();
895
+        $query2 = $this->db->getQueryBuilder();
896
+
897
+        $query2->selectDistinct('cp.cardid')->from($this->dbCardsPropertiesTable, 'cp');
898
+        $query2->andWhere($query2->expr()->eq('cp.addressbookid', $query->createNamedParameter($addressBookId)));
899
+        $or = $query2->expr()->orX();
900
+        foreach ($searchProperties as $property) {
901
+            $or->add($query2->expr()->eq('cp.name', $query->createNamedParameter($property)));
902
+        }
903
+        $query2->andWhere($or);
904
+
905
+        // No need for like when the pattern is empty
906
+        if ('' !== $pattern) {
907
+            $query2->andWhere($query2->expr()->ilike('cp.value', $query->createNamedParameter('%' . $this->db->escapeLikeParameter($pattern) . '%')));
908
+        }
909
+
910
+        $query->select('c.carddata', 'c.uri')->from($this->dbCardsTable, 'c')
911
+            ->where($query->expr()->in('c.id', $query->createFunction($query2->getSQL())));
912
+
913
+        $result = $query->execute();
914
+        $cards = $result->fetchAll();
915
+
916
+        $result->closeCursor();
917
+
918
+        return array_map(function($array) {
919
+            $array['carddata'] = $this->readBlob($array['carddata']);
920
+            return $array;
921
+        }, $cards);
922
+    }
923
+
924
+    /**
925
+     * @param int $bookId
926
+     * @param string $name
927
+     * @return array
928
+     */
929
+    public function collectCardProperties($bookId, $name) {
930
+        $query = $this->db->getQueryBuilder();
931
+        $result = $query->selectDistinct('value')
932
+            ->from($this->dbCardsPropertiesTable)
933
+            ->where($query->expr()->eq('name', $query->createNamedParameter($name)))
934
+            ->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($bookId)))
935
+            ->execute();
936
+
937
+        $all = $result->fetchAll(PDO::FETCH_COLUMN);
938
+        $result->closeCursor();
939
+
940
+        return $all;
941
+    }
942
+
943
+    /**
944
+     * get URI from a given contact
945
+     *
946
+     * @param int $id
947
+     * @return string
948
+     */
949
+    public function getCardUri($id) {
950
+        $query = $this->db->getQueryBuilder();
951
+        $query->select('uri')->from($this->dbCardsTable)
952
+                ->where($query->expr()->eq('id', $query->createParameter('id')))
953
+                ->setParameter('id', $id);
954
+
955
+        $result = $query->execute();
956
+        $uri = $result->fetch();
957
+        $result->closeCursor();
958
+
959
+        if (!isset($uri['uri'])) {
960
+            throw new \InvalidArgumentException('Card does not exists: ' . $id);
961
+        }
962
+
963
+        return $uri['uri'];
964
+    }
965
+
966
+    /**
967
+     * return contact with the given URI
968
+     *
969
+     * @param int $addressBookId
970
+     * @param string $uri
971
+     * @returns array
972
+     */
973
+    public function getContact($addressBookId, $uri) {
974
+        $result = [];
975
+        $query = $this->db->getQueryBuilder();
976
+        $query->select('*')->from($this->dbCardsTable)
977
+                ->where($query->expr()->eq('uri', $query->createNamedParameter($uri)))
978
+                ->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)));
979
+        $queryResult = $query->execute();
980
+        $contact = $queryResult->fetch();
981
+        $queryResult->closeCursor();
982
+
983
+        if (is_array($contact)) {
984
+            $result = $contact;
985
+        }
986
+
987
+        return $result;
988
+    }
989
+
990
+    /**
991
+     * Returns the list of people whom this address book is shared with.
992
+     *
993
+     * Every element in this array should have the following properties:
994
+     *   * href - Often a mailto: address
995
+     *   * commonName - Optional, for example a first + last name
996
+     *   * status - See the Sabre\CalDAV\SharingPlugin::STATUS_ constants.
997
+     *   * readOnly - boolean
998
+     *   * summary - Optional, a description for the share
999
+     *
1000
+     * @return array
1001
+     */
1002
+    public function getShares($addressBookId) {
1003
+        return $this->sharingBackend->getShares($addressBookId);
1004
+    }
1005
+
1006
+    /**
1007
+     * update properties table
1008
+     *
1009
+     * @param int $addressBookId
1010
+     * @param string $cardUri
1011
+     * @param string $vCardSerialized
1012
+     */
1013
+    protected function updateProperties($addressBookId, $cardUri, $vCardSerialized) {
1014
+        $cardId = $this->getCardId($addressBookId, $cardUri);
1015
+        $vCard = $this->readCard($vCardSerialized);
1016
+
1017
+        $this->purgeProperties($addressBookId, $cardId);
1018
+
1019
+        $query = $this->db->getQueryBuilder();
1020
+        $query->insert($this->dbCardsPropertiesTable)
1021
+            ->values(
1022
+                [
1023
+                    'addressbookid' => $query->createNamedParameter($addressBookId),
1024
+                    'cardid' => $query->createNamedParameter($cardId),
1025
+                    'name' => $query->createParameter('name'),
1026
+                    'value' => $query->createParameter('value'),
1027
+                    'preferred' => $query->createParameter('preferred')
1028
+                ]
1029
+            );
1030
+
1031
+        foreach ($vCard->children() as $property) {
1032
+            if(!in_array($property->name, self::$indexProperties)) {
1033
+                continue;
1034
+            }
1035
+            $preferred = 0;
1036
+            foreach($property->parameters as $parameter) {
1037
+                if ($parameter->name === 'TYPE' && strtoupper($parameter->getValue()) === 'PREF') {
1038
+                    $preferred = 1;
1039
+                    break;
1040
+                }
1041
+            }
1042
+            $query->setParameter('name', $property->name);
1043
+            $query->setParameter('value', substr($property->getValue(), 0, 254));
1044
+            $query->setParameter('preferred', $preferred);
1045
+            $query->execute();
1046
+        }
1047
+    }
1048
+
1049
+    /**
1050
+     * read vCard data into a vCard object
1051
+     *
1052
+     * @param string $cardData
1053
+     * @return VCard
1054
+     */
1055
+    protected function readCard($cardData) {
1056
+        return  Reader::read($cardData);
1057
+    }
1058
+
1059
+    /**
1060
+     * delete all properties from a given card
1061
+     *
1062
+     * @param int $addressBookId
1063
+     * @param int $cardId
1064
+     */
1065
+    protected function purgeProperties($addressBookId, $cardId) {
1066
+        $query = $this->db->getQueryBuilder();
1067
+        $query->delete($this->dbCardsPropertiesTable)
1068
+            ->where($query->expr()->eq('cardid', $query->createNamedParameter($cardId)))
1069
+            ->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)));
1070
+        $query->execute();
1071
+    }
1072
+
1073
+    /**
1074
+     * get ID from a given contact
1075
+     *
1076
+     * @param int $addressBookId
1077
+     * @param string $uri
1078
+     * @return int
1079
+     */
1080
+    protected function getCardId($addressBookId, $uri) {
1081
+        $query = $this->db->getQueryBuilder();
1082
+        $query->select('id')->from($this->dbCardsTable)
1083
+            ->where($query->expr()->eq('uri', $query->createNamedParameter($uri)))
1084
+            ->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)));
1085
+
1086
+        $result = $query->execute();
1087
+        $cardIds = $result->fetch();
1088
+        $result->closeCursor();
1089
+
1090
+        if (!isset($cardIds['id'])) {
1091
+            throw new \InvalidArgumentException('Card does not exists: ' . $uri);
1092
+        }
1093
+
1094
+        return (int)$cardIds['id'];
1095
+    }
1096
+
1097
+    /**
1098
+     * For shared address books the sharee is set in the ACL of the address book
1099
+     * @param $addressBookId
1100
+     * @param $acl
1101
+     * @return array
1102
+     */
1103
+    public function applyShareAcl($addressBookId, $acl) {
1104
+        return $this->sharingBackend->applyShareAcl($addressBookId, $acl);
1105
+    }
1106
+
1107
+    private function convertPrincipal($principalUri, $toV2) {
1108
+        if ($this->principalBackend->getPrincipalPrefix() === 'principals') {
1109
+            list(, $name) = \Sabre\Uri\split($principalUri);
1110
+            if ($toV2 === true) {
1111
+                return "principals/users/$name";
1112
+            }
1113
+            return "principals/$name";
1114
+        }
1115
+        return $principalUri;
1116
+    }
1117
+
1118
+    private function addOwnerPrincipal(&$addressbookInfo) {
1119
+        $ownerPrincipalKey = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal';
1120
+        $displaynameKey = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD . '}owner-displayname';
1121
+        if (isset($addressbookInfo[$ownerPrincipalKey])) {
1122
+            $uri = $addressbookInfo[$ownerPrincipalKey];
1123
+        } else {
1124
+            $uri = $addressbookInfo['principaluri'];
1125
+        }
1126
+
1127
+        $principalInformation = $this->principalBackend->getPrincipalByPath($uri);
1128
+        if (isset($principalInformation['{DAV:}displayname'])) {
1129
+            $addressbookInfo[$displaynameKey] = $principalInformation['{DAV:}displayname'];
1130
+        }
1131
+    }
1132
+
1133
+    /**
1134
+     * Extract UID from vcard
1135
+     *
1136
+     * @param string $cardData the vcard raw data
1137
+     * @return string the uid
1138
+     * @throws BadRequest if no UID is available
1139
+     */
1140
+    private function getUID($cardData) {
1141
+        if ($cardData != '') {
1142
+            $vCard = Reader::read($cardData);
1143
+            if ($vCard->UID) {
1144
+                $uid = $vCard->UID->getValue();
1145
+                return $uid;
1146
+            }
1147
+            // should already be handled, but just in case
1148
+            throw new BadRequest('vCards on CardDAV servers MUST have a UID property');
1149
+        }
1150
+        // should already be handled, but just in case
1151
+        throw new BadRequest('vCard can not be empty');
1152
+    }
1153 1153
 }
Please login to merge, or discard this patch.
apps/dav/lib/Migration/Version1008Date20181030113700.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -36,17 +36,17 @@
 block discarded – undo
36 36
  * Class Version15000Date20180927120000
37 37
  */
38 38
 class Version1008Date20181030113700 extends SimpleMigrationStep {
39
-	public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
39
+    public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
40 40
 
41
-		/** @var ISchemaWrapper $schema */
42
-		$schema = $schemaClosure();
41
+        /** @var ISchemaWrapper $schema */
42
+        $schema = $schemaClosure();
43 43
 
44
-		$table = $schema->getTable('cards');
45
-		$table->addColumn('uid', Type::STRING, [
46
-			'notnull' => false,
47
-			'length' => 255
48
-		]);
44
+        $table = $schema->getTable('cards');
45
+        $table->addColumn('uid', Type::STRING, [
46
+            'notnull' => false,
47
+            'length' => 255
48
+        ]);
49 49
 
50
-		return $schema;
51
-	}
50
+        return $schema;
51
+    }
52 52
 }
Please login to merge, or discard this patch.
lib/private/Repair.php 1 patch
Indentation   +167 added lines, -167 removed lines patch added patch discarded remove patch
@@ -57,171 +57,171 @@
 block discarded – undo
57 57
 use Symfony\Component\EventDispatcher\GenericEvent;
58 58
 
59 59
 class Repair implements IOutput{
60
-	/* @var IRepairStep[] */
61
-	private $repairSteps;
62
-	/** @var EventDispatcher */
63
-	private $dispatcher;
64
-	/** @var string */
65
-	private $currentStep;
66
-
67
-	/**
68
-	 * Creates a new repair step runner
69
-	 *
70
-	 * @param IRepairStep[] $repairSteps array of RepairStep instances
71
-	 * @param EventDispatcher $dispatcher
72
-	 */
73
-	public function __construct($repairSteps = [], EventDispatcher $dispatcher = null) {
74
-		$this->repairSteps = $repairSteps;
75
-		$this->dispatcher = $dispatcher;
76
-	}
77
-
78
-	/**
79
-	 * Run a series of repair steps for common problems
80
-	 */
81
-	public function run() {
82
-		if (count($this->repairSteps) === 0) {
83
-			$this->emit('\OC\Repair', 'info', array('No repair steps available'));
84
-			return;
85
-		}
86
-		// run each repair step
87
-		foreach ($this->repairSteps as $step) {
88
-			$this->currentStep = $step->getName();
89
-			$this->emit('\OC\Repair', 'step', [$this->currentStep]);
90
-			$step->run($this);
91
-		}
92
-	}
93
-
94
-	/**
95
-	 * Add repair step
96
-	 *
97
-	 * @param IRepairStep|string $repairStep repair step
98
-	 * @throws \Exception
99
-	 */
100
-	public function addStep($repairStep) {
101
-		if (is_string($repairStep)) {
102
-			try {
103
-				$s = \OC::$server->query($repairStep);
104
-			} catch (QueryException $e) {
105
-				if (class_exists($repairStep)) {
106
-					$s = new $repairStep();
107
-				} else {
108
-					throw new \Exception("Repair step '$repairStep' is unknown");
109
-				}
110
-			}
111
-
112
-			if ($s instanceof IRepairStep) {
113
-				$this->repairSteps[] = $s;
114
-			} else {
115
-				throw new \Exception("Repair step '$repairStep' is not of type \\OCP\\Migration\\IRepairStep");
116
-			}
117
-		} else {
118
-			$this->repairSteps[] = $repairStep;
119
-		}
120
-	}
121
-
122
-	/**
123
-	 * Returns the default repair steps to be run on the
124
-	 * command line or after an upgrade.
125
-	 *
126
-	 * @return IRepairStep[]
127
-	 */
128
-	public static function getRepairSteps() {
129
-		return [
130
-			new Collation(\OC::$server->getConfig(), \OC::$server->getLogger(), \OC::$server->getDatabaseConnection(), false),
131
-			new RepairMimeTypes(\OC::$server->getConfig()),
132
-			new CleanTags(\OC::$server->getDatabaseConnection(), \OC::$server->getUserManager()),
133
-			new RepairInvalidShares(\OC::$server->getConfig(), \OC::$server->getDatabaseConnection()),
134
-			new RemoveRootShares(\OC::$server->getDatabaseConnection(), \OC::$server->getUserManager(), \OC::$server->getLazyRootFolder()),
135
-			new MoveUpdaterStepFile(\OC::$server->getConfig()),
136
-			new FixMountStorages(\OC::$server->getDatabaseConnection()),
137
-			new RepairInvalidPaths(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig()),
138
-			new AddLogRotateJob(\OC::$server->getJobList()),
139
-			new ClearFrontendCaches(\OC::$server->getMemCacheFactory(), \OC::$server->query(SCSSCacher::class), \OC::$server->query(JSCombiner::class)),
140
-			new AddPreviewBackgroundCleanupJob(\OC::$server->getJobList()),
141
-			new AddCleanupUpdaterBackupsJob(\OC::$server->getJobList()),
142
-			new RepairPendingCronJobs(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig()),
143
-			new SetVcardDatabaseUID(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig()),
144
-		];
145
-	}
146
-
147
-	/**
148
-	 * Returns expensive repair steps to be run on the
149
-	 * command line with a special option.
150
-	 *
151
-	 * @return IRepairStep[]
152
-	 */
153
-	public static function getExpensiveRepairSteps() {
154
-		return [
155
-			new OldGroupMembershipShares(\OC::$server->getDatabaseConnection(), \OC::$server->getGroupManager()),
156
-		];
157
-	}
158
-
159
-	/**
160
-	 * Returns the repair steps to be run before an
161
-	 * upgrade.
162
-	 *
163
-	 * @return IRepairStep[]
164
-	 */
165
-	public static function getBeforeUpgradeRepairSteps() {
166
-		$connection = \OC::$server->getDatabaseConnection();
167
-		$config = \OC::$server->getConfig();
168
-		$steps = [
169
-			new Collation(\OC::$server->getConfig(), \OC::$server->getLogger(), $connection, true),
170
-			new SqliteAutoincrement($connection),
171
-			new SaveAccountsTableData($connection, $config),
172
-			new DropAccountTermsTable($connection),
173
-		];
174
-
175
-		return $steps;
176
-	}
177
-
178
-	/**
179
-	 * @param string $scope
180
-	 * @param string $method
181
-	 * @param array $arguments
182
-	 */
183
-	public function emit($scope, $method, array $arguments = []) {
184
-		if (!is_null($this->dispatcher)) {
185
-			$this->dispatcher->dispatch("$scope::$method",
186
-				new GenericEvent("$scope::$method", $arguments));
187
-		}
188
-	}
189
-
190
-	public function info($string) {
191
-		// for now just emit as we did in the past
192
-		$this->emit('\OC\Repair', 'info', array($string));
193
-	}
194
-
195
-	/**
196
-	 * @param string $message
197
-	 */
198
-	public function warning($message) {
199
-		// for now just emit as we did in the past
200
-		$this->emit('\OC\Repair', 'warning', [$message]);
201
-	}
202
-
203
-	/**
204
-	 * @param int $max
205
-	 */
206
-	public function startProgress($max = 0) {
207
-		// for now just emit as we did in the past
208
-		$this->emit('\OC\Repair', 'startProgress', [$max, $this->currentStep]);
209
-	}
210
-
211
-	/**
212
-	 * @param int $step
213
-	 * @param string $description
214
-	 */
215
-	public function advance($step = 1, $description = '') {
216
-		// for now just emit as we did in the past
217
-		$this->emit('\OC\Repair', 'advance', [$step, $description]);
218
-	}
219
-
220
-	/**
221
-	 * @param int $max
222
-	 */
223
-	public function finishProgress() {
224
-		// for now just emit as we did in the past
225
-		$this->emit('\OC\Repair', 'finishProgress', []);
226
-	}
60
+    /* @var IRepairStep[] */
61
+    private $repairSteps;
62
+    /** @var EventDispatcher */
63
+    private $dispatcher;
64
+    /** @var string */
65
+    private $currentStep;
66
+
67
+    /**
68
+     * Creates a new repair step runner
69
+     *
70
+     * @param IRepairStep[] $repairSteps array of RepairStep instances
71
+     * @param EventDispatcher $dispatcher
72
+     */
73
+    public function __construct($repairSteps = [], EventDispatcher $dispatcher = null) {
74
+        $this->repairSteps = $repairSteps;
75
+        $this->dispatcher = $dispatcher;
76
+    }
77
+
78
+    /**
79
+     * Run a series of repair steps for common problems
80
+     */
81
+    public function run() {
82
+        if (count($this->repairSteps) === 0) {
83
+            $this->emit('\OC\Repair', 'info', array('No repair steps available'));
84
+            return;
85
+        }
86
+        // run each repair step
87
+        foreach ($this->repairSteps as $step) {
88
+            $this->currentStep = $step->getName();
89
+            $this->emit('\OC\Repair', 'step', [$this->currentStep]);
90
+            $step->run($this);
91
+        }
92
+    }
93
+
94
+    /**
95
+     * Add repair step
96
+     *
97
+     * @param IRepairStep|string $repairStep repair step
98
+     * @throws \Exception
99
+     */
100
+    public function addStep($repairStep) {
101
+        if (is_string($repairStep)) {
102
+            try {
103
+                $s = \OC::$server->query($repairStep);
104
+            } catch (QueryException $e) {
105
+                if (class_exists($repairStep)) {
106
+                    $s = new $repairStep();
107
+                } else {
108
+                    throw new \Exception("Repair step '$repairStep' is unknown");
109
+                }
110
+            }
111
+
112
+            if ($s instanceof IRepairStep) {
113
+                $this->repairSteps[] = $s;
114
+            } else {
115
+                throw new \Exception("Repair step '$repairStep' is not of type \\OCP\\Migration\\IRepairStep");
116
+            }
117
+        } else {
118
+            $this->repairSteps[] = $repairStep;
119
+        }
120
+    }
121
+
122
+    /**
123
+     * Returns the default repair steps to be run on the
124
+     * command line or after an upgrade.
125
+     *
126
+     * @return IRepairStep[]
127
+     */
128
+    public static function getRepairSteps() {
129
+        return [
130
+            new Collation(\OC::$server->getConfig(), \OC::$server->getLogger(), \OC::$server->getDatabaseConnection(), false),
131
+            new RepairMimeTypes(\OC::$server->getConfig()),
132
+            new CleanTags(\OC::$server->getDatabaseConnection(), \OC::$server->getUserManager()),
133
+            new RepairInvalidShares(\OC::$server->getConfig(), \OC::$server->getDatabaseConnection()),
134
+            new RemoveRootShares(\OC::$server->getDatabaseConnection(), \OC::$server->getUserManager(), \OC::$server->getLazyRootFolder()),
135
+            new MoveUpdaterStepFile(\OC::$server->getConfig()),
136
+            new FixMountStorages(\OC::$server->getDatabaseConnection()),
137
+            new RepairInvalidPaths(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig()),
138
+            new AddLogRotateJob(\OC::$server->getJobList()),
139
+            new ClearFrontendCaches(\OC::$server->getMemCacheFactory(), \OC::$server->query(SCSSCacher::class), \OC::$server->query(JSCombiner::class)),
140
+            new AddPreviewBackgroundCleanupJob(\OC::$server->getJobList()),
141
+            new AddCleanupUpdaterBackupsJob(\OC::$server->getJobList()),
142
+            new RepairPendingCronJobs(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig()),
143
+            new SetVcardDatabaseUID(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig()),
144
+        ];
145
+    }
146
+
147
+    /**
148
+     * Returns expensive repair steps to be run on the
149
+     * command line with a special option.
150
+     *
151
+     * @return IRepairStep[]
152
+     */
153
+    public static function getExpensiveRepairSteps() {
154
+        return [
155
+            new OldGroupMembershipShares(\OC::$server->getDatabaseConnection(), \OC::$server->getGroupManager()),
156
+        ];
157
+    }
158
+
159
+    /**
160
+     * Returns the repair steps to be run before an
161
+     * upgrade.
162
+     *
163
+     * @return IRepairStep[]
164
+     */
165
+    public static function getBeforeUpgradeRepairSteps() {
166
+        $connection = \OC::$server->getDatabaseConnection();
167
+        $config = \OC::$server->getConfig();
168
+        $steps = [
169
+            new Collation(\OC::$server->getConfig(), \OC::$server->getLogger(), $connection, true),
170
+            new SqliteAutoincrement($connection),
171
+            new SaveAccountsTableData($connection, $config),
172
+            new DropAccountTermsTable($connection),
173
+        ];
174
+
175
+        return $steps;
176
+    }
177
+
178
+    /**
179
+     * @param string $scope
180
+     * @param string $method
181
+     * @param array $arguments
182
+     */
183
+    public function emit($scope, $method, array $arguments = []) {
184
+        if (!is_null($this->dispatcher)) {
185
+            $this->dispatcher->dispatch("$scope::$method",
186
+                new GenericEvent("$scope::$method", $arguments));
187
+        }
188
+    }
189
+
190
+    public function info($string) {
191
+        // for now just emit as we did in the past
192
+        $this->emit('\OC\Repair', 'info', array($string));
193
+    }
194
+
195
+    /**
196
+     * @param string $message
197
+     */
198
+    public function warning($message) {
199
+        // for now just emit as we did in the past
200
+        $this->emit('\OC\Repair', 'warning', [$message]);
201
+    }
202
+
203
+    /**
204
+     * @param int $max
205
+     */
206
+    public function startProgress($max = 0) {
207
+        // for now just emit as we did in the past
208
+        $this->emit('\OC\Repair', 'startProgress', [$max, $this->currentStep]);
209
+    }
210
+
211
+    /**
212
+     * @param int $step
213
+     * @param string $description
214
+     */
215
+    public function advance($step = 1, $description = '') {
216
+        // for now just emit as we did in the past
217
+        $this->emit('\OC\Repair', 'advance', [$step, $description]);
218
+    }
219
+
220
+    /**
221
+     * @param int $max
222
+     */
223
+    public function finishProgress() {
224
+        // for now just emit as we did in the past
225
+        $this->emit('\OC\Repair', 'finishProgress', []);
226
+    }
227 227
 }
Please login to merge, or discard this patch.
lib/private/Repair/NC15/SetVcardDatabaseUID.php 2 patches
Indentation   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -30,108 +30,108 @@
 block discarded – undo
30 30
 use Sabre\VObject\Reader;
31 31
 
32 32
 class SetVcardDatabaseUID implements IRepairStep {
33
-	const MAX_ROWS = 1000;
34
-
35
-	/** @var IDBConnection */
36
-	private $connection;
37
-
38
-	/** @var IConfig */
39
-	private $config;
40
-
41
-	private $updateQuery;
42
-
43
-	public function __construct(IDBConnection $connection, IConfig $config) {
44
-		$this->connection = $connection;
45
-		$this->config     = $config;
46
-	}
47
-
48
-	public function getName() {
49
-		return 'Extract the vcard uid and store it in the db';
50
-	}
51
-
52
-	/**
53
-	 * @return \Generator
54
-	 * @suppress SqlInjectionChecker
55
-	 */
56
-	private function getInvalidEntries() {
57
-		$builder = $this->connection->getQueryBuilder();
58
-
59
-		$builder->select('id', 'carddata')
60
-		        ->from('cards')
61
-		        ->where($builder->expr()->isNull('uid'))
62
-		        ->setMaxResults(self::MAX_ROWS);
63
-
64
-		do {
65
-			$result = $builder->execute();
66
-			$rows   = $result->fetchAll();
67
-			foreach ($rows as $row) {
68
-				yield $row;
69
-			}
70
-			$result->closeCursor();
71
-		} while (count($rows) > 0);
72
-	}
73
-
74
-	/**
75
-	 * Extract UID from vcard
76
-	 *
77
-	 * @param string $cardData the vcard raw data
78
-	 * @return string the uid or empty if none
79
-	 */
80
-	private function getUID(string $cardData): string {
81
-		$vCard = Reader::read($cardData);
82
-		if ($vCard->UID) {
83
-			$uid = $vCard->UID->getValue();
84
-			return $uid;
85
-		}
86
-
87
-		return '';
88
-	}
89
-
90
-	/**
91
-	 * @param int $id
92
-	 * @param string $uid
93
-	 */
94
-	private function update(int $id, string $uid) {
95
-		if (!$this->updateQuery) {
96
-			$builder = $this->connection->getQueryBuilder();
97
-
98
-			$this->updateQuery = $builder->update('cards')
99
-			                             ->set('uid', $builder->createParameter('uid'))
100
-			                             ->where($builder->expr()->eq('id', $builder->createParameter('id')));
101
-		}
102
-
103
-		$this->updateQuery->setParameter('id', $id);
104
-		$this->updateQuery->setParameter('uid', $uid);
105
-
106
-		$this->updateQuery->execute();
107
-	}
108
-
109
-	private function repair(): int {
110
-		$this->connection->beginTransaction();
111
-		$entries = $this->getInvalidEntries();
112
-		$count   = 0;
113
-		foreach ($entries as $entry) {
114
-			$count++;
115
-			$uid = $this->getUID($entry['carddata']);
116
-			$this->update($entry['id'], $uid);
117
-		}
118
-		$this->connection->commit();
119
-
120
-		return $count;
121
-	}
122
-
123
-	private function shouldRun() {
124
-		$versionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0.0');
125
-
126
-		// was added to 15.0.0.2
127
-		return version_compare($versionFromBeforeUpdate, '15.0.0.2', '<=');
128
-	}
129
-
130
-	public function run(IOutput $output) {
131
-		if ($this->shouldRun()) {
132
-			$count = $this->repair();
133
-
134
-			$output->info('Fixed ' . $count . ' vcards');
135
-		}
136
-	}
33
+    const MAX_ROWS = 1000;
34
+
35
+    /** @var IDBConnection */
36
+    private $connection;
37
+
38
+    /** @var IConfig */
39
+    private $config;
40
+
41
+    private $updateQuery;
42
+
43
+    public function __construct(IDBConnection $connection, IConfig $config) {
44
+        $this->connection = $connection;
45
+        $this->config     = $config;
46
+    }
47
+
48
+    public function getName() {
49
+        return 'Extract the vcard uid and store it in the db';
50
+    }
51
+
52
+    /**
53
+     * @return \Generator
54
+     * @suppress SqlInjectionChecker
55
+     */
56
+    private function getInvalidEntries() {
57
+        $builder = $this->connection->getQueryBuilder();
58
+
59
+        $builder->select('id', 'carddata')
60
+                ->from('cards')
61
+                ->where($builder->expr()->isNull('uid'))
62
+                ->setMaxResults(self::MAX_ROWS);
63
+
64
+        do {
65
+            $result = $builder->execute();
66
+            $rows   = $result->fetchAll();
67
+            foreach ($rows as $row) {
68
+                yield $row;
69
+            }
70
+            $result->closeCursor();
71
+        } while (count($rows) > 0);
72
+    }
73
+
74
+    /**
75
+     * Extract UID from vcard
76
+     *
77
+     * @param string $cardData the vcard raw data
78
+     * @return string the uid or empty if none
79
+     */
80
+    private function getUID(string $cardData): string {
81
+        $vCard = Reader::read($cardData);
82
+        if ($vCard->UID) {
83
+            $uid = $vCard->UID->getValue();
84
+            return $uid;
85
+        }
86
+
87
+        return '';
88
+    }
89
+
90
+    /**
91
+     * @param int $id
92
+     * @param string $uid
93
+     */
94
+    private function update(int $id, string $uid) {
95
+        if (!$this->updateQuery) {
96
+            $builder = $this->connection->getQueryBuilder();
97
+
98
+            $this->updateQuery = $builder->update('cards')
99
+                                            ->set('uid', $builder->createParameter('uid'))
100
+                                            ->where($builder->expr()->eq('id', $builder->createParameter('id')));
101
+        }
102
+
103
+        $this->updateQuery->setParameter('id', $id);
104
+        $this->updateQuery->setParameter('uid', $uid);
105
+
106
+        $this->updateQuery->execute();
107
+    }
108
+
109
+    private function repair(): int {
110
+        $this->connection->beginTransaction();
111
+        $entries = $this->getInvalidEntries();
112
+        $count   = 0;
113
+        foreach ($entries as $entry) {
114
+            $count++;
115
+            $uid = $this->getUID($entry['carddata']);
116
+            $this->update($entry['id'], $uid);
117
+        }
118
+        $this->connection->commit();
119
+
120
+        return $count;
121
+    }
122
+
123
+    private function shouldRun() {
124
+        $versionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0.0');
125
+
126
+        // was added to 15.0.0.2
127
+        return version_compare($versionFromBeforeUpdate, '15.0.0.2', '<=');
128
+    }
129
+
130
+    public function run(IOutput $output) {
131
+        if ($this->shouldRun()) {
132
+            $count = $this->repair();
133
+
134
+            $output->info('Fixed ' . $count . ' vcards');
135
+        }
136
+    }
137 137
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@
 block discarded – undo
131 131
 		if ($this->shouldRun()) {
132 132
 			$count = $this->repair();
133 133
 
134
-			$output->info('Fixed ' . $count . ' vcards');
134
+			$output->info('Fixed '.$count.' vcards');
135 135
 		}
136 136
 	}
137 137
 }
Please login to merge, or discard this patch.