@@ -179,38 +179,38 @@ |
||
| 179 | 179 | |
| 180 | 180 | // Copy files relative to the selected templating engine |
| 181 | 181 | switch ($this->tplEngine) { |
| 182 | - case self::TPL_ENGINE_PHP: |
|
| 183 | - case self::TPL_ENGINE_TWIG: |
|
| 184 | - case self::TPL_ENGINE_SMARTY: |
|
| 185 | - // Copy templating files over |
|
| 186 | - $tplFiles = $this->tplEngineFilesMap[$this->tplEngine]; |
|
| 187 | - $this->copyFiles($this->skeletonModuleDir, $moduleDir, $tplFiles); |
|
| 188 | - // Setting up templating tokens |
|
| 189 | - foreach ($tplFiles as $tplFile) { |
|
| 190 | - $tokenizedFiles[] = $tplFile; |
|
| 191 | - } |
|
| 192 | - $tokens['[MODULE_NAME]'] = $moduleName; |
|
| 193 | - $tokens['[TPL_ENGINE_EXT]'] = $this->tplEngine; |
|
| 194 | - break; |
|
| 182 | + case self::TPL_ENGINE_PHP: |
|
| 183 | + case self::TPL_ENGINE_TWIG: |
|
| 184 | + case self::TPL_ENGINE_SMARTY: |
|
| 185 | + // Copy templating files over |
|
| 186 | + $tplFiles = $this->tplEngineFilesMap[$this->tplEngine]; |
|
| 187 | + $this->copyFiles($this->skeletonModuleDir, $moduleDir, $tplFiles); |
|
| 188 | + // Setting up templating tokens |
|
| 189 | + foreach ($tplFiles as $tplFile) { |
|
| 190 | + $tokenizedFiles[] = $tplFile; |
|
| 191 | + } |
|
| 192 | + $tokens['[MODULE_NAME]'] = $moduleName; |
|
| 193 | + $tokens['[TPL_ENGINE_EXT]'] = $this->tplEngine; |
|
| 194 | + break; |
|
| 195 | 195 | } |
| 196 | 196 | // Routing |
| 197 | 197 | switch ($this->routingEngine) { |
| 198 | - case self::ROUTING_ENGINE_SYMFONY: |
|
| 199 | - case self::ROUTING_ENGINE_AURA: |
|
| 200 | - case self::ROUTING_ENGINE_LARAVEL: |
|
| 201 | - // Copy routing files over |
|
| 202 | - $routingFiles = $this->routingEngineFilesMap[$this->routingEngine]; |
|
| 203 | - $this->copyFiles($this->skeletonModuleDir, $moduleDir, $routingFiles); |
|
| 204 | - |
|
| 205 | - // Setting up routing tokens |
|
| 206 | - foreach ($routingFiles as $routingFile) { |
|
| 207 | - $tokenizedFiles[] = $routingFile; |
|
| 208 | - } |
|
| 209 | - $routingTokensMap = $this->routingEngineTokenMap[$this->routingEngine]; |
|
| 210 | - foreach ($routingTokensMap as $routingTokenKey => $routingTokenVal) { |
|
| 211 | - $tokens[$routingTokenKey] = $routingTokenVal; |
|
| 212 | - } |
|
| 213 | - break; |
|
| 198 | + case self::ROUTING_ENGINE_SYMFONY: |
|
| 199 | + case self::ROUTING_ENGINE_AURA: |
|
| 200 | + case self::ROUTING_ENGINE_LARAVEL: |
|
| 201 | + // Copy routing files over |
|
| 202 | + $routingFiles = $this->routingEngineFilesMap[$this->routingEngine]; |
|
| 203 | + $this->copyFiles($this->skeletonModuleDir, $moduleDir, $routingFiles); |
|
| 204 | + |
|
| 205 | + // Setting up routing tokens |
|
| 206 | + foreach ($routingFiles as $routingFile) { |
|
| 207 | + $tokenizedFiles[] = $routingFile; |
|
| 208 | + } |
|
| 209 | + $routingTokensMap = $this->routingEngineTokenMap[$this->routingEngine]; |
|
| 210 | + foreach ($routingTokensMap as $routingTokenKey => $routingTokenVal) { |
|
| 211 | + $tokens[$routingTokenKey] = $routingTokenVal; |
|
| 212 | + } |
|
| 213 | + break; |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | // Replace tokens in all files |
@@ -180,11 +180,11 @@ |
||
| 180 | 180 | public function getContent(FlattenException $exception, $showAll = true) |
| 181 | 181 | { |
| 182 | 182 | switch ($exception->getStatusCode()) { |
| 183 | - case 404: |
|
| 184 | - $title = "The page you are looking for could not be found"; |
|
| 185 | - break; |
|
| 186 | - default: |
|
| 187 | - $title = "Oh noes, something's broken"; |
|
| 183 | + case 404: |
|
| 184 | + $title = "The page you are looking for could not be found"; |
|
| 185 | + break; |
|
| 186 | + default: |
|
| 187 | + $title = "Oh noes, something's broken"; |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | $content = ''; |
@@ -254,34 +254,34 @@ |
||
| 254 | 254 | { |
| 255 | 255 | switch ($key = strtolower($key)) { |
| 256 | 256 | |
| 257 | - case 'ajax': |
|
| 258 | - if (!isset($this->isCache['ajax'])) { |
|
| 259 | - return $this->isCache['ajax'] = $this->getService('Request')->isXmlHttpRequest(); |
|
| 260 | - } |
|
| 261 | - |
|
| 262 | - return $this->isCache['ajax']; |
|
| 263 | - |
|
| 264 | - case 'put': |
|
| 265 | - case 'delete': |
|
| 266 | - case 'post': |
|
| 267 | - case 'patch': |
|
| 268 | - if (!isset($this->isCache['requestMethod'][$key])) { |
|
| 269 | - $this->isCache['requestMethod'][$key] = $this->getService('Request')->getMethod() === strtoupper($key); |
|
| 270 | - } |
|
| 271 | - |
|
| 272 | - return $this->isCache['requestMethod'][$key]; |
|
| 273 | - |
|
| 274 | - case 'ssl': |
|
| 275 | - case 'https': |
|
| 276 | - case 'secure': |
|
| 277 | - if (!isset($this->isCache['secure'])) { |
|
| 278 | - $this->isCache['secure'] = $this->getService('Request')->isSecure(); |
|
| 279 | - } |
|
| 280 | - |
|
| 281 | - return $this->isCache['secure']; |
|
| 282 | - |
|
| 283 | - default: |
|
| 284 | - throw new \InvalidArgumentException("Invalid 'is' key supplied: {$key}"); |
|
| 257 | + case 'ajax': |
|
| 258 | + if (!isset($this->isCache['ajax'])) { |
|
| 259 | + return $this->isCache['ajax'] = $this->getService('Request')->isXmlHttpRequest(); |
|
| 260 | + } |
|
| 261 | + |
|
| 262 | + return $this->isCache['ajax']; |
|
| 263 | + |
|
| 264 | + case 'put': |
|
| 265 | + case 'delete': |
|
| 266 | + case 'post': |
|
| 267 | + case 'patch': |
|
| 268 | + if (!isset($this->isCache['requestMethod'][$key])) { |
|
| 269 | + $this->isCache['requestMethod'][$key] = $this->getService('Request')->getMethod() === strtoupper($key); |
|
| 270 | + } |
|
| 271 | + |
|
| 272 | + return $this->isCache['requestMethod'][$key]; |
|
| 273 | + |
|
| 274 | + case 'ssl': |
|
| 275 | + case 'https': |
|
| 276 | + case 'secure': |
|
| 277 | + if (!isset($this->isCache['secure'])) { |
|
| 278 | + $this->isCache['secure'] = $this->getService('Request')->isSecure(); |
|
| 279 | + } |
|
| 280 | + |
|
| 281 | + return $this->isCache['secure']; |
|
| 282 | + |
|
| 283 | + default: |
|
| 284 | + throw new \InvalidArgumentException("Invalid 'is' key supplied: {$key}"); |
|
| 285 | 285 | |
| 286 | 286 | } |
| 287 | 287 | } |
@@ -59,33 +59,33 @@ |
||
| 59 | 59 | |
| 60 | 60 | switch(true) { |
| 61 | 61 | // @todo - move this to a separate method() |
| 62 | - case $moduleRoutingResponse instanceof SymfonyRouteCollection: |
|
| 63 | - $sfRouter = new SymfonyRouter($requestContext, $moduleRoutingResponse, $routerOptions, $logger); |
|
| 64 | - $sfRouterWrapper = new SymfonyRouterWrapper($sfRouter); |
|
| 65 | - $chainRouter->add($sfRouterWrapper); |
|
| 66 | - break; |
|
| 67 | - |
|
| 68 | - // @todo - move this to a separate method() |
|
| 69 | - case $moduleRoutingResponse instanceof AuraRouter: |
|
| 70 | - $auraRouterWrapper = new AuraRouterWrapper($moduleRoutingResponse); |
|
| 71 | - $chainRouter->add($auraRouterWrapper); |
|
| 72 | - break; |
|
| 73 | - |
|
| 74 | - // @todo - move this to a separate method() |
|
| 75 | - case $moduleRoutingResponse instanceof LaravelRouter: |
|
| 76 | - $laravelRequest = new LaravelRequest(); |
|
| 77 | - $laravelUrlGenerator = new LaravelUrlGenerator($moduleRoutingResponse->getRoutes(), $laravelRequest); |
|
| 78 | - $laravelRouterWrapper = new LaravelRouterWrapper( |
|
| 79 | - $moduleRoutingResponse, $laravelRequest, $laravelUrlGenerator |
|
| 80 | - ); |
|
| 81 | - // @todo - solve this problem |
|
| 62 | + case $moduleRoutingResponse instanceof SymfonyRouteCollection: |
|
| 63 | + $sfRouter = new SymfonyRouter($requestContext, $moduleRoutingResponse, $routerOptions, $logger); |
|
| 64 | + $sfRouterWrapper = new SymfonyRouterWrapper($sfRouter); |
|
| 65 | + $chainRouter->add($sfRouterWrapper); |
|
| 66 | + break; |
|
| 67 | + |
|
| 68 | + // @todo - move this to a separate method() |
|
| 69 | + case $moduleRoutingResponse instanceof AuraRouter: |
|
| 70 | + $auraRouterWrapper = new AuraRouterWrapper($moduleRoutingResponse); |
|
| 71 | + $chainRouter->add($auraRouterWrapper); |
|
| 72 | + break; |
|
| 73 | + |
|
| 74 | + // @todo - move this to a separate method() |
|
| 75 | + case $moduleRoutingResponse instanceof LaravelRouter: |
|
| 76 | + $laravelRequest = new LaravelRequest(); |
|
| 77 | + $laravelUrlGenerator = new LaravelUrlGenerator($moduleRoutingResponse->getRoutes(), $laravelRequest); |
|
| 78 | + $laravelRouterWrapper = new LaravelRouterWrapper( |
|
| 79 | + $moduleRoutingResponse, $laravelRequest, $laravelUrlGenerator |
|
| 80 | + ); |
|
| 81 | + // @todo - solve this problem |
|
| 82 | 82 | // $laravelRouterWrapper->setModuleName($this->getName()); |
| 83 | - $chainRouter->add($laravelRouterWrapper); |
|
| 84 | - break; |
|
| 83 | + $chainRouter->add($laravelRouterWrapper); |
|
| 84 | + break; |
|
| 85 | 85 | |
| 86 | - default: |
|
| 87 | - throw new \Exception('Unexpected routes value return from module: ' . $moduleName . |
|
| 88 | - '. found value of type: ' . gettype($moduleRoutingResponse)); |
|
| 86 | + default: |
|
| 87 | + throw new \Exception('Unexpected routes value return from module: ' . $moduleName . |
|
| 88 | + '. found value of type: ' . gettype($moduleRoutingResponse)); |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |