@@ -74,42 +74,42 @@ |
||
74 | 74 | |
75 | 75 | // Processing |
76 | 76 | switch ($routeInfo[0]) { |
77 | - case Dispatcher::NOT_FOUND: |
|
78 | - if ($this->tryDeliveryPhysicalFile() === false) { |
|
79 | - $this->prepareToOutput(); |
|
80 | - throw new Error404Exception("Route '$uri' not found"); |
|
81 | - } |
|
82 | - return true; |
|
77 | + case Dispatcher::NOT_FOUND: |
|
78 | + if ($this->tryDeliveryPhysicalFile() === false) { |
|
79 | + $this->prepareToOutput(); |
|
80 | + throw new Error404Exception("Route '$uri' not found"); |
|
81 | + } |
|
82 | + return true; |
|
83 | 83 | |
84 | - case Dispatcher::METHOD_NOT_ALLOWED: |
|
85 | - $outputProcessor = $this->prepareToOutput(); |
|
86 | - if (strtoupper($httpMethod) == "OPTIONS" && !empty($this->corsOrigins)) { |
|
87 | - $this->executeRequest($outputProcessor, function () {}, $request); |
|
88 | - return; |
|
89 | - } |
|
90 | - throw new Error405Exception('Method not allowed'); |
|
84 | + case Dispatcher::METHOD_NOT_ALLOWED: |
|
85 | + $outputProcessor = $this->prepareToOutput(); |
|
86 | + if (strtoupper($httpMethod) == "OPTIONS" && !empty($this->corsOrigins)) { |
|
87 | + $this->executeRequest($outputProcessor, function () {}, $request); |
|
88 | + return; |
|
89 | + } |
|
90 | + throw new Error405Exception('Method not allowed'); |
|
91 | 91 | |
92 | - case Dispatcher::FOUND: |
|
93 | - // ... 200 Process: |
|
94 | - $vars = array_merge($routeInfo[2], $queryStr); |
|
92 | + case Dispatcher::FOUND: |
|
93 | + // ... 200 Process: |
|
94 | + $vars = array_merge($routeInfo[2], $queryStr); |
|
95 | 95 | |
96 | - // Get the Selected Route |
|
97 | - $selectedRoute = $routeInfo[1]; |
|
96 | + // Get the Selected Route |
|
97 | + $selectedRoute = $routeInfo[1]; |
|
98 | 98 | |
99 | - // Default Handler for errors and |
|
100 | - $outputProcessor = $this->prepareToOutput($selectedRoute["output_processor"]); |
|
99 | + // Default Handler for errors and |
|
100 | + $outputProcessor = $this->prepareToOutput($selectedRoute["output_processor"]); |
|
101 | 101 | |
102 | - // Class |
|
103 | - $class = $selectedRoute["class"]; |
|
104 | - $request->appendVars($vars); |
|
102 | + // Class |
|
103 | + $class = $selectedRoute["class"]; |
|
104 | + $request->appendVars($vars); |
|
105 | 105 | |
106 | - // Execute the request |
|
107 | - $this->executeRequest($outputProcessor, $class, $request); |
|
106 | + // Execute the request |
|
107 | + $this->executeRequest($outputProcessor, $class, $request); |
|
108 | 108 | |
109 | - break; |
|
109 | + break; |
|
110 | 110 | |
111 | - default: |
|
112 | - throw new Error520Exception('Unknown'); |
|
111 | + default: |
|
112 | + throw new Error520Exception('Unknown'); |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 |