ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilWebDAVRequestHandler Class Reference

Class ilWebDAVRequestHandler. More...

+ Collaboration diagram for ilWebDAVRequestHandler:

Public Member Functions

 handleRequest ()
 For the case there might be more to handle as just running the server. More...
 

Static Public Member Functions

static getInstance ()
 

Protected Member Functions

 runWebDAVServer ()
 Creates and runs SabreDAV Server. More...
 
 setPlugins ($server)
 Set server plugins. More...
 
 getRootDir ()
 Return the first object to mount on WebDAV. More...
 

Static Private Attributes

static $instance
 

Detailed Description

Class ilWebDAVRequestHandler.

This class handles the WebDAV requests on webdav.php. It sets up the sabreDAV server with its necessary plugins.

Author
Raphael Heer rapha.nosp@m.el.h.nosp@m.eer@h.nosp@m.slu..nosp@m.ch $Id$

Definition at line 14 of file class.ilWebDAVRequestHandler.php.

Member Function Documentation

◆ getInstance()

static ilWebDAVRequestHandler::getInstance ( )
static

Definition at line 18 of file class.ilWebDAVRequestHandler.php.

19  {
20  return self::$instance ? self::$instance : self::$instance = new ilWebDAVRequestHandler();
21  }
Class ilWebDAVRequestHandler.

◆ getRootDir()

ilWebDAVRequestHandler::getRootDir ( )
protected

Return the first object to mount on WebDAV.

Returns
ilMountPointDAV

Definition at line 76 of file class.ilWebDAVRequestHandler.php.

References $DIC.

Referenced by runWebDAVServer().

77  {
78  global $DIC;
79 
80  $repo_helper = new ilWebDAVRepositoryHelper($DIC->access(), $DIC->repositoryTree());
81  $dav_helper = new ilWebDAVObjDAVHelper($repo_helper);
82  return new ilMountPointDAV($repo_helper, $dav_helper);
83  }
Class ilMountPointDAV.
Class ilWebDAVRepositoryHelper.
Class ilWebDAVObjDAVHelper.
global $DIC
Definition: goto.php:24
+ Here is the caller graph for this function:

◆ handleRequest()

ilWebDAVRequestHandler::handleRequest ( )

For the case there might be more to handle as just running the server.

So we won't make any breaking changes

Exceptions

Definition at line 28 of file class.ilWebDAVRequestHandler.php.

References runWebDAVServer().

29  {
30  $this->runWebDAVServer();
31  }
runWebDAVServer()
Creates and runs SabreDAV Server.
+ Here is the call graph for this function:

◆ runWebDAVServer()

ilWebDAVRequestHandler::runWebDAVServer ( )
protected

Creates and runs SabreDAV Server.

Exceptions

Definition at line 38 of file class.ilWebDAVRequestHandler.php.

References $server, getRootDir(), and setPlugins().

Referenced by handleRequest().

39  {
40  $server = new Sabre\DAV\Server($this->getRootDir());
41  $this->setPlugins($server);
42  $server->start();
43  }
getRootDir()
Return the first object to mount on WebDAV.
$server
setPlugins($server)
Set server plugins.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPlugins()

ilWebDAVRequestHandler::setPlugins (   $server)
protected

Set server plugins.

Definition at line 49 of file class.ilWebDAVRequestHandler.php.

References $DIC, XapiProxy\$plugin, and $server.

Referenced by runWebDAVServer().

50  {
51  global $DIC;
52 
53  // Set authentication plugin
54  $webdav_auth = new ilWebDAVAuthentication();
55  $cal = new Sabre\DAV\Auth\Backend\BasicCallBack(array($webdav_auth, 'authenticate'));
56  $plugin = new Sabre\DAV\Auth\Plugin($cal);
57  $server->addPlugin($plugin);
58 
59  // Set Lock Plugin
60  $db_manager = new ilWebDAVDBManager($DIC->database());
61  $lock_backend = new ilWebDAVLockBackend($db_manager);
62  $lock_plugin = new Sabre\DAV\Locks\Plugin($lock_backend);
63  $server->addPlugin($lock_plugin);
64 
65  /* Set Browser Plugin
66  * This plugin is used to redirect GET-Requests from browsers on collections to the mount instruction page */
67  $browser_plugin = new ilWebDAVSabreBrowserPlugin($DIC->ctrl());
68  $server->addPlugin($browser_plugin);
69  }
Class ilWebDAVSabreBrowserPlugin.
Class ilWebDAVAuthentication.
global $DIC
Definition: goto.php:24
Class ilWebDAVLockBackend.
$server
Class ilWebDAVDBManager.
+ Here is the caller graph for this function:

Field Documentation

◆ $instance

ilWebDAVRequestHandler::$instance
staticprivate

Definition at line 16 of file class.ilWebDAVRequestHandler.php.


The documentation for this class was generated from the following file: