@@ -65,235 +65,235 @@ |
||
| 65 | 65 | |
| 66 | 66 | class Server { |
| 67 | 67 | |
| 68 | - /** @var IRequest */ |
|
| 69 | - private $request; |
|
| 68 | + /** @var IRequest */ |
|
| 69 | + private $request; |
|
| 70 | 70 | |
| 71 | - /** @var string */ |
|
| 72 | - private $baseUri; |
|
| 71 | + /** @var string */ |
|
| 72 | + private $baseUri; |
|
| 73 | 73 | |
| 74 | - /** @var Connector\Sabre\Server */ |
|
| 75 | - public $server; |
|
| 74 | + /** @var Connector\Sabre\Server */ |
|
| 75 | + public $server; |
|
| 76 | 76 | |
| 77 | - public function __construct(IRequest $request, $baseUri) { |
|
| 78 | - $this->request = $request; |
|
| 79 | - $this->baseUri = $baseUri; |
|
| 80 | - $logger = \OC::$server->getLogger(); |
|
| 81 | - $dispatcher = \OC::$server->getEventDispatcher(); |
|
| 77 | + public function __construct(IRequest $request, $baseUri) { |
|
| 78 | + $this->request = $request; |
|
| 79 | + $this->baseUri = $baseUri; |
|
| 80 | + $logger = \OC::$server->getLogger(); |
|
| 81 | + $dispatcher = \OC::$server->getEventDispatcher(); |
|
| 82 | 82 | |
| 83 | - $root = new RootCollection(); |
|
| 84 | - $this->server = new \OCA\DAV\Connector\Sabre\Server(new CachingTree($root)); |
|
| 83 | + $root = new RootCollection(); |
|
| 84 | + $this->server = new \OCA\DAV\Connector\Sabre\Server(new CachingTree($root)); |
|
| 85 | 85 | |
| 86 | - // Add maintenance plugin |
|
| 87 | - $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\MaintenancePlugin(\OC::$server->getConfig())); |
|
| 86 | + // Add maintenance plugin |
|
| 87 | + $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\MaintenancePlugin(\OC::$server->getConfig())); |
|
| 88 | 88 | |
| 89 | - // Backends |
|
| 90 | - $authBackend = new Auth( |
|
| 91 | - \OC::$server->getSession(), |
|
| 92 | - \OC::$server->getUserSession(), |
|
| 93 | - \OC::$server->getRequest(), |
|
| 94 | - \OC::$server->getTwoFactorAuthManager(), |
|
| 95 | - \OC::$server->getBruteForceThrottler() |
|
| 96 | - ); |
|
| 89 | + // Backends |
|
| 90 | + $authBackend = new Auth( |
|
| 91 | + \OC::$server->getSession(), |
|
| 92 | + \OC::$server->getUserSession(), |
|
| 93 | + \OC::$server->getRequest(), |
|
| 94 | + \OC::$server->getTwoFactorAuthManager(), |
|
| 95 | + \OC::$server->getBruteForceThrottler() |
|
| 96 | + ); |
|
| 97 | 97 | |
| 98 | - // Set URL explicitly due to reverse-proxy situations |
|
| 99 | - $this->server->httpRequest->setUrl($this->request->getRequestUri()); |
|
| 100 | - $this->server->setBaseUri($this->baseUri); |
|
| 98 | + // Set URL explicitly due to reverse-proxy situations |
|
| 99 | + $this->server->httpRequest->setUrl($this->request->getRequestUri()); |
|
| 100 | + $this->server->setBaseUri($this->baseUri); |
|
| 101 | 101 | |
| 102 | - $this->server->addPlugin(new BlockLegacyClientPlugin(\OC::$server->getConfig())); |
|
| 103 | - $this->server->addPlugin(new AnonymousOptionsPlugin()); |
|
| 104 | - $authPlugin = new Plugin(); |
|
| 105 | - $authPlugin->addBackend(new PublicAuth()); |
|
| 106 | - $this->server->addPlugin($authPlugin); |
|
| 102 | + $this->server->addPlugin(new BlockLegacyClientPlugin(\OC::$server->getConfig())); |
|
| 103 | + $this->server->addPlugin(new AnonymousOptionsPlugin()); |
|
| 104 | + $authPlugin = new Plugin(); |
|
| 105 | + $authPlugin->addBackend(new PublicAuth()); |
|
| 106 | + $this->server->addPlugin($authPlugin); |
|
| 107 | 107 | |
| 108 | - // allow setup of additional auth backends |
|
| 109 | - $event = new SabrePluginEvent($this->server); |
|
| 110 | - $dispatcher->dispatch('OCA\DAV\Connector\Sabre::authInit', $event); |
|
| 108 | + // allow setup of additional auth backends |
|
| 109 | + $event = new SabrePluginEvent($this->server); |
|
| 110 | + $dispatcher->dispatch('OCA\DAV\Connector\Sabre::authInit', $event); |
|
| 111 | 111 | |
| 112 | - $bearerAuthBackend = new BearerAuth( |
|
| 113 | - \OC::$server->getUserSession(), |
|
| 114 | - \OC::$server->getSession(), |
|
| 115 | - \OC::$server->getRequest() |
|
| 116 | - ); |
|
| 117 | - $authPlugin->addBackend($bearerAuthBackend); |
|
| 118 | - // because we are throwing exceptions this plugin has to be the last one |
|
| 119 | - $authPlugin->addBackend($authBackend); |
|
| 112 | + $bearerAuthBackend = new BearerAuth( |
|
| 113 | + \OC::$server->getUserSession(), |
|
| 114 | + \OC::$server->getSession(), |
|
| 115 | + \OC::$server->getRequest() |
|
| 116 | + ); |
|
| 117 | + $authPlugin->addBackend($bearerAuthBackend); |
|
| 118 | + // because we are throwing exceptions this plugin has to be the last one |
|
| 119 | + $authPlugin->addBackend($authBackend); |
|
| 120 | 120 | |
| 121 | - // debugging |
|
| 122 | - if(\OC::$server->getConfig()->getSystemValue('debug', false)) { |
|
| 123 | - $this->server->addPlugin(new \Sabre\DAV\Browser\Plugin()); |
|
| 124 | - } else { |
|
| 125 | - $this->server->addPlugin(new DummyGetResponsePlugin()); |
|
| 126 | - } |
|
| 121 | + // debugging |
|
| 122 | + if(\OC::$server->getConfig()->getSystemValue('debug', false)) { |
|
| 123 | + $this->server->addPlugin(new \Sabre\DAV\Browser\Plugin()); |
|
| 124 | + } else { |
|
| 125 | + $this->server->addPlugin(new DummyGetResponsePlugin()); |
|
| 126 | + } |
|
| 127 | 127 | |
| 128 | - $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin('webdav', $logger)); |
|
| 129 | - $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\LockPlugin()); |
|
| 130 | - $this->server->addPlugin(new \Sabre\DAV\Sync\Plugin()); |
|
| 128 | + $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin('webdav', $logger)); |
|
| 129 | + $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\LockPlugin()); |
|
| 130 | + $this->server->addPlugin(new \Sabre\DAV\Sync\Plugin()); |
|
| 131 | 131 | |
| 132 | - // acl |
|
| 133 | - $acl = new DavAclPlugin(); |
|
| 134 | - $acl->principalCollectionSet = [ |
|
| 135 | - 'principals/users', 'principals/groups' |
|
| 136 | - ]; |
|
| 137 | - $acl->defaultUsernamePath = 'principals/users'; |
|
| 138 | - $this->server->addPlugin($acl); |
|
| 132 | + // acl |
|
| 133 | + $acl = new DavAclPlugin(); |
|
| 134 | + $acl->principalCollectionSet = [ |
|
| 135 | + 'principals/users', 'principals/groups' |
|
| 136 | + ]; |
|
| 137 | + $acl->defaultUsernamePath = 'principals/users'; |
|
| 138 | + $this->server->addPlugin($acl); |
|
| 139 | 139 | |
| 140 | - // calendar plugins |
|
| 141 | - if ($this->requestIsForSubtree(['calendars', 'public-calendars', 'principals'])) { |
|
| 142 | - $this->server->addPlugin(new \OCA\DAV\CalDAV\Plugin()); |
|
| 143 | - $this->server->addPlugin(new \Sabre\CalDAV\ICSExportPlugin()); |
|
| 144 | - $this->server->addPlugin(new \OCA\DAV\CalDAV\Schedule\Plugin()); |
|
| 145 | - if (\OC::$server->getConfig()->getAppValue('dav', 'sendInvitations', 'yes') === 'yes') { |
|
| 146 | - $this->server->addPlugin(\OC::$server->query(\OCA\DAV\CalDAV\Schedule\IMipPlugin::class)); |
|
| 147 | - } |
|
| 148 | - $this->server->addPlugin(new \Sabre\CalDAV\Subscriptions\Plugin()); |
|
| 149 | - $this->server->addPlugin(new \Sabre\CalDAV\Notifications\Plugin()); |
|
| 150 | - $this->server->addPlugin(new DAV\Sharing\Plugin($authBackend, \OC::$server->getRequest())); |
|
| 151 | - $this->server->addPlugin(new \OCA\DAV\CalDAV\Publishing\PublishPlugin( |
|
| 152 | - \OC::$server->getConfig(), |
|
| 153 | - \OC::$server->getURLGenerator() |
|
| 154 | - )); |
|
| 155 | - } |
|
| 140 | + // calendar plugins |
|
| 141 | + if ($this->requestIsForSubtree(['calendars', 'public-calendars', 'principals'])) { |
|
| 142 | + $this->server->addPlugin(new \OCA\DAV\CalDAV\Plugin()); |
|
| 143 | + $this->server->addPlugin(new \Sabre\CalDAV\ICSExportPlugin()); |
|
| 144 | + $this->server->addPlugin(new \OCA\DAV\CalDAV\Schedule\Plugin()); |
|
| 145 | + if (\OC::$server->getConfig()->getAppValue('dav', 'sendInvitations', 'yes') === 'yes') { |
|
| 146 | + $this->server->addPlugin(\OC::$server->query(\OCA\DAV\CalDAV\Schedule\IMipPlugin::class)); |
|
| 147 | + } |
|
| 148 | + $this->server->addPlugin(new \Sabre\CalDAV\Subscriptions\Plugin()); |
|
| 149 | + $this->server->addPlugin(new \Sabre\CalDAV\Notifications\Plugin()); |
|
| 150 | + $this->server->addPlugin(new DAV\Sharing\Plugin($authBackend, \OC::$server->getRequest())); |
|
| 151 | + $this->server->addPlugin(new \OCA\DAV\CalDAV\Publishing\PublishPlugin( |
|
| 152 | + \OC::$server->getConfig(), |
|
| 153 | + \OC::$server->getURLGenerator() |
|
| 154 | + )); |
|
| 155 | + } |
|
| 156 | 156 | |
| 157 | - // addressbook plugins |
|
| 158 | - if ($this->requestIsForSubtree(['addressbooks', 'principals'])) { |
|
| 159 | - $this->server->addPlugin(new DAV\Sharing\Plugin($authBackend, \OC::$server->getRequest())); |
|
| 160 | - $this->server->addPlugin(new \OCA\DAV\CardDAV\Plugin()); |
|
| 161 | - $this->server->addPlugin(new VCFExportPlugin()); |
|
| 162 | - $this->server->addPlugin(new ImageExportPlugin(new PhotoCache(\OC::$server->getAppDataDir('dav-photocache')))); |
|
| 163 | - } |
|
| 157 | + // addressbook plugins |
|
| 158 | + if ($this->requestIsForSubtree(['addressbooks', 'principals'])) { |
|
| 159 | + $this->server->addPlugin(new DAV\Sharing\Plugin($authBackend, \OC::$server->getRequest())); |
|
| 160 | + $this->server->addPlugin(new \OCA\DAV\CardDAV\Plugin()); |
|
| 161 | + $this->server->addPlugin(new VCFExportPlugin()); |
|
| 162 | + $this->server->addPlugin(new ImageExportPlugin(new PhotoCache(\OC::$server->getAppDataDir('dav-photocache')))); |
|
| 163 | + } |
|
| 164 | 164 | |
| 165 | - // system tags plugins |
|
| 166 | - $this->server->addPlugin(new SystemTagPlugin( |
|
| 167 | - \OC::$server->getSystemTagManager(), |
|
| 168 | - \OC::$server->getGroupManager(), |
|
| 169 | - \OC::$server->getUserSession() |
|
| 170 | - )); |
|
| 165 | + // system tags plugins |
|
| 166 | + $this->server->addPlugin(new SystemTagPlugin( |
|
| 167 | + \OC::$server->getSystemTagManager(), |
|
| 168 | + \OC::$server->getGroupManager(), |
|
| 169 | + \OC::$server->getUserSession() |
|
| 170 | + )); |
|
| 171 | 171 | |
| 172 | - // comments plugin |
|
| 173 | - $this->server->addPlugin(new CommentsPlugin( |
|
| 174 | - \OC::$server->getCommentsManager(), |
|
| 175 | - \OC::$server->getUserSession() |
|
| 176 | - )); |
|
| 172 | + // comments plugin |
|
| 173 | + $this->server->addPlugin(new CommentsPlugin( |
|
| 174 | + \OC::$server->getCommentsManager(), |
|
| 175 | + \OC::$server->getUserSession() |
|
| 176 | + )); |
|
| 177 | 177 | |
| 178 | - $this->server->addPlugin(new CopyEtagHeaderPlugin()); |
|
| 179 | - $this->server->addPlugin(new ChunkingPlugin()); |
|
| 178 | + $this->server->addPlugin(new CopyEtagHeaderPlugin()); |
|
| 179 | + $this->server->addPlugin(new ChunkingPlugin()); |
|
| 180 | 180 | |
| 181 | - // allow setup of additional plugins |
|
| 182 | - $dispatcher->dispatch('OCA\DAV\Connector\Sabre::addPlugin', $event); |
|
| 181 | + // allow setup of additional plugins |
|
| 182 | + $dispatcher->dispatch('OCA\DAV\Connector\Sabre::addPlugin', $event); |
|
| 183 | 183 | |
| 184 | - // Some WebDAV clients do require Class 2 WebDAV support (locking), since |
|
| 185 | - // we do not provide locking we emulate it using a fake locking plugin. |
|
| 186 | - if($request->isUserAgent([ |
|
| 187 | - '/WebDAVFS/', |
|
| 188 | - '/OneNote/', |
|
| 189 | - '/^Microsoft-WebDAV/',// Microsoft-WebDAV-MiniRedir/6.1.7601 |
|
| 190 | - ])) { |
|
| 191 | - $this->server->addPlugin(new FakeLockerPlugin()); |
|
| 192 | - } |
|
| 184 | + // Some WebDAV clients do require Class 2 WebDAV support (locking), since |
|
| 185 | + // we do not provide locking we emulate it using a fake locking plugin. |
|
| 186 | + if($request->isUserAgent([ |
|
| 187 | + '/WebDAVFS/', |
|
| 188 | + '/OneNote/', |
|
| 189 | + '/^Microsoft-WebDAV/',// Microsoft-WebDAV-MiniRedir/6.1.7601 |
|
| 190 | + ])) { |
|
| 191 | + $this->server->addPlugin(new FakeLockerPlugin()); |
|
| 192 | + } |
|
| 193 | 193 | |
| 194 | - if (BrowserErrorPagePlugin::isBrowserRequest($request)) { |
|
| 195 | - $this->server->addPlugin(new BrowserErrorPagePlugin()); |
|
| 196 | - } |
|
| 194 | + if (BrowserErrorPagePlugin::isBrowserRequest($request)) { |
|
| 195 | + $this->server->addPlugin(new BrowserErrorPagePlugin()); |
|
| 196 | + } |
|
| 197 | 197 | |
| 198 | - // wait with registering these until auth is handled and the filesystem is setup |
|
| 199 | - $this->server->on('beforeMethod', function () use ($root) { |
|
| 200 | - // custom properties plugin must be the last one |
|
| 201 | - $userSession = \OC::$server->getUserSession(); |
|
| 202 | - $user = $userSession->getUser(); |
|
| 203 | - if ($user !== null) { |
|
| 204 | - $view = \OC\Files\Filesystem::getView(); |
|
| 205 | - $this->server->addPlugin( |
|
| 206 | - new FilesPlugin( |
|
| 207 | - $this->server->tree, |
|
| 208 | - \OC::$server->getConfig(), |
|
| 209 | - $this->request, |
|
| 210 | - \OC::$server->getPreviewManager(), |
|
| 211 | - false, |
|
| 212 | - !\OC::$server->getConfig()->getSystemValue('debug', false) |
|
| 213 | - ) |
|
| 214 | - ); |
|
| 198 | + // wait with registering these until auth is handled and the filesystem is setup |
|
| 199 | + $this->server->on('beforeMethod', function () use ($root) { |
|
| 200 | + // custom properties plugin must be the last one |
|
| 201 | + $userSession = \OC::$server->getUserSession(); |
|
| 202 | + $user = $userSession->getUser(); |
|
| 203 | + if ($user !== null) { |
|
| 204 | + $view = \OC\Files\Filesystem::getView(); |
|
| 205 | + $this->server->addPlugin( |
|
| 206 | + new FilesPlugin( |
|
| 207 | + $this->server->tree, |
|
| 208 | + \OC::$server->getConfig(), |
|
| 209 | + $this->request, |
|
| 210 | + \OC::$server->getPreviewManager(), |
|
| 211 | + false, |
|
| 212 | + !\OC::$server->getConfig()->getSystemValue('debug', false) |
|
| 213 | + ) |
|
| 214 | + ); |
|
| 215 | 215 | |
| 216 | - $this->server->addPlugin( |
|
| 217 | - new \Sabre\DAV\PropertyStorage\Plugin( |
|
| 218 | - new CustomPropertiesBackend( |
|
| 219 | - $this->server->tree, |
|
| 220 | - \OC::$server->getDatabaseConnection(), |
|
| 221 | - \OC::$server->getUserSession()->getUser() |
|
| 222 | - ) |
|
| 223 | - ) |
|
| 224 | - ); |
|
| 225 | - if ($view !== null) { |
|
| 226 | - $this->server->addPlugin( |
|
| 227 | - new QuotaPlugin($view, false)); |
|
| 228 | - } |
|
| 229 | - $this->server->addPlugin( |
|
| 230 | - new TagsPlugin( |
|
| 231 | - $this->server->tree, \OC::$server->getTagManager() |
|
| 232 | - ) |
|
| 233 | - ); |
|
| 234 | - // TODO: switch to LazyUserFolder |
|
| 235 | - $userFolder = \OC::$server->getUserFolder(); |
|
| 236 | - $this->server->addPlugin(new SharesPlugin( |
|
| 237 | - $this->server->tree, |
|
| 238 | - $userSession, |
|
| 239 | - $userFolder, |
|
| 240 | - \OC::$server->getShareManager() |
|
| 241 | - )); |
|
| 242 | - $this->server->addPlugin(new CommentPropertiesPlugin( |
|
| 243 | - \OC::$server->getCommentsManager(), |
|
| 244 | - $userSession |
|
| 245 | - )); |
|
| 246 | - $this->server->addPlugin(new \OCA\DAV\CalDAV\Search\SearchPlugin()); |
|
| 247 | - if ($view !== null) { |
|
| 248 | - $this->server->addPlugin(new FilesReportPlugin( |
|
| 249 | - $this->server->tree, |
|
| 250 | - $view, |
|
| 251 | - \OC::$server->getSystemTagManager(), |
|
| 252 | - \OC::$server->getSystemTagObjectMapper(), |
|
| 253 | - \OC::$server->getTagManager(), |
|
| 254 | - $userSession, |
|
| 255 | - \OC::$server->getGroupManager(), |
|
| 256 | - $userFolder |
|
| 257 | - )); |
|
| 258 | - $this->server->addPlugin(new SearchPlugin(new \OCA\DAV\Files\FileSearchBackend( |
|
| 259 | - $this->server->tree, |
|
| 260 | - $user, |
|
| 261 | - \OC::$server->getRootFolder(), |
|
| 262 | - \OC::$server->getShareManager(), |
|
| 263 | - $view |
|
| 264 | - ))); |
|
| 265 | - } |
|
| 266 | - $this->server->addPlugin(new \OCA\DAV\CalDAV\BirthdayCalendar\EnablePlugin( |
|
| 267 | - \OC::$server->getConfig(), |
|
| 268 | - \OC::$server->query(BirthdayService::class) |
|
| 269 | - )); |
|
| 270 | - } |
|
| 216 | + $this->server->addPlugin( |
|
| 217 | + new \Sabre\DAV\PropertyStorage\Plugin( |
|
| 218 | + new CustomPropertiesBackend( |
|
| 219 | + $this->server->tree, |
|
| 220 | + \OC::$server->getDatabaseConnection(), |
|
| 221 | + \OC::$server->getUserSession()->getUser() |
|
| 222 | + ) |
|
| 223 | + ) |
|
| 224 | + ); |
|
| 225 | + if ($view !== null) { |
|
| 226 | + $this->server->addPlugin( |
|
| 227 | + new QuotaPlugin($view, false)); |
|
| 228 | + } |
|
| 229 | + $this->server->addPlugin( |
|
| 230 | + new TagsPlugin( |
|
| 231 | + $this->server->tree, \OC::$server->getTagManager() |
|
| 232 | + ) |
|
| 233 | + ); |
|
| 234 | + // TODO: switch to LazyUserFolder |
|
| 235 | + $userFolder = \OC::$server->getUserFolder(); |
|
| 236 | + $this->server->addPlugin(new SharesPlugin( |
|
| 237 | + $this->server->tree, |
|
| 238 | + $userSession, |
|
| 239 | + $userFolder, |
|
| 240 | + \OC::$server->getShareManager() |
|
| 241 | + )); |
|
| 242 | + $this->server->addPlugin(new CommentPropertiesPlugin( |
|
| 243 | + \OC::$server->getCommentsManager(), |
|
| 244 | + $userSession |
|
| 245 | + )); |
|
| 246 | + $this->server->addPlugin(new \OCA\DAV\CalDAV\Search\SearchPlugin()); |
|
| 247 | + if ($view !== null) { |
|
| 248 | + $this->server->addPlugin(new FilesReportPlugin( |
|
| 249 | + $this->server->tree, |
|
| 250 | + $view, |
|
| 251 | + \OC::$server->getSystemTagManager(), |
|
| 252 | + \OC::$server->getSystemTagObjectMapper(), |
|
| 253 | + \OC::$server->getTagManager(), |
|
| 254 | + $userSession, |
|
| 255 | + \OC::$server->getGroupManager(), |
|
| 256 | + $userFolder |
|
| 257 | + )); |
|
| 258 | + $this->server->addPlugin(new SearchPlugin(new \OCA\DAV\Files\FileSearchBackend( |
|
| 259 | + $this->server->tree, |
|
| 260 | + $user, |
|
| 261 | + \OC::$server->getRootFolder(), |
|
| 262 | + \OC::$server->getShareManager(), |
|
| 263 | + $view |
|
| 264 | + ))); |
|
| 265 | + } |
|
| 266 | + $this->server->addPlugin(new \OCA\DAV\CalDAV\BirthdayCalendar\EnablePlugin( |
|
| 267 | + \OC::$server->getConfig(), |
|
| 268 | + \OC::$server->query(BirthdayService::class) |
|
| 269 | + )); |
|
| 270 | + } |
|
| 271 | 271 | |
| 272 | - // register plugins from apps |
|
| 273 | - $pluginManager = new PluginManager( |
|
| 274 | - \OC::$server, |
|
| 275 | - \OC::$server->getAppManager() |
|
| 276 | - ); |
|
| 277 | - foreach ($pluginManager->getAppPlugins() as $appPlugin) { |
|
| 278 | - $this->server->addPlugin($appPlugin); |
|
| 279 | - } |
|
| 280 | - foreach ($pluginManager->getAppCollections() as $appCollection) { |
|
| 281 | - $root->addChild($appCollection); |
|
| 282 | - } |
|
| 283 | - }); |
|
| 284 | - } |
|
| 272 | + // register plugins from apps |
|
| 273 | + $pluginManager = new PluginManager( |
|
| 274 | + \OC::$server, |
|
| 275 | + \OC::$server->getAppManager() |
|
| 276 | + ); |
|
| 277 | + foreach ($pluginManager->getAppPlugins() as $appPlugin) { |
|
| 278 | + $this->server->addPlugin($appPlugin); |
|
| 279 | + } |
|
| 280 | + foreach ($pluginManager->getAppCollections() as $appCollection) { |
|
| 281 | + $root->addChild($appCollection); |
|
| 282 | + } |
|
| 283 | + }); |
|
| 284 | + } |
|
| 285 | 285 | |
| 286 | - public function exec() { |
|
| 287 | - $this->server->exec(); |
|
| 288 | - } |
|
| 286 | + public function exec() { |
|
| 287 | + $this->server->exec(); |
|
| 288 | + } |
|
| 289 | 289 | |
| 290 | - private function requestIsForSubtree(array $subTrees): bool { |
|
| 291 | - foreach ($subTrees as $subTree) { |
|
| 292 | - $subTree = trim($subTree, ' /'); |
|
| 293 | - if (strpos($this->server->getRequestUri(), $subTree.'/') === 0) { |
|
| 294 | - return true; |
|
| 295 | - } |
|
| 296 | - } |
|
| 297 | - return false; |
|
| 298 | - } |
|
| 290 | + private function requestIsForSubtree(array $subTrees): bool { |
|
| 291 | + foreach ($subTrees as $subTree) { |
|
| 292 | + $subTree = trim($subTree, ' /'); |
|
| 293 | + if (strpos($this->server->getRequestUri(), $subTree.'/') === 0) { |
|
| 294 | + return true; |
|
| 295 | + } |
|
| 296 | + } |
|
| 297 | + return false; |
|
| 298 | + } |
|
| 299 | 299 | } |