1 | <?php |
||
24 | class RouteDispatcher |
||
|
|||
25 | { |
||
26 | private static $baseUrl = ''; |
||
27 | private $lastModified = []; |
||
28 | |||
29 | /** |
||
30 | * @internal |
||
31 | */ |
||
32 | private function __construct() |
||
35 | |||
36 | /** |
||
37 | * Build a controller for handling a Static PageView's URL. |
||
38 | * |
||
39 | * @param StaticPageView $pageView |
||
40 | * @param Compiler $compiler |
||
41 | * |
||
42 | * @return \Closure |
||
43 | */ |
||
44 | private function staticPageViewController(StaticPageView $pageView, Compiler $compiler) |
||
63 | |||
64 | /** |
||
65 | * Build a controller for handling a Dynamic PageView's URL. |
||
66 | * |
||
67 | * @param DynamicPageView $pageView |
||
68 | * @param Compiler $compiler |
||
69 | * |
||
70 | * @return \Closure |
||
71 | */ |
||
72 | private function dynamicPageViewController(DynamicPageView $pageView, Compiler $compiler) |
||
96 | |||
97 | /** |
||
98 | * Build a controller for handling a Repeater PageView's URL. |
||
99 | * |
||
100 | * @param RepeaterPageView $pageView |
||
101 | * @param Compiler $compiler |
||
102 | * |
||
103 | * @return \Closure |
||
104 | */ |
||
105 | private function repeaterPageViewController(RepeaterPageView $pageView, Compiler $compiler) |
||
124 | |||
125 | /** |
||
126 | * Return the appropriate controller based on a PageView's type. |
||
127 | * |
||
128 | * @param BasePageView|DynamicPageView|RepeaterPageView|StaticPageView $pageView |
||
129 | * @param Compiler $compiler |
||
130 | * |
||
131 | * @return \Closure |
||
132 | */ |
||
133 | private function createController(BasePageView $pageView, Compiler $compiler) |
||
154 | |||
155 | /** |
||
156 | * Check to see if a file has been touched since we last read it. |
||
157 | * |
||
158 | * @param ReadableDocument $document |
||
159 | * |
||
160 | * @return bool True if the file has been modified since it was last accessed |
||
161 | */ |
||
162 | private function hasBeenTouched(ReadableDocument $document) |
||
175 | |||
176 | /** |
||
177 | * Create a FastRoute Dispatcher. |
||
178 | * |
||
179 | * @param PageViewRouter $router |
||
180 | * @param Compiler $compiler |
||
181 | * |
||
182 | * @return \FastRoute\Dispatcher |
||
183 | */ |
||
184 | public static function create(PageViewRouter $router, Compiler $compiler) |
||
197 | |||
198 | public static function normalizeUrl($url) |
||
202 | |||
203 | /** |
||
204 | * Find a ContentItem from a Dynamic PageView or null if it doesn't exist. |
||
205 | * |
||
206 | * @param DynamicPageView $pageView |
||
207 | * @param $permalink |
||
208 | * |
||
209 | * @return CollectableItem|ReadableDocument|TemplateReadyDocument|null |
||
210 | */ |
||
211 | private static function getContentItem(DynamicPageView $pageView, $permalink) |
||
223 | } |
||
224 |