ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilWebDAVMountInstructionsFactory.php
Go to the documentation of this file.
1<?php
2
10{
11 private $repo;
12 private $request;
13 private $user;
14
15 public function __construct(
17 \Psr\Http\Message\RequestInterface $a_request,
18 \ilObjUser $a_user
19 ) {
20 $this->repo = $a_repo;
21 $this->request = $a_request;
22 $this->user = $a_user;
23 }
24
26 {
27 $uri_builder = new ilWebDAVUriBuilder($this->request);
28 $uri = $this->request->getUri()->getPath();
29
30 $splitted_uri = explode('/', $uri);
31
32 // Remove path elements before and until webdav script
33 while (array_shift($splitted_uri) != 'webdav.php' && count($splitted_uri) > 0);
34
35 $path_value = $splitted_uri[1];
36
37 if (strlen($path_value) == 2) {
39 $this->repo,
40 $uri_builder,
41 new ilSetting('file_access'),
42 $path_value
43 );
44 } elseif (substr($path_value, 0, 4) == 'ref_') {
46 $this->repo,
47 $uri_builder,
48 new ilSetting('file_access'),
49 $this->user->getLanguage(),
50 (int) substr($path_value, 4)
51 );
52 } else {
53 throw new InvalidArgumentException("Invalid path given");
54 }
55 }
56}
user()
Definition: user.php:4
An exception for terminatinating execution or to throw for unit testing.
ILIAS Setting Class.
__construct(ilWebDAVMountInstructionsRepositoryImpl $a_repo, \Psr\Http\Message\RequestInterface $a_request, \ilObjUser $a_user)