This repository has been archived on 2024-08-19. You can view files and clone it, but cannot push or open issues or pull requests.
core/vendor/sabre/dav/bin/sabredav.php
Mario 580c3f4ffe another bulk of composer updates
(cherry picked from commit 6685381fd8db507493c3d7c1793f8c05c681bbce)
2019-11-10 14:10:03 +01:00

52 lines
817 B
PHP

<?php
// SabreDAV test server.
class CliLog
{
protected $stream;
public function __construct()
{
$this->stream = fopen('php://stdout', 'w');
}
public function log($msg)
{
fwrite($this->stream, $msg."\n");
}
}
$log = new CliLog();
if ('cli-server' !== php_sapi_name()) {
die('This script is intended to run on the built-in php webserver');
}
// Finding composer
$paths = [
__DIR__.'/../vendor/autoload.php',
__DIR__.'/../../../autoload.php',
];
foreach ($paths as $path) {
if (file_exists($path)) {
include $path;
break;
}
}
use Sabre\DAV;
// Root
$root = new DAV\FS\Directory(getcwd());
// Setting up server.
$server = new DAV\Server($root);
// Browser plugin
$server->addPlugin(new DAV\Browser\Plugin());
$server->exec();