ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Plugin.php
Go to the documentation of this file.
1<?php
2
4
5use Sabre\DAV;
8
18class Plugin extends DAV\ServerPlugin {
19
25 protected $server;
26
33 function initialize(DAV\Server $server) {
34
35 $this->server = $server;
36 $this->server->on('method:GET', [$this, 'httpGet'], 90);
37
38 }
39
49
50 $queryParams = $request->getQueryParameters();
51 if (!array_key_exists('mount', $queryParams)) return;
52
53 $currentUri = $request->getAbsoluteUrl();
54
55 // Stripping off everything after the ?
56 list($currentUri) = explode('?', $currentUri);
57
58 $this->davMount($response, $currentUri);
59
60 // Returning false to break the event chain
61 return false;
62
63 }
64
73
74 $response->setStatus(200);
75 $response->setHeader('Content-Type', 'application/davmount+xml');
76 ob_start();
77 echo '<?xml version="1.0"?>', "\n";
78 echo "<dm:mount xmlns:dm=\"http://purl.org/NET/webdav/mount\">\n";
79 echo " <dm:url>", htmlspecialchars($uri, ENT_NOQUOTES, 'UTF-8'), "</dm:url>\n";
80 echo "</dm:mount>";
81 $response->setBody(ob_get_clean());
82
83 }
84
85
86}
foreach($paths as $path) $request
Definition: asyncclient.php:32
An exception for terminatinating execution or to throw for unit testing.
This plugin provides support for RFC4709: Mounting WebDAV servers.
Definition: Plugin.php:18
initialize(DAV\Server $server)
Initializes the plugin and registers event handles.
Definition: Plugin.php:33
davMount(ResponseInterface $response, $uri)
Generates the davmount response.
Definition: Plugin.php:72
httpGet(RequestInterface $request, ResponseInterface $response)
'beforeMethod' event handles.
Definition: Plugin.php:48
The baseclass for all server plugins.
Main DAV server class.
Definition: Server.php:23
The RequestInterface represents a HTTP request.
This interface represents a HTTP response.
$response