1 | <?php |
||
19 | class RouteDispatcher |
||
|
|||
20 | { |
||
21 | private static $baseUrl = ''; |
||
22 | private $lastModified = []; |
||
23 | |||
24 | /** |
||
25 | * @internal |
||
26 | */ |
||
27 | private function __construct() |
||
30 | |||
31 | /** |
||
32 | * Build a controller for handling a Static PageView's URL. |
||
33 | * |
||
34 | * @param StaticPageView $pageView |
||
35 | * @param Compiler $compiler |
||
36 | * |
||
37 | * @return \Closure |
||
38 | */ |
||
39 | private function staticPageViewController(StaticPageView $pageView, Compiler $compiler) |
||
57 | |||
58 | /** |
||
59 | * Build a controller for handling a Dynamic PageView's URL. |
||
60 | * |
||
61 | * @param DynamicPageView $pageView |
||
62 | * @param Compiler $compiler |
||
63 | * |
||
64 | * @return \Closure |
||
65 | */ |
||
66 | private function dynamicPageViewController(DynamicPageView $pageView, Compiler $compiler) |
||
90 | |||
91 | /** |
||
92 | * Build a controller for handling a Repeater PageView's URL. |
||
93 | * |
||
94 | * @param RepeaterPageView $pageView |
||
95 | * @param Compiler $compiler |
||
96 | * |
||
97 | * @return \Closure |
||
98 | */ |
||
99 | private function repeaterPageViewController(RepeaterPageView $pageView, Compiler $compiler) |
||
118 | |||
119 | /** |
||
120 | * Return the appropriate controller based on a PageView's type. |
||
121 | * |
||
122 | * @param BasePageView|DynamicPageView|RepeaterPageView|StaticPageView $pageView |
||
123 | * @param Compiler $compiler |
||
124 | * |
||
125 | * @return \Closure |
||
126 | */ |
||
127 | private function createController(BasePageView $pageView, Compiler $compiler) |
||
148 | |||
149 | /** |
||
150 | * Check to see if a file has been touched since we last read it. |
||
151 | * |
||
152 | * @param ReadableDocument $document |
||
153 | * |
||
154 | * @return bool True if the file has been modified since it was last accessed |
||
155 | */ |
||
156 | private function hasBeenTouched(ReadableDocument $document) |
||
168 | |||
169 | /** |
||
170 | * Create a FastRoute Dispatcher. |
||
171 | * |
||
172 | * @param PageViewRouter $router |
||
173 | * @param Compiler $compiler |
||
174 | * |
||
175 | * @return \FastRoute\Dispatcher |
||
176 | */ |
||
177 | public static function create(PageViewRouter $router, Compiler $compiler) |
||
190 | |||
191 | public static function normalizeUrl($url) |
||
195 | |||
196 | /** |
||
197 | * Find a ContentItem from a Dynamic PageView or null if it doesn't exist. |
||
198 | * |
||
199 | * @param DynamicPageView $pageView |
||
200 | * @param $permalink |
||
201 | * |
||
202 | * @return CollectableItem|ReadableDocument|TemplateReadyDocument|null |
||
203 | */ |
||
204 | private static function getContentItem(DynamicPageView $pageView, $permalink) |
||
216 | } |
||
217 |