@@ -92,38 +92,38 @@ |
||
92 | 92 | |
93 | 93 | // Processing |
94 | 94 | switch ($routeInfo[0]) { |
95 | - case Dispatcher::NOT_FOUND: |
|
96 | - if ($this->tryDeliveryPhysicalFile() === false) { |
|
97 | - $this->initializeProcessor($response, $request); |
|
98 | - throw new Error404Exception("Route '$uri' not found"); |
|
99 | - } |
|
100 | - return true; |
|
101 | - |
|
102 | - case Dispatcher::METHOD_NOT_ALLOWED: |
|
95 | + case Dispatcher::NOT_FOUND: |
|
96 | + if ($this->tryDeliveryPhysicalFile() === false) { |
|
103 | 97 | $this->initializeProcessor($response, $request); |
104 | - throw new Error405Exception('Method not allowed'); |
|
98 | + throw new Error404Exception("Route '$uri' not found"); |
|
99 | + } |
|
100 | + return true; |
|
101 | + |
|
102 | + case Dispatcher::METHOD_NOT_ALLOWED: |
|
103 | + $this->initializeProcessor($response, $request); |
|
104 | + throw new Error405Exception('Method not allowed'); |
|
105 | 105 | |
106 | - case Dispatcher::FOUND: |
|
107 | - // ... 200 Process: |
|
108 | - $vars = array_merge($routeInfo[2], $queryStr); |
|
106 | + case Dispatcher::FOUND: |
|
107 | + // ... 200 Process: |
|
108 | + $vars = array_merge($routeInfo[2], $queryStr); |
|
109 | 109 | |
110 | - // Get the Selected Route |
|
111 | - $selectedRoute = $routeInfo[1]; |
|
110 | + // Get the Selected Route |
|
111 | + $selectedRoute = $routeInfo[1]; |
|
112 | 112 | |
113 | - // Default Handler for errors and |
|
114 | - $outputProcessor = $this->initializeProcessor($response, $request, $selectedRoute["output_processor"]); |
|
113 | + // Default Handler for errors and |
|
114 | + $outputProcessor = $this->initializeProcessor($response, $request, $selectedRoute["output_processor"]); |
|
115 | 115 | |
116 | - // Class |
|
117 | - $class = $selectedRoute["class"]; |
|
118 | - $request->appendVars($vars); |
|
116 | + // Class |
|
117 | + $class = $selectedRoute["class"]; |
|
118 | + $request->appendVars($vars); |
|
119 | 119 | |
120 | - // Execute the request |
|
121 | - $this->executeRequest($outputProcessor, $class, $response, $request); |
|
120 | + // Execute the request |
|
121 | + $this->executeRequest($outputProcessor, $class, $response, $request); |
|
122 | 122 | |
123 | - break; |
|
123 | + break; |
|
124 | 124 | |
125 | - default: |
|
126 | - throw new Error520Exception('Unknown'); |
|
125 | + default: |
|
126 | + throw new Error520Exception('Unknown'); |
|
127 | 127 | } |
128 | 128 | } |
129 | 129 |