ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 33 of file class.ilWebDAVRequestHandler.php.

Member Function Documentation

◆ getInstance()

static ilWebDAVRequestHandler::getInstance ( )
static

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

38  {
39  return self::$instance ? self::$instance : self::$instance = new ilWebDAVRequestHandler();
40  }
Class ilWebDAVRequestHandler.

◆ getRootDir()

ilWebDAVRequestHandler::getRootDir ( )
protected

Return the first object to mount on WebDAV.

Returns
ilMountPointDAV

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

References $DIC.

Referenced by runWebDAVServer().

96  {
97  global $DIC;
98 
99  $repo_helper = new ilWebDAVRepositoryHelper($DIC->access(), $DIC->repositoryTree());
100  $dav_helper = new ilWebDAVObjDAVHelper($repo_helper);
101  return new ilMountPointDAV($repo_helper, $dav_helper);
102  }
Class ilMountPointDAV.
global $DIC
Definition: saml.php:7
Class ilWebDAVRepositoryHelper.
Class ilWebDAVObjDAVHelper.
+ 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 47 of file class.ilWebDAVRequestHandler.php.

References runWebDAVServer().

48  {
49  $this->runWebDAVServer();
50  }
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 57 of file class.ilWebDAVRequestHandler.php.

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

Referenced by handleRequest().

58  {
59  $server = new Sabre\DAV\Server($this->getRootDir());
60  $this->setPlugins($server);
61  $server->exec();
62  }
$server
Definition: sabredav.php:48
getRootDir()
Return the first object to mount on WebDAV.
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 68 of file class.ilWebDAVRequestHandler.php.

References $DIC, and $server.

Referenced by runWebDAVServer().

69  {
70  global $DIC;
71 
72  // Set authentication plugin
73  $webdav_auth = new ilWebDAVAuthentication();
74  $cal = new Sabre\DAV\Auth\Backend\BasicCallBack(array($webdav_auth, 'authenticate'));
75  $plugin = new Sabre\DAV\Auth\Plugin($cal);
76  $server->addPlugin($plugin);
77 
78  // Set Lock Plugin
79  $db_manager = new ilWebDAVDBManager($DIC->database());
80  $lock_backend = new ilWebDAVLockBackend($db_manager);
81  $lock_plugin = new Sabre\DAV\Locks\Plugin($lock_backend);
82  $server->addPlugin($lock_plugin);
83 
84  /* Set Browser Plugin
85  * This plugin is used to redirect GET-Requests from browsers on collections to the mount instruction page */
86  $browser_plugin = new ilWebDAVSabreBrowserPlugin($DIC->ctrl());
87  $server->addPlugin($browser_plugin);
88  }
Class ilWebDAVSabreBrowserPlugin.
Class ilWebDAVAuthentication.
This plugin provides Authentication for a WebDAV server.
Definition: Plugin.php:25
global $DIC
Definition: saml.php:7
Extremely simply HTTP Basic auth backend.
$server
Definition: sabredav.php:48
Class ilWebDAVLockBackend.
Class ilWebDAVDBManager.
Locking plugin.
Definition: Plugin.php:23
+ Here is the caller graph for this function:

Field Documentation

◆ $instance

ilWebDAVRequestHandler::$instance
staticprivate

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


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