ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilWebDAVMountInstructionsFactory.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
22 
28 {
31  private ilObjUser $user;
32 
33  public function __construct(
35  RequestInterface $a_request,
36  ilObjUser $a_user
37  ) {
38  $this->repo = $a_repo;
39  $this->request = $a_request;
40  $this->user = $a_user;
41  }
42 
44  {
45  $uri_builder = new ilWebDAVUriBuilder($this->request);
46  $uri = $this->request->getUri()->getPath();
47 
48  $splitted_uri = explode('/', $uri);
49 
50  // Remove path elements before and until webdav script
51  while (array_shift($splitted_uri) != 'webdav.php' && count($splitted_uri) > 0);
52 
53  $path_value = $splitted_uri[1];
54 
55  if (strlen($path_value) == 2) {
57  $this->repo,
58  $uri_builder,
59  new ilSetting(),
60  $path_value
61  );
62  }
63 
64  if (substr($path_value, 0, 4) == 'ref_') {
66  $this->repo,
67  $uri_builder,
68  new ilSetting(),
69  $this->user->getLanguage(),
70  (int) substr($path_value, 4)
71  );
72  }
73 
74  throw new InvalidArgumentException("Invalid path given");
75  }
76 }
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...
__construct(ilWebDAVMountInstructionsRepositoryImpl $a_repo, RequestInterface $a_request, ilObjUser $a_user)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilWebDAVMountInstructionsRepositoryImpl $repo
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...