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