@@ -42,19 +42,19 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | $stack = debug_backtrace(); |
| 44 | 44 | foreach ($stack as $item) { |
| 45 | - if (false !== stripos($item['file'], DIRECTORY_SEPARATOR . 'Route' . DIRECTORY_SEPARATOR)) { |
|
| 46 | - $cacheName = pathinfo($item['file'], PATHINFO_DIRNAME) . '/' . $name; |
|
| 47 | - $cacheName = explode('Route' . DIRECTORY_SEPARATOR, $cacheName)[1]; |
|
| 48 | - $cacheName = 'route_' . str_replace(['/', '\\'], '_', $cacheName); |
|
| 45 | + if (false !== stripos($item['file'], DIRECTORY_SEPARATOR.'Route'.DIRECTORY_SEPARATOR)) { |
|
| 46 | + $cacheName = pathinfo($item['file'], PATHINFO_DIRNAME).'/'.$name; |
|
| 47 | + $cacheName = explode('Route'.DIRECTORY_SEPARATOR, $cacheName)[1]; |
|
| 48 | + $cacheName = 'route_'.str_replace(['/', '\\'], '_', $cacheName); |
|
| 49 | 49 | break; |
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | - $cacheName .= '_' . $this->language . '.html.php'; |
|
| 54 | - $path = $this->packageRoot . '/view/_cache/' . str_replace('/', '_', $cacheName); |
|
| 53 | + $cacheName .= '_'.$this->language.'.html.php'; |
|
| 54 | + $path = $this->packageRoot.'/view/_cache/'.str_replace('/', '_', $cacheName); |
|
| 55 | 55 | |
| 56 | 56 | if (!$this->cache || !file_exists($path)) { |
| 57 | - $code = $this->compile($name . '/view.html.php', true, true, true); |
|
| 57 | + $code = $this->compile($name.'/view.html.php', true, true, true); |
|
| 58 | 58 | |
| 59 | 59 | $fh = fopen($path, 'wb'); |
| 60 | 60 | if (flock($fh, LOCK_EX)) { |
@@ -94,18 +94,18 @@ discard block |
||
| 94 | 94 | $path = ''; |
| 95 | 95 | $stack = debug_backtrace(); |
| 96 | 96 | foreach ($stack as $item) { |
| 97 | - if (false !== stripos($item['file'], DIRECTORY_SEPARATOR . 'Route' . DIRECTORY_SEPARATOR)) { |
|
| 98 | - $path = pathinfo($item['file'], PATHINFO_DIRNAME) . '/view.html.php'; |
|
| 97 | + if (false !== stripos($item['file'], DIRECTORY_SEPARATOR.'Route'.DIRECTORY_SEPARATOR)) { |
|
| 98 | + $path = pathinfo($item['file'], PATHINFO_DIRNAME).'/view.html.php'; |
|
| 99 | 99 | if ($processLang) { |
| 100 | - $storagePath = str_replace('view.html.php', '_lang/' . $this->language . '/data.php', $path); |
|
| 100 | + $storagePath = str_replace('view.html.php', '_lang/'.$this->language.'/data.php', $path); |
|
| 101 | 101 | } |
| 102 | 102 | break; |
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | } else { |
| 106 | - $path = $this->packageRoot . '/view/' . $name; |
|
| 106 | + $path = $this->packageRoot.'/view/'.$name; |
|
| 107 | 107 | if ($processLang) { |
| 108 | - $storagePath = str_replace('view.html.php', '', $path) . '_lang/' . $this->language . '/data.php'; |
|
| 108 | + $storagePath = str_replace('view.html.php', '', $path).'_lang/'.$this->language.'/data.php'; |
|
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | foreach ($matchList[1] as $key => $template) { |
| 139 | 139 | if (!empty($matchList[0][$key]) && false !== strpos($code, $matchList[0][$key])) { |
| 140 | 140 | $template = trim($template); |
| 141 | - $code = str_replace($matchList[0][$key], $this->compile($template . '/view.html.php', true, true, false), $code); |
|
| 141 | + $code = str_replace($matchList[0][$key], $this->compile($template.'/view.html.php', true, true, false), $code); |
|
| 142 | 142 | } |
| 143 | 143 | } |
| 144 | 144 | } |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | preg_match_all('/<!-- extends (.*) -->/', $code, $matchList); |
| 149 | 149 | if (isset($matchList[1][0])) { |
| 150 | 150 | $template = trim($matchList[1][0]); |
| 151 | - $parentHtml = $this->compile($template . '/view.html.php', true, true, false); |
|
| 151 | + $parentHtml = $this->compile($template.'/view.html.php', true, true, false); |
|
| 152 | 152 | |
| 153 | 153 | $code = str_replace($matchList[0][0], '', $code); |
| 154 | 154 | $parentHtml = str_replace('<!-- section -->', $code, $parentHtml); |