@@ -53,38 +53,38 @@ |
||
| 53 | 53 | |
| 54 | 54 | // Processing |
| 55 | 55 | switch ($routeInfo[0]) { |
| 56 | - case Dispatcher::NOT_FOUND: |
|
| 57 | - if ($this->tryDeliveryPhysicalFile() === false) { |
|
| 58 | - $this->prepareToOutput(); |
|
| 59 | - throw new Error404Exception("Route '$uri' not found"); |
|
| 60 | - } |
|
| 61 | - return true; |
|
| 62 | - |
|
| 63 | - case Dispatcher::METHOD_NOT_ALLOWED: |
|
| 56 | + case Dispatcher::NOT_FOUND: |
|
| 57 | + if ($this->tryDeliveryPhysicalFile() === false) { |
|
| 64 | 58 | $this->prepareToOutput(); |
| 65 | - throw new Error405Exception('Method not allowed'); |
|
| 59 | + throw new Error404Exception("Route '$uri' not found"); |
|
| 60 | + } |
|
| 61 | + return true; |
|
| 62 | + |
|
| 63 | + case Dispatcher::METHOD_NOT_ALLOWED: |
|
| 64 | + $this->prepareToOutput(); |
|
| 65 | + throw new Error405Exception('Method not allowed'); |
|
| 66 | 66 | |
| 67 | - case Dispatcher::FOUND: |
|
| 68 | - // ... 200 Process: |
|
| 69 | - $vars = array_merge($routeInfo[2], $queryStr); |
|
| 67 | + case Dispatcher::FOUND: |
|
| 68 | + // ... 200 Process: |
|
| 69 | + $vars = array_merge($routeInfo[2], $queryStr); |
|
| 70 | 70 | |
| 71 | - // Get the Selected Route |
|
| 72 | - $selectedRoute = $routeInfo[1]; |
|
| 71 | + // Get the Selected Route |
|
| 72 | + $selectedRoute = $routeInfo[1]; |
|
| 73 | 73 | |
| 74 | - // Default Handler for errors and |
|
| 75 | - $outputProcessor = $this->prepareToOutput($selectedRoute["output_processor"]); |
|
| 74 | + // Default Handler for errors and |
|
| 75 | + $outputProcessor = $this->prepareToOutput($selectedRoute["output_processor"]); |
|
| 76 | 76 | |
| 77 | - // Class |
|
| 78 | - $class = $selectedRoute["class"]; |
|
| 79 | - $request->appendVars($vars); |
|
| 77 | + // Class |
|
| 78 | + $class = $selectedRoute["class"]; |
|
| 79 | + $request->appendVars($vars); |
|
| 80 | 80 | |
| 81 | - // Execute the request |
|
| 82 | - $this->executeRequest($outputProcessor, $class, $request); |
|
| 81 | + // Execute the request |
|
| 82 | + $this->executeRequest($outputProcessor, $class, $request); |
|
| 83 | 83 | |
| 84 | - break; |
|
| 84 | + break; |
|
| 85 | 85 | |
| 86 | - default: |
|
| 87 | - throw new Error520Exception('Unknown'); |
|
| 86 | + default: |
|
| 87 | + throw new Error520Exception('Unknown'); |
|
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | |
@@ -125,8 +125,9 @@ |
||
| 125 | 125 | |
| 126 | 126 | // loop data blocks |
| 127 | 127 | foreach ($blocks as $id => $block) { |
| 128 | - if (empty($block)) |
|
| 129 | - continue; |
|
| 128 | + if (empty($block)) { |
|
| 129 | + continue; |
|
| 130 | + } |
|
| 130 | 131 | |
| 131 | 132 | $name = []; |
| 132 | 133 | preg_match('/\bname=\"([^\"]*)\"\s*;/s', $block, $name); |