1 | <?php |
||
18 | class RouteDispatcher |
||
|
|||
19 | { |
||
20 | private static $baseUrl = ''; |
||
21 | private $lastModified = []; |
||
22 | |||
23 | /** |
||
24 | * @internal |
||
25 | */ |
||
26 | private function __construct() |
||
29 | |||
30 | /** |
||
31 | * Build a controller for handling a Static PageView's URL. |
||
32 | * |
||
33 | * @param StaticPageView $pageView |
||
34 | * @param Compiler $compiler |
||
35 | * |
||
36 | * @return \Closure |
||
37 | */ |
||
38 | private function staticPageViewController(StaticPageView $pageView, Compiler $compiler) |
||
54 | |||
55 | /** |
||
56 | * Build a controller for handling a Dynamic PageView's URL. |
||
57 | * |
||
58 | * @param DynamicPageView $pageView |
||
59 | * @param Compiler $compiler |
||
60 | * |
||
61 | * @return \Closure |
||
62 | */ |
||
63 | private function dynamicPageViewController(DynamicPageView $pageView, Compiler $compiler) |
||
85 | |||
86 | /** |
||
87 | * Return the appropriate controller based on a PageView's type. |
||
88 | * |
||
89 | * @param BasePageView|DynamicPageView|RepeaterPageView|StaticPageView $pageView |
||
90 | * @param Compiler $compiler |
||
91 | * |
||
92 | * @return \Closure |
||
93 | */ |
||
94 | private function createController(BasePageView $pageView, Compiler $compiler) |
||
112 | |||
113 | /** |
||
114 | * Check to see if a file has been touched since we last read it. |
||
115 | * |
||
116 | * @param ReadableDocument $document |
||
117 | * |
||
118 | * @return bool True if the file has been modified since it was last accessed |
||
119 | */ |
||
120 | private function hasBeenTouched(ReadableDocument $document) |
||
132 | |||
133 | /** |
||
134 | * Create a FastRoute Dispatcher. |
||
135 | * |
||
136 | * @param PageViewRouter $router |
||
137 | * @param Compiler $compiler |
||
138 | * |
||
139 | * @return \FastRoute\Dispatcher |
||
140 | */ |
||
141 | public static function create(PageViewRouter $router, Compiler $compiler) |
||
154 | |||
155 | public static function normalizeUrl($url) |
||
159 | |||
160 | /** |
||
161 | * Find a ContentItem from a Dynamic PageView or null if it doesn't exist. |
||
162 | * |
||
163 | * @param DynamicPageView $pageView |
||
164 | * @param $permalink |
||
165 | * |
||
166 | * @return CollectableItem|ReadableDocument|TemplateReadyDocument|null |
||
167 | */ |
||
168 | private static function getContentItem(DynamicPageView $pageView, $permalink) |
||
180 | } |
||
181 |