aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/bin/sabredav.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-10-21 15:46:31 -0700
committerfriendica <info@friendica.com>2013-10-21 15:46:31 -0700
commitb35122f7a6ad42756c35bb60ba1f06c3dcd45c77 (patch)
treeccdf373ce6475d264778523259cc32899b732fe7 /vendor/sabre/dav/bin/sabredav.php
parente3504df514d306cfe6b83e44a11f550664564af4 (diff)
downloadvolse-hubzilla-b35122f7a6ad42756c35bb60ba1f06c3dcd45c77.tar.gz
volse-hubzilla-b35122f7a6ad42756c35bb60ba1f06c3dcd45c77.tar.bz2
volse-hubzilla-b35122f7a6ad42756c35bb60ba1f06c3dcd45c77.zip
add sabre (1.8.x) via composer in the !@#$ place it wants to be
Diffstat (limited to 'vendor/sabre/dav/bin/sabredav.php')
-rwxr-xr-xvendor/sabre/dav/bin/sabredav.php53
1 files changed, 53 insertions, 0 deletions
diff --git a/vendor/sabre/dav/bin/sabredav.php b/vendor/sabre/dav/bin/sabredav.php
new file mode 100755
index 000000000..34a674fd5
--- /dev/null
+++ b/vendor/sabre/dav/bin/sabredav.php
@@ -0,0 +1,53 @@
+<?php
+
+// SabreDAV test server.
+
+class CliLog {
+
+ protected $stream;
+
+ function __construct() {
+
+ $this->stream = fopen('php://stdout','w');
+
+ }
+
+ function log($msg) {
+ fwrite($this->stream, $msg . "\n");
+ }
+
+}
+
+$log = new CliLog();
+
+if (php_sapi_name()!=='cli-server') {
+ die("This script is intended to run on the built-in php webserver");
+}
+
+// Finding composer
+
+
+$paths = array(
+ __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();