@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | private function config() |
66 | 66 | { |
67 | - $configPath = __DIR__ . '/../../config.json'; |
|
67 | + $configPath = __DIR__.'/../../config.json'; |
|
68 | 68 | if (realpath($configPath) !== false) { |
69 | 69 | $json = file_get_contents($configPath); |
70 | 70 | $this->config = json_decode($json); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | private function redirectMatching($request) |
86 | 86 | { |
87 | 87 | $redirects = $this->storage->getRedirects()->getRedirects(); |
88 | - $relativeUri = '/' . $request::$relativeUri; |
|
88 | + $relativeUri = '/'.$request::$relativeUri; |
|
89 | 89 | |
90 | 90 | foreach ($redirects as $redirect) { |
91 | 91 | if (preg_match_all($redirect->fromUrl, $relativeUri, $matches)) { |
@@ -95,10 +95,10 @@ discard block |
||
95 | 95 | } |
96 | 96 | if ($redirect->type == '301') { |
97 | 97 | header('HTTP/1.1 301 Moved Permanently'); |
98 | - header('Location: ' . $request::$subfolders . $toUrl); |
|
98 | + header('Location: '.$request::$subfolders.$toUrl); |
|
99 | 99 | exit; |
100 | 100 | } elseif ($redirect->type == '302') { |
101 | - header('Location: ' . $request::$subfolders . $toUrl, true, 302); |
|
101 | + header('Location: '.$request::$subfolders.$toUrl, true, 302); |
|
102 | 102 | exit; |
103 | 103 | } else { |
104 | 104 | throw new \Exception('Invalid redirect type.'); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | private function sitemapMatching($request) |
117 | 117 | { |
118 | 118 | $sitemap = $this->storage->getSitemap()->getSitemap(); |
119 | - $relativeUri = '/' . $request::$relativeUri; |
|
119 | + $relativeUri = '/'.$request::$relativeUri; |
|
120 | 120 | |
121 | 121 | foreach ($sitemap as $sitemapItem) { |
122 | 122 | if ($sitemapItem->regex) { |
@@ -181,15 +181,15 @@ discard block |
||
181 | 181 | */ |
182 | 182 | private function getComponentObject($class = '', $template = '', $parameters = array(), $matchedSitemapItem) |
183 | 183 | { |
184 | - $libraryComponentName = '\\library\\components\\' . $class; |
|
185 | - $userComponentName = '\\components\\' . $class; |
|
184 | + $libraryComponentName = '\\library\\components\\'.$class; |
|
185 | + $userComponentName = '\\components\\'.$class; |
|
186 | 186 | |
187 | 187 | if (AutoloadUtil::autoLoad($libraryComponentName, false)) { |
188 | 188 | $component = new $libraryComponentName($template, $this->request, $parameters, $matchedSitemapItem); |
189 | 189 | } elseif (AutoloadUtil::autoLoad($userComponentName, false)) { |
190 | 190 | $component = new $userComponentName($template, $this->request, $parameters, $matchedSitemapItem); |
191 | 191 | } else { |
192 | - throw new \Exception('Could not load component ' . $class); |
|
192 | + throw new \Exception('Could not load component '.$class); |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | if (!$component instanceof Component) { |
@@ -247,8 +247,8 @@ discard block |
||
247 | 247 | */ |
248 | 248 | public function setCachingHeaders() |
249 | 249 | { |
250 | - header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60 * 24 * 2))); // 2 days |
|
251 | - header("Cache-Control: max-age=" . (60 * 60 * 24 * 2)); |
|
250 | + header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60 * 24 * 2))); // 2 days |
|
251 | + header("Cache-Control: max-age=".(60 * 60 * 24 * 2)); |
|
252 | 252 | } |
253 | 253 | |
254 | 254 | /** |