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 | * Return the appropriate controller based on a PageView's type. |
||
93 | * |
||
94 | * @param BasePageView|DynamicPageView|RepeaterPageView|StaticPageView $pageView |
||
95 | * @param Compiler $compiler |
||
96 | * |
||
97 | * @return \Closure |
||
98 | */ |
||
99 | private function createController(BasePageView $pageView, Compiler $compiler) |
||
117 | |||
118 | /** |
||
119 | * Check to see if a file has been touched since we last read it. |
||
120 | * |
||
121 | * @param ReadableDocument $document |
||
122 | * |
||
123 | * @return bool True if the file has been modified since it was last accessed |
||
124 | */ |
||
125 | private function hasBeenTouched(ReadableDocument $document) |
||
137 | |||
138 | /** |
||
139 | * Create a FastRoute Dispatcher. |
||
140 | * |
||
141 | * @param PageViewRouter $router |
||
142 | * @param Compiler $compiler |
||
143 | * |
||
144 | * @return \FastRoute\Dispatcher |
||
145 | */ |
||
146 | public static function create(PageViewRouter $router, Compiler $compiler) |
||
159 | |||
160 | public static function normalizeUrl($url) |
||
164 | |||
165 | /** |
||
166 | * Find a ContentItem from a Dynamic PageView or null if it doesn't exist. |
||
167 | * |
||
168 | * @param DynamicPageView $pageView |
||
169 | * @param $permalink |
||
170 | * |
||
171 | * @return CollectableItem|ReadableDocument|TemplateReadyDocument|null |
||
172 | */ |
||
173 | private static function getContentItem(DynamicPageView $pageView, $permalink) |
||
185 | } |
||
186 |