Welcome Guest, Not a member yet? Register   Sign In
Sabredav
#1

[eluser]musonic[/eluser]
Does anyone have any experience of or has successfully integrated sabredav into a codeigniter application? I'd love some pointers!!!
#2

[eluser]Unknown[/eluser]
I'm about to try this. Did you have any luck.
#3

[eluser]Matthieu Brunet[/eluser]
I'm just at the beggining, but so far, I made this working, with sabre 1.5.9, as the other versions require php 5.3 :
Donwload the SabreDAV folder into application/helper folder
Create a sabredav_helper.php
Code:
<?php
/** SabreDAV */
require_once APPPATH."/helpers/SabreDAV/lib/Sabre/autoload.php";
?>
Create a controller
Code:
<?php
class sabre extends CI_Controller {
public function __construct()
{
  parent::__construct() ;
}
public function index()
  $this->load->helper('sabredav');
  $publicDir = 'public'; // absolute path to a real folder
  $tmpDir = 'tmpdata';
  $baseUri = '/sabre/'; // url of the controller

    // next lines are just copied from the fileserver example. I don't understand all of it right now, but it works as it.
  // Create the root node
  $root = new Sabre_DAV_FS_Directory($publicDir);
  
  // The rootnode needs in turn to be passed to the server class
  $server = new Sabre_DAV_Server($root);
  
  if (isset($baseUri))
      $server->setBaseUri($baseUri);
  
  // Support for LOCK and UNLOCK
  $lockBackend = new Sabre_DAV_Locks_Backend_File($tmpDir . '/locksdb');
  $lockPlugin = new Sabre_DAV_Locks_Plugin($lockBackend);
  $server->addPlugin($lockPlugin);
  
  // Support for html frontend
  $browser = new Sabre_DAV_Browser_Plugin();
  $server->addPlugin($browser);
  
  // Automatically guess (some) contenttypes, based on extesion
  $server->addPlugin(new Sabre_DAV_Browser_GuessContentType());
  
  // Temporary file filter
  $tempFF = new Sabre_DAV_TemporaryFileFilterPlugin($tmpDir);
  $server->addPlugin($tempFF);
  
  // And off we go!
  $server->exec();
}
}




Theme © iAndrew 2016 - Forum software by © MyBB