| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function onRequest(Application $application, Request $request, Response $response) |
||
| 25 | { |
||
| 26 | foreach ($application->getModules() as $name => $module) { |
||
| 27 | $prefix = TemplateUtil::getAssetRoot($application, $name); |
||
| 28 | $assetsPrefix = $prefix.'/'.$module->getUriSafeName().'/'; |
||
| 29 | if (strpos($request->getUri(), $assetsPrefix) === 0) { |
||
| 30 | $assetPath = substr($request->getUri(), strlen($assetsPrefix)); |
||
| 31 | $parent = 'template/'.$application->getStyle(); |
||
| 32 | $resourcePath = $parent.'/'.$assetPath; |
||
| 33 | $realPath = $module->getResource()->getResourcePath($resourcePath, $parent); |
||
| 34 | if ($realPath) { |
||
| 35 | $file = new FileRangeProcessor($realPath); |
||
| 36 | $file->onRequest($application, $request, $response); |
||
| 37 | return true; |
||
| 38 | } |
||
| 39 | } |
||
| 40 | } |
||
| 41 | return false; |
||
| 42 | } |
||
| 44 |