ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 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.
Class ilWebDAVRepositoryHelper.
Class ilWebDAVObjDAVHelper.
$DIC
Definition: xapitoken.php:46
+ 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  }
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 68 of file class.ilWebDAVRequestHandler.php.

References $DIC, XapiProxy\$plugin, 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.
Class ilWebDAVLockBackend.
$server
$DIC
Definition: xapitoken.php:46
Class ilWebDAVDBManager.
+ 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: