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

Public Member Functions

 parseInstructionsToAssocArray (string $a_raw_mount_instructions)
 
- Public Member Functions inherited from ILIAS\WebDAV\Mount\DocumentProcessor
 processMountInstructions (string $a_raw_mount_instructions)
 

Detailed Description

Definition at line 23 of file DocumentProcessorBase.php.

Member Function Documentation

◆ parseInstructionsToAssocArray()

ILIAS\WebDAV\Mount\DocumentProcessorBase::parseInstructionsToAssocArray ( string  $a_raw_mount_instructions)

Definition at line 25 of file DocumentProcessorBase.php.

25 : array
26 {
27 $processing_text = $a_raw_mount_instructions;
28
29 $found_instructions = [];
30
31 do {
32 $pair_found = false;
33 $open_with_no_close_tag_found = false;
34
35 $open_tag_start_pos = strpos($processing_text, '[');
36 $open_tag_end_pos = strpos($processing_text, ']');
37
38 if ($open_tag_start_pos !== false && $open_tag_end_pos !== false && $open_tag_start_pos < $open_tag_end_pos) {
39 $tag_name = substr(
40 $processing_text,
41 $open_tag_start_pos + 1,
42 $open_tag_end_pos - $open_tag_start_pos - 1
43 );
44 $close_tag = "[/$tag_name]";
45
46 $close_tag_pos = strpos($processing_text, $close_tag);
47
48 if ($close_tag_pos !== false && $open_tag_end_pos < $close_tag_pos) {
49 $found_instructions[$tag_name] = substr(
50 $processing_text,
51 $open_tag_end_pos + 1,
52 $close_tag_pos - $open_tag_end_pos - 1
53 );
54
55 $processing_text = substr($processing_text, $close_tag_pos + strlen($close_tag));
56 $pair_found = true;
57 } else {
58 $processing_text = substr($processing_text, $open_tag_end_pos + 1);
59 $open_with_no_close_tag_found = true;
60 }
61 }
62 } while ($pair_found || $open_with_no_close_tag_found);
63
64 if ($found_instructions === []) {
65 return [$a_raw_mount_instructions];
66 }
67
68 return $found_instructions;
69 }

Referenced by ILIAS\WebDAV\Mount\HtmlDocumentProcessor\processMountInstructions(), and ILIAS\WebDAV\Mount\TextDocumentProcessor\processMountInstructions().

+ Here is the caller graph for this function:

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