ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
sabredav.php
Go to the documentation of this file.
1<?php
2
3// SabreDAV test server.
4
5class CliLog {
6
7 protected $stream;
8
9 function __construct() {
10
11 $this->stream = fopen('php://stdout', 'w');
12
13 }
14
15 function log($msg) {
16 fwrite($this->stream, $msg . "\n");
17 }
18
19}
20
21$log = new CliLog();
22
23if (php_sapi_name() !== 'cli-server') {
24 die("This script is intended to run on the built-in php webserver");
25}
26
27// Finding composer
28
29
31 __DIR__ . '/../vendor/autoload.php',
32 __DIR__ . '/../../../autoload.php',
33];
34
35foreach ($paths as $path) {
36 if (file_exists($path)) {
37 include $path;
38 break;
39 }
40}
41
42use Sabre\DAV;
43
44// Root
45$root = new DAV\FS\Directory(getcwd());
46
47// Setting up server.
48$server = new DAV\Server($root);
49
50// Browser plugin
51$server->addPlugin(new DAV\Browser\Plugin());
52
53$server->exec();
$path
Definition: aliased.php:25
An exception for terminatinating execution or to throw for unit testing.
$stream
Definition: sabredav.php:7
log($msg)
Definition: sabredav.php:15
__construct()
Definition: sabredav.php:9
$log
Definition: sabredav.php:21
$root
Definition: sabredav.php:45
$server
Definition: sabredav.php:48
if(php_sapi_name() !=='cli-server') $paths
Definition: sabredav.php:30