ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilWebDAVDIC.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
23 use Sabre\DAV\Auth\Plugin as AuthPlugin;
24 use Sabre\DAV\Locks\Plugin as LocksPlugin;
26 
27 class ilWebDAVDIC extends Container
28 {
29  public function initWithoutDIC(): void
30  {
31  global $DIC;
32  $this->init($DIC);
33  }
34 
35  public function init(ILIASContainer $DIC): void
36  {
37  $this['dav_settings'] = fn ($c): ilSetting => new ilSetting('webdav');
38 
39  $this['locks.repository'] = fn ($c): ilWebDAVLocksRepository => new ilWebDAVLocksRepository($DIC->database());
40 
41  $this['repository.helper'] = fn ($c): ilWebDAVRepositoryHelper => new ilWebDAVRepositoryHelper(
42  $DIC->access(),
43  $DIC->repositoryTree(),
44  new ilRepUtil(),
45  $c['locks.repository']
46  );
47 
48  $this['uriresolver'] = fn ($c): ilWebDAVLockUriPathResolver => new ilWebDAVLockUriPathResolver($c['repository.helper']);
49 
50  $this['davobj.factory'] = fn ($c): ilWebDAVObjFactory => new ilWebDAVObjFactory(
51  $c['repository.helper'],
52  $DIC->user(),
53  $DIC->resourceStorage(),
54  $DIC->http()->request(),
55  $DIC->language(),
56  $DIC['ilias']->getClientId(),
57  (bool) $c['dav_settings']->get('webdav_versioning_enabled', 'true')
58  );
59 
60  $this['locks.backend'] = fn ($c): ilWebDAVLocksBackend => new ilWebDAVLocksBackend(
61  $c['locks.repository'],
62  $c['repository.helper'],
63  $c['davobj.factory'],
64  $c['uriresolver'],
65  $DIC->user()
66  );
67 
68  $this['mountinstructions.repository'] = fn ($c): ilWebDAVMountInstructionsRepository => new ilWebDAVMountInstructionsRepositoryImpl($DIC->database());
69 
70  $this['mountinstructions.facory'] = fn ($c): ilWebDAVMountInstructionsFactory => new ilWebDAVMountInstructionsFactory(
71  $c['mountinstructions.repository'],
72  $DIC->http()->request(),
73  $DIC->user()
74  );
75 
76  $this['mountinstructions.gui'] = fn ($c): ilWebDAVMountInstructionsGUI => new ilWebDAVMountInstructionsGUI(
77  $c['mountinstructions.facory']->getMountInstructionsObject(),
78  $DIC->language(),
79  $DIC->ui(),
80  $DIC->http()
81  );
82 
83  $this['mountinstructions.uploadgui'] = fn ($c): ilWebDAVMountInstructionsUploadGUI => new ilWebDAVMountInstructionsUploadGUI(
84  $DIC->ui()->mainTemplate(),
85  $DIC->user(),
86  $DIC->ctrl(),
87  $DIC->language(),
88  $DIC->rbac()->system(),
89  $DIC["ilErr"],
90  $DIC->logger()->root(),
91  $DIC->toolbar(),
92  $DIC->http(),
93  $DIC->refinery(),
94  $DIC->ui(),
95  $DIC->filesystem(),
96  $DIC->upload(),
97  $c['mountinstructions.repository']
98  );
99 
100  $this['sabre.authplugin'] = function ($c) use ($DIC): AuthPlugin {
101  $webdav_auth = new ilWebDAVAuthentication($DIC->user(), $DIC['ilAuthSession']);
102  $auth_callback_class = new BasicCallBack(array($webdav_auth, 'authenticate'));
103  return new AuthPlugin($auth_callback_class);
104  };
105 
106  $this['sabre.locksplugin'] = fn ($c): LocksPlugin => new LocksPlugin($c['locks.backend']);
107 
108  $this['sabre.browserplugin'] = fn ($c): ilWebDAVSabreBrowserPlugin => new ilWebDAVSabreBrowserPlugin($DIC->ctrl(), $DIC->http()->request()->getUri());
109  }
110 
111  public function dav_settings(): ilSetting
112  {
113  return $this['dav_settings'];
114  }
115 
116  public function dav_factory(): ilWebDAVObjFactory
117  {
118  return $this['davobj.factory'];
119  }
120 
122  {
123  return $this['mountinstructions.gui'];
124  }
125 
127  {
128  return $this['mountinstructions.uploadgui'];
129  }
130 
131  public function authplugin(): AuthPlugin
132  {
133  return $this['sabre.authplugin'];
134  }
135 
137  {
138  return $this['locks.backend'];
139  }
140 
141  public function locksplugin(): LocksPlugin
142  {
143  return $this['sabre.locksplugin'];
144  }
145 
146  public function browserplugin(): LocksPlugin
147  {
148  return $this['sabre.locksplugin'];
149  }
150 }
The only purpose for this class is to redirect a browsers WebDAV-Request to the mount-instructions pa...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$c
Definition: cli.php:38
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
init(ILIASContainer $DIC)
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...