3use Sabre\DAV\Exception\NotFound;
4use Sabre\DAV\Exception\BadRequest;
23 if (!isset(self::$instance)) {
24 self::$instance =
new self();
44 $a_uri = strtolower(trim($a_uri,
'/'));
51 $splitted_path = explode(
'/', $a_uri, 3);
54 if (count($splitted_path) < 2) {
55 throw new BadRequest();
58 $repository_mountpoint = $splitted_path[1];
59 $path_in_mountpoint = $splitted_path[2];
63 if ($repository_mountpoint ==
'ilias') {
64 if ($path_in_mountpoint !=
'') {
66 $searched_node = $ref_path[count($ref_path) - 1];
67 $ref_id = $searched_node[
'child'];
73 elseif (substr($splitted_path[1], 0, 4) ==
'ref_') {
76 $start_node = (int) explode(
'_', $repository_mountpoint)[1];
77 if ($path_in_mountpoint !=
'' && $start_node > 0) {
79 } elseif ($path_in_mountpoint ==
'') {
80 $ref_id = $start_node;
87 throw new BadRequest();
116 if ($path_title_array[$searched_element_index] ==
'' || count($path_title_array) == $searched_element_index) {
117 return $parent_ref_id;
121 foreach (
$DIC->repositoryTree()->getChildIds($parent_ref_id) as $child_ref) {
124 if ($path_title_array[$searched_element_index] == $child_title) {
125 if (count($path_title_array) - 1 == $searched_element_index) {
An exception for terminatinating execution or to throw for unit testing.
static _lookupTitle($a_id)
lookup object title
static _lookupObjectId($a_ref_id)
lookup object id
static iterateRecursiveThroughTree($path_title_array, $searched_element_index, $parent_ref_id)
Recursive function to iterate through tree with given path.
static getRefIdForWebDAVPath($a_uri)
Returns the ref_id of the given webdav path.
static getRefIdForGivenRootAndPath(int $start_ref, string $path_from_startnode)