@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | 'a', |
139 | 139 | 'Exception-Wiki', |
140 | 140 | [ |
141 | - 'href' => 'https://github.com/PhileCMS/Phile/wiki/Exception_' . $code, |
|
141 | + 'href' => 'https://github.com/PhileCMS/Phile/wiki/Exception_'.$code, |
|
142 | 142 | 'target_' => 'blank' |
143 | 143 | ] |
144 | 144 | ); |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | } |
154 | 154 | |
155 | 155 | $DS = DIRECTORY_SEPARATOR; |
156 | - $pluginPath = realpath(dirname(__FILE__) . $DS . '..') . $DS; |
|
157 | - $tplPath = $pluginPath . 'template.php'; |
|
156 | + $pluginPath = realpath(dirname(__FILE__).$DS.'..').$DS; |
|
157 | + $tplPath = $pluginPath.'template.php'; |
|
158 | 158 | |
159 | 159 | ob_start(); |
160 | 160 | extract($marker); |
@@ -181,8 +181,8 @@ discard block |
||
181 | 181 | $backtrace .= ' '; |
182 | 182 | |
183 | 183 | if (isset($step['class'])) { |
184 | - $class = $this->linkClass($step['class']) . '<span class="divider">::</span>'; |
|
185 | - $backtrace .= $class . $this->linkClass($step['class'], $step['function']); |
|
184 | + $class = $this->linkClass($step['class']).'<span class="divider">::</span>'; |
|
185 | + $backtrace .= $class.$this->linkClass($step['class'], $step['function']); |
|
186 | 186 | } elseif (isset($step['function'])) { |
187 | 187 | $backtrace .= $this->tag('span', $step['function'], ['class' => 'function']); |
188 | 188 | } |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | if (!file_exists($filename)) { |
252 | 252 | return ''; |
253 | 253 | } |
254 | - $html = $this->tag('span', $filename . ':<br/>', ['class' => 'filename']); |
|
254 | + $html = $this->tag('span', $filename.':<br/>', ['class' => 'filename']); |
|
255 | 255 | |
256 | 256 | $code = file_get_contents($filename); |
257 | 257 | $lines = explode("\n", $code); |
@@ -302,14 +302,14 @@ discard block |
||
302 | 302 | return $title; |
303 | 303 | } |
304 | 304 | |
305 | - $filename = 'docs/classes/' . str_replace('\\', '.', $class) . '.html'; |
|
305 | + $filename = 'docs/classes/'.str_replace('\\', '.', $class).'.html'; |
|
306 | 306 | if (file_exists(Utility::resolveFilePath($filename))) { |
307 | 307 | return $title; |
308 | 308 | } |
309 | 309 | |
310 | - $href = $this->settings['base_url'] . '/' . $filename; |
|
310 | + $href = $this->settings['base_url'].'/'.$filename; |
|
311 | 311 | if ($method) { |
312 | - $href .= '#method_' . $method; |
|
312 | + $href .= '#method_'.$method; |
|
313 | 313 | } |
314 | 314 | return $this->tag('a', $title, ['href' => $href, 'target' => '_blank']); |
315 | 315 | } |
@@ -324,11 +324,11 @@ discard block |
||
324 | 324 | */ |
325 | 325 | protected function tag($tag, $content = '', array $attributes = []) |
326 | 326 | { |
327 | - $html = '<' . $tag; |
|
327 | + $html = '<'.$tag; |
|
328 | 328 | foreach ($attributes as $key => $value) { |
329 | - $html .= ' ' . $key . '="' . htmlspecialchars($value) . '"'; |
|
329 | + $html .= ' '.$key.'="'.htmlspecialchars($value).'"'; |
|
330 | 330 | } |
331 | - $html .= '>' . $content . '</' . $tag . '>'; |
|
331 | + $html .= '>'.$content.'</'.$tag.'>'; |
|
332 | 332 | return $html; |
333 | 333 | } |
334 | 334 | } |
@@ -109,6 +109,6 @@ |
||
109 | 109 | */ |
110 | 110 | protected function getStorageFile($key) |
111 | 111 | { |
112 | - return $this->dataDirectory . $this->getInternalKey($key) . '.ds'; |
|
112 | + return $this->dataDirectory.$this->getInternalKey($key).'.ds'; |
|
113 | 113 | } |
114 | 114 | } |
@@ -23,6 +23,6 @@ |
||
23 | 23 | * @var \SplFileInfo $this |
24 | 24 | */ |
25 | 25 | $ext = Registry::get('Phile_Settings')['content_ext']; |
26 | - return (preg_match('/^[^\.]{1}.*' . $ext . '/', $this->getFilename()) > 0); |
|
26 | + return (preg_match('/^[^\.]{1}.*'.$ext.'/', $this->getFilename()) > 0); |
|
27 | 27 | } |
28 | 28 | } |
@@ -84,12 +84,12 @@ discard block |
||
84 | 84 | defined('PHILE_VERSION') || define('PHILE_VERSION', '1.8.0'); |
85 | 85 | defined('PHILE_CLI_MODE') || define('PHILE_CLI_MODE', (php_sapi_name() === 'cli')); |
86 | 86 | defined('DS') || define('DS', DIRECTORY_SEPARATOR); |
87 | - defined('ROOT_DIR') || define('ROOT_DIR', realpath(__DIR__ . DS . '..' . DS . '..' . DS) . DS); |
|
88 | - defined('LIB_DIR') || define('LIB_DIR', ROOT_DIR . 'lib' . DS); |
|
89 | - defined('PLUGINS_DIR') || define('PLUGINS_DIR', ROOT_DIR . 'plugins' . DS); |
|
90 | - defined('THEMES_DIR') || define('THEMES_DIR', ROOT_DIR . 'themes' . DS); |
|
91 | - defined('CACHE_DIR') || define('CACHE_DIR', LIB_DIR . 'cache' . DS); |
|
92 | - defined('STORAGE_DIR') || define('STORAGE_DIR', LIB_DIR . 'datastorage' . DS); |
|
87 | + defined('ROOT_DIR') || define('ROOT_DIR', realpath(__DIR__.DS.'..'.DS.'..'.DS).DS); |
|
88 | + defined('LIB_DIR') || define('LIB_DIR', ROOT_DIR.'lib'.DS); |
|
89 | + defined('PLUGINS_DIR') || define('PLUGINS_DIR', ROOT_DIR.'plugins'.DS); |
|
90 | + defined('THEMES_DIR') || define('THEMES_DIR', ROOT_DIR.'themes'.DS); |
|
91 | + defined('CACHE_DIR') || define('CACHE_DIR', LIB_DIR.'cache'.DS); |
|
92 | + defined('STORAGE_DIR') || define('STORAGE_DIR', LIB_DIR.'datastorage'.DS); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | spl_autoload_extensions(".php"); |
101 | 101 | // load phile core |
102 | 102 | spl_autoload_register( |
103 | - function ($className) { |
|
104 | - $fileName = LIB_DIR . str_replace("\\", DS, $className) . '.php'; |
|
103 | + function($className) { |
|
104 | + $fileName = LIB_DIR.str_replace("\\", DS, $className).'.php'; |
|
105 | 105 | if (file_exists($fileName)) { |
106 | 106 | include_once $fileName; |
107 | 107 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | // load phile plugins |
111 | 111 | spl_autoload_register('\Phile\Plugin\PluginRepository::autoload'); |
112 | 112 | |
113 | - include LIB_DIR . 'vendor' . DS . 'autoload.php'; |
|
113 | + include LIB_DIR.'vendor'.DS.'autoload.php'; |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
@@ -118,8 +118,8 @@ discard block |
||
118 | 118 | */ |
119 | 119 | protected function initializeConfiguration() |
120 | 120 | { |
121 | - $defaults = Utility::load(ROOT_DIR . 'default_config.php'); |
|
122 | - $localSettings = Utility::load(ROOT_DIR . 'config.php'); |
|
121 | + $defaults = Utility::load(ROOT_DIR.'default_config.php'); |
|
122 | + $localSettings = Utility::load(ROOT_DIR.'config.php'); |
|
123 | 123 | if (is_array($localSettings)) { |
124 | 124 | $this->settings = array_replace_recursive($defaults, $localSettings); |
125 | 125 | } else { |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $pageId .= 'index'; |
66 | 66 | } |
67 | 67 | |
68 | - $file = $folder . $pageId . $this->settings['content_ext']; |
|
68 | + $file = $folder.$pageId.$this->settings['content_ext']; |
|
69 | 69 | if (!file_exists($file)) { |
70 | 70 | if (substr($pageId, -6) === '/index') { |
71 | 71 | // try to resolve sub-directory 'sub/' to page 'sub' |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | // try to resolve page 'sub' to sub-directory 'sub/' |
75 | 75 | $pageId .= '/index'; |
76 | 76 | } |
77 | - $file = $folder . $pageId . $this->settings['content_ext']; |
|
77 | + $file = $folder.$pageId.$this->settings['content_ext']; |
|
78 | 78 | } |
79 | 79 | if (!file_exists($file)) { |
80 | 80 | return null; |
@@ -94,13 +94,13 @@ discard block |
||
94 | 94 | { |
95 | 95 | $folder = $folder ?: $this->settings['content_dir']; |
96 | 96 | return new PageCollection( |
97 | - function () use ($options, $folder) { |
|
97 | + function() use ($options, $folder) { |
|
98 | 98 | $options += $this->settings; |
99 | 99 | // ignore files with a leading '.' in its filename |
100 | 100 | $files = Utility::getFiles($folder, '\Phile\FilterIterator\ContentFileFilterIterator'); |
101 | 101 | $pages = array(); |
102 | 102 | foreach ($files as $file) { |
103 | - if (str_replace($folder, '', $file) == '404' . $this->settings['content_ext']) { |
|
103 | + if (str_replace($folder, '', $file) == '404'.$this->settings['content_ext']) { |
|
104 | 104 | // jump to next page if file is the 404 page |
105 | 105 | continue; |
106 | 106 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | $meta = $page->getMeta(); |
139 | 139 | if ($sort['type'] === 'page') { |
140 | - $method = 'get' . ucfirst($key); |
|
140 | + $method = 'get'.ucfirst($key); |
|
141 | 141 | $value = $page->$method(); |
142 | 142 | } elseif ($sort['type'] === 'meta') { |
143 | 143 | $value = $meta->get($key); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $column[] = $value; |
152 | 152 | } |
153 | 153 | $sortHelper[] = $column; |
154 | - $sortHelper[] = constant('SORT_' . strtoupper($sort['order'])); |
|
154 | + $sortHelper[] = constant('SORT_'.strtoupper($sort['order'])); |
|
155 | 155 | } |
156 | 156 | $sortHelper[] = &$pages; |
157 | 157 | |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | protected function getPage($filePath, $folder = null) |
195 | 195 | { |
196 | 196 | $folder = $folder ?: $this->settings['content_dir']; |
197 | - $key = 'Phile_Model_Page_' . md5($filePath); |
|
197 | + $key = 'Phile_Model_Page_'.md5($filePath); |
|
198 | 198 | if (isset($this->storage[$key])) { |
199 | 199 | return $this->storage[$key]; |
200 | 200 | } |
@@ -68,7 +68,7 @@ |
||
68 | 68 | /** |
69 | 69 | * content directory |
70 | 70 | */ |
71 | -$config['content_dir'] = ROOT_DIR . 'content' . DS; |
|
71 | +$config['content_dir'] = ROOT_DIR.'content'.DS; |
|
72 | 72 | |
73 | 73 | /** |
74 | 74 | * extension of content files |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $template = 'index'; |
124 | 124 | } |
125 | 125 | if (!empty($this->config['template-extension'])) { |
126 | - $template .= '.' . $this->config['template-extension']; |
|
126 | + $template .= '.'.$this->config['template-extension']; |
|
127 | 127 | } |
128 | 128 | $templatePath = $this->getTemplatePath($template); |
129 | 129 | if (!file_exists($templatePath)) { |
@@ -143,9 +143,9 @@ discard block |
||
143 | 143 | */ |
144 | 144 | protected function getTemplatePath($sub = '') |
145 | 145 | { |
146 | - $themePath = THEMES_DIR . $this->settings['theme']; |
|
146 | + $themePath = THEMES_DIR.$this->settings['theme']; |
|
147 | 147 | if (!empty($sub)) { |
148 | - $themePath .= '/' . ltrim($sub, DIRECTORY_SEPARATOR); |
|
148 | + $themePath .= '/'.ltrim($sub, DIRECTORY_SEPARATOR); |
|
149 | 149 | } |
150 | 150 | return $themePath; |
151 | 151 | } |
@@ -167,11 +167,11 @@ discard block |
||
167 | 167 | 'base_url' => $this->settings['base_url'], |
168 | 168 | 'config' => $this->settings, |
169 | 169 | 'content_dir' => $this->settings['content_dir'], |
170 | - 'content_url' => $this->settings['base_url'] . '/' . basename($this->settings['content_dir']), |
|
170 | + 'content_url' => $this->settings['base_url'].'/'.basename($this->settings['content_dir']), |
|
171 | 171 | 'pages' => $repository->findAll(), |
172 | 172 | 'site_title' => $this->settings['site_title'], |
173 | - 'theme_dir' => THEMES_DIR . $this->settings['theme'], |
|
174 | - 'theme_url' => $this->settings['base_url'] . '/' . basename(THEMES_DIR) . '/' . $this->settings['theme'], |
|
173 | + 'theme_dir' => THEMES_DIR.$this->settings['theme'], |
|
174 | + 'theme_url' => $this->settings['base_url'].'/'.basename(THEMES_DIR).'/'.$this->settings['theme'], |
|
175 | 175 | ]; |
176 | 176 | |
177 | 177 | /** |