1 | <?php |
||
18 | class DocumentComponent extends NotFoundComponent |
||
19 | { |
||
20 | protected $documentParameterName = 'document'; |
||
21 | |||
22 | /** |
||
23 | * @param Storage $storage |
||
24 | * |
||
25 | * @return mixed|void |
||
26 | * @throws \Exception |
||
27 | */ |
||
28 | public function run(Storage $storage) |
||
40 | |||
41 | /** |
||
42 | * Checks to see if any parameters were defined in the cms and acts according |
||
43 | */ |
||
44 | private function checkParameters() |
||
50 | |||
51 | /** |
||
52 | * Run as application component |
||
53 | * |
||
54 | * @throws \Exception |
||
55 | */ |
||
56 | private function runLikeApplicationComponent() |
||
65 | |||
66 | /** |
||
67 | * Run as regular component |
||
68 | * |
||
69 | * @throws \Exception |
||
70 | */ |
||
71 | private function runLikeRegularComponent() |
||
72 | { |
||
73 | if ($this->matchedSitemapItem->regex == false || isset($this->parameters['document'])) { |
||
74 | $this->runWithoutRegex(); |
||
75 | } else { |
||
76 | $this->runWithRegex(); |
||
77 | } |
||
78 | } |
||
79 | |||
80 | /** |
||
81 | * Run without regex |
||
82 | * |
||
83 | * @throws \Exception |
||
84 | */ |
||
85 | private function runWithoutRegex() |
||
93 | |||
94 | /** |
||
95 | * Run with regex |
||
96 | * |
||
97 | * @throws \Exception |
||
98 | */ |
||
99 | private function runWithRegex() |
||
112 | |||
113 | /** |
||
114 | * Run using the given `document` parameter |
||
115 | */ |
||
116 | private function runByDocumentParameter() |
||
126 | |||
127 | /** |
||
128 | * @return mixed|string |
||
129 | */ |
||
130 | private function checkForSpecificFolder() |
||
141 | } |
||
142 | } |