ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
sabredav.php
Go to the documentation of this file.
1
<?
php
2
3
// SabreDAV test server.
4
5
class
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
23
if
(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
30
$paths
= [
31
__DIR__ .
'/../vendor/autoload.php'
,
32
__DIR__ .
'/../../../autoload.php'
,
33
];
34
35
foreach
(
$paths
as
$path
) {
36
if
(file_exists($path)) {
37
include
$path
;
38
break
;
39
}
40
}
41
42
use
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();
Sabre\DAV
$path
$path
Definition:
aliased.php:25
CliLog\$stream
$stream
Definition:
sabredav.php:7
$log
$log
Definition:
sabredav.php:21
fopen
$server
$server
Definition:
sabredav.php:48
$paths
if(php_sapi_name() !=='cli-server') $paths
Definition:
sabredav.php:30
CliLog\__construct
__construct()
Definition:
sabredav.php:9
CliLog\log
log($msg)
Definition:
sabredav.php:15
CliLog
Definition:
sabredav.php:5
$root
$root
Definition:
sabredav.php:45
php
libs
composer
vendor
sabre
dav
bin
sabredav.php
Generated on Thu Jan 16 2025 19:01:49 for ILIAS by
1.8.13 (using
Doxyfile
)