From 0b02a6d123b2014705998c94ddf3d460948d3eac Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 10 May 2016 17:26:44 -0700 Subject: initial sabre upgrade (needs lots of work - to wit: authentication, redo the browser interface, and rework event export/import) --- vendor/sabre/dav/examples/simplefsserver.php | 123 --------------------------- 1 file changed, 123 deletions(-) delete mode 100644 vendor/sabre/dav/examples/simplefsserver.php (limited to 'vendor/sabre/dav/examples/simplefsserver.php') diff --git a/vendor/sabre/dav/examples/simplefsserver.php b/vendor/sabre/dav/examples/simplefsserver.php deleted file mode 100644 index f1b4a1100..000000000 --- a/vendor/sabre/dav/examples/simplefsserver.php +++ /dev/null @@ -1,123 +0,0 @@ -myPath = $myPath; - - } - - function getChildren() { - - $children = array(); - // Loop through the directory, and create objects for each node - foreach(scandir($this->myPath) as $node) { - - // Ignoring files staring with . - if ($node[0]==='.') continue; - - $children[] = $this->getChild($node); - - } - - return $children; - - } - - function getChild($name) { - - $path = $this->myPath . '/' . $name; - - // We have to throw a NotFound exception if the file didn't exist - if (!file\exists($this->myPath)) throw new \Sabre\DAV\Exception\NotFound('The file with name: ' . $name . ' could not be found'); - // Some added security - - if ($name[0]=='.') throw new \Sabre\DAV\Exception\Forbidden('Access denied'); - - if (is_dir($path)) { - - return new \MyCollection($name); - - } else { - - return new \MyFile($path); - - } - - } - - function getName() { - - return basename($this->myPath); - - } - -} - -class MyFile extends \Sabre\DAV\File { - - private $myPath; - - function __construct($myPath) { - - $this->myPath = $myPath; - - } - - function getName() { - - return basename($this->myPath); - - } - - function get() { - - return fopen($this->myPath,'r'); - - } - - function getSize() { - - return filesize($this->myPath); - - } - -} - -// Make sure there is a directory in your current directory named 'public'. We will be exposing that directory to WebDAV -$rootNode = new \MyCollection($publicDir); - -// The rootNode needs to be passed to the server object. -$server = new \Sabre\DAV\Server($rootNode); - -// And off we go! -$server->exec(); -- cgit v1.2.3