ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
ILIAS\WebDAV\Entrypoint Class Reference
+ Inheritance diagram for ILIAS\WebDAV\Entrypoint:
+ Collaboration diagram for ILIAS\WebDAV\Entrypoint:

Public Member Functions

 __construct (private Factory $factory, private RequestTranslation $request_translation, private SecretKeyRotation $secret_key_rotation, private Config $config)
 
 getName ()
 
 enter ()
 Pass program execution to this entry point. More...
 
 getName ()
 
 enter ()
 Pass program execution to this entry point. More...
 

Protected Member Functions

 handleMountInstruction (\ilDBInterface $database, ServerRequestInterface $request, \ilObjUser $current_user, \ilLanguage $language, UIServices $ui, GlobalHttpState $http)
 

Detailed Description

Definition at line 43 of file Entrypoint.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\WebDAV\Entrypoint::__construct ( private Factory  $factory,
private RequestTranslation  $request_translation,
private SecretKeyRotation  $secret_key_rotation,
private Config  $config 
)

Definition at line 45 of file Entrypoint.php.

50 {
51 }

Member Function Documentation

◆ enter()

ILIAS\WebDAV\Entrypoint::enter ( )

Pass program execution to this entry point.

Returns
int 0 if everthing went fine, or an error-code.

Implements ILIAS\Component\EntryPoint.

Definition at line 58 of file Entrypoint.php.

58 : int
59 {
60 entry_point('ILIAS Legacy Initialisation Adapter');
61
62 global $DIC; // TODO remove Service Locator
63
64 $logger = $DIC->logger()->webdav();
65 $current_user = $DIC->user();
66 $auth_session = $DIC['ilAuthSession'];
67 $filesystem = $DIC->filesystem()->temp();
68 $database = $DIC->database();
69 $request = $DIC->http()->request();
70 $language = $DIC->language();
71 $ui = $DIC->ui();
72 $http = $DIC->http();
73
74 $this->request_translation->setup();
75
76 if(!$this->config->isActive()) {
77 return 0;
78 }
79
80 if ($this->request_translation->showMountPoint()) {
82 $database,
83 $request,
84 $current_user,
85 $language,
86 $ui,
87 $http
88 );
89
90 return 0;
91 }
92
93 $server = new Server(
94 $this->factory->getMountPoint(),
95 );
96
97 $server->setBaseUri($this->request_translation->getBasePath());
98
99 $server->addPlugin(
100 new BasicAuthentication(
101 $this->secret_key_rotation,
102 $logger,
103 $current_user,
104 $auth_session,
105 $filesystem,
106 )
107 );
108
109 $server->addPlugin(
110 new GeneralLock(
111 $this->factory,
112 new LocksRepositoryDB(
113 $database
114 )
115 )
116 );
117
118 $server->addPlugin(
119 new TemporaryFileFilterPlugin(sys_get_temp_dir())
120 );
121
122 if ($this->config->enableDebugging()) {
123 $server->addPlugin(
124 new Plugin(true)
125 );
126 }
127
128 $server->addPlugin(
129 new Log(
130 $this->config->enableDebugging()
131 )
132 );
133
134 $server->start();
135
136 $this->request_translation->close();
137
138 return 0;
139 }
factory()
handleMountInstruction(\ilDBInterface $database, ServerRequestInterface $request, \ilObjUser $current_user, \ilLanguage $language, UIServices $ui, GlobalHttpState $http)
Definition: Entrypoint.php:141
$http
Definition: deliver.php:30
entry_point(string $name)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: result1.php:21
global $DIC
Definition: shib_login.php:26
$server
Definition: shib_login.php:28

References $DIC, $http, $server, entry_point(), factory(), and ILIAS\WebDAV\Entrypoint\handleMountInstruction().

+ Here is the call graph for this function:

◆ getName()

ILIAS\WebDAV\Entrypoint::getName ( )

Implements ILIAS\Component\EntryPoint.

Definition at line 53 of file Entrypoint.php.

53 : string
54 {
55 return WebDAV::class;
56 }

◆ handleMountInstruction()

ILIAS\WebDAV\Entrypoint::handleMountInstruction ( \ilDBInterface  $database,
ServerRequestInterface  $request,
\ilObjUser  $current_user,
\ilLanguage  $language,
UIServices  $ui,
GlobalHttpState  $http 
)
protected

Definition at line 141 of file Entrypoint.php.

148 : void {
149 $repo = new RepositoryDB($database);
150 $uri_builder = new UriBuilder(
151 $request,
152 $this->config
153 );
154 $path_value = $this->request_translation->getRequestedPathAsArray()[0] ?? '';
155
156 $settings = new \ilSetting();
157 if (str_starts_with($path_value, 'ref_')) {
158 $instructions = new ObjectInstructions(
159 $repo,
160 $uri_builder,
161 $settings,
162 $current_user->getLanguage(),
163 (int) substr($path_value, 4)
164 );
165 } elseif (strlen($path_value) === 2) {
166 $instructions = new ObjectlessInstructions(
167 $repo,
168 $uri_builder,
169 $settings,
170 $path_value
171 );
172 } else {
173 throw new \InvalidArgumentException("Invalid path for mount-instructions: '$path_value'");
174 }
175
176 $gui = new InstructionsGUI(
177 $instructions,
178 $language,
179 $ui,
180 $http
181 );
182 $gui->renderMountInstructionsContent();
183 }

Referenced by ILIAS\WebDAV\Entrypoint\enter().

+ Here is the caller graph for this function:

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