@@ -76,7 +76,7 @@ |
||
| 76 | 76 | public function offsetSet($offset, $value) |
| 77 | 77 | { |
| 78 | 78 | $this->load(); |
| 79 | - $this->pages[$offset] = $value; |
|
| 79 | + $this->pages[$offset] = $value; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | public function offsetUnset($offset) |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $pageId .= 'index'; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - $file = $folder . $pageId . CONTENT_EXT; |
|
| 67 | + $file = $folder.$pageId.CONTENT_EXT; |
|
| 68 | 68 | if (!file_exists($file)) { |
| 69 | 69 | if (substr($pageId, -6) === '/index') { |
| 70 | 70 | // try to resolve sub-directory 'sub/' to page 'sub' |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | // try to resolve page 'sub' to sub-directory 'sub/' |
| 74 | 74 | $pageId .= '/index'; |
| 75 | 75 | } |
| 76 | - $file = $folder . $pageId . CONTENT_EXT; |
|
| 76 | + $file = $folder.$pageId.CONTENT_EXT; |
|
| 77 | 77 | } |
| 78 | 78 | if (!file_exists($file)) { |
| 79 | 79 | return null; |
@@ -92,13 +92,13 @@ discard block |
||
| 92 | 92 | public function findAll(array $options = array(), $folder = CONTENT_DIR) |
| 93 | 93 | { |
| 94 | 94 | return new PageCollection( |
| 95 | - function () use ($options, $folder) { |
|
| 95 | + function() use ($options, $folder) { |
|
| 96 | 96 | $options += $this->settings; |
| 97 | 97 | // ignore files with a leading '.' in its filename |
| 98 | 98 | $files = Utility::getFiles($folder, '\Phile\FilterIterator\ContentFileFilterIterator'); |
| 99 | 99 | $pages = array(); |
| 100 | 100 | foreach ($files as $file) { |
| 101 | - if (str_replace($folder, '', $file) == '404' . CONTENT_EXT) { |
|
| 101 | + if (str_replace($folder, '', $file) == '404'.CONTENT_EXT) { |
|
| 102 | 102 | // jump to next page if file is the 404 page |
| 103 | 103 | continue; |
| 104 | 104 | } |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | */ |
| 136 | 136 | $meta = $page->getMeta(); |
| 137 | 137 | if ($sort['type'] === 'page') { |
| 138 | - $method = 'get' . ucfirst($key); |
|
| 138 | + $method = 'get'.ucfirst($key); |
|
| 139 | 139 | $value = $page->$method(); |
| 140 | 140 | } elseif ($sort['type'] === 'meta') { |
| 141 | 141 | $value = $meta->get($key); |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $column[] = $value; |
| 150 | 150 | } |
| 151 | 151 | $sortHelper[] = $column; |
| 152 | - $sortHelper[] = constant('SORT_' . strtoupper($sort['order'])); |
|
| 152 | + $sortHelper[] = constant('SORT_'.strtoupper($sort['order'])); |
|
| 153 | 153 | } |
| 154 | 154 | $sortHelper[] = &$pages; |
| 155 | 155 | |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | */ |
| 192 | 192 | protected function getPage($filePath, $folder = CONTENT_DIR) |
| 193 | 193 | { |
| 194 | - $key = 'Phile_Model_Page_' . md5($filePath); |
|
| 194 | + $key = 'Phile_Model_Page_'.md5($filePath); |
|
| 195 | 195 | if (isset($this->storage[$key])) { |
| 196 | 196 | return $this->storage[$key]; |
| 197 | 197 | } |
@@ -159,7 +159,7 @@ |
||
| 159 | 159 | { |
| 160 | 160 | $config = Registry::get('Phile_Settings'); |
| 161 | 161 | |
| 162 | - return md5($config['encryptionKey'] . $value); |
|
| 162 | + return md5($config['encryptionKey'].$value); |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | /** |
@@ -119,7 +119,7 @@ |
||
| 119 | 119 | public function send() |
| 120 | 120 | { |
| 121 | 121 | if (!isset($this->headers['Content-Type'])) { |
| 122 | - $this->setHeader('Content-Type', 'text/html; charset=' . $this->charset); |
|
| 122 | + $this->setHeader('Content-Type', 'text/html; charset='.$this->charset); |
|
| 123 | 123 | } |
| 124 | 124 | $this->outputHeader(); |
| 125 | 125 | http_response_code($this->statusCode); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | if (isset($this->server['HTTP_HOST'])) { |
| 84 | 84 | $host = $this->server['HTTP_HOST']; |
| 85 | 85 | $protocol = $this->getProtocol(); |
| 86 | - $url = $protocol . '://' . $host . $url; |
|
| 86 | + $url = $protocol.'://'.$host.$url; |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | $url = rtrim($url, '/'); |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | */ |
| 119 | 119 | public function url($url) |
| 120 | 120 | { |
| 121 | - return $this->getBaseUrl() . '/' . ltrim($url, '/'); |
|
| 121 | + return $this->getBaseUrl().'/'.ltrim($url, '/'); |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | * @deprecated since 2015-05-01, file will be removed |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | -require_once __DIR__ . '/lib/Phile/Bootstrap.php'; |
|
| 14 | +require_once __DIR__.'/lib/Phile/Bootstrap.php'; |
|
| 15 | 15 | |
| 16 | 16 | Bootstrap::getInstance()->initializeBasics(); |
| 17 | 17 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $settings = $this->settings; |
| 52 | 52 | |
| 53 | 53 | $content = $data['content']; |
| 54 | - $content = $this->printPhpAsMarkdown($settings) . $content; |
|
| 54 | + $content = $this->printPhpAsMarkdown($settings).$content; |
|
| 55 | 55 | |
| 56 | 56 | $page = $data['page']; |
| 57 | 57 | $page->setContent($content); |
@@ -62,6 +62,6 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | protected function printPhpAsMarkdown($input) |
| 64 | 64 | { |
| 65 | - return "\n```php\n" . trim(print_r($input, true), "\n") . "\n```\n"; |
|
| 65 | + return "\n```php\n".trim(print_r($input, true), "\n")."\n```\n"; |
|
| 66 | 66 | } |
| 67 | 67 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | $this->plugin['key'] = $pluginKey; |
| 54 | 54 | $reflection = new \ReflectionClass($this); |
| 55 | - $this->plugin['dir'] = realpath(dirname($reflection->getFileName()) . DS . '..' . DS) . DS; |
|
| 55 | + $this->plugin['dir'] = realpath(dirname($reflection->getFileName()).DS.'..'.DS).DS; |
|
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | 58 | * init events |
@@ -134,6 +134,6 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | protected function getPluginPath($subPath = '') |
| 136 | 136 | { |
| 137 | - return $this->plugin['dir'] . ltrim($subPath, DIRECTORY_SEPARATOR); |
|
| 137 | + return $this->plugin['dir'].ltrim($subPath, DIRECTORY_SEPARATOR); |
|
| 138 | 138 | } |
| 139 | 139 | } |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | { |
| 88 | 88 | list($vendor, $pluginName) = explode('\\', $pluginKey); |
| 89 | 89 | // uppercase first letter convention |
| 90 | - $pluginClassName = '\\Phile\\Plugin\\' . ucfirst($vendor) . '\\' . ucfirst($pluginName) . '\\Plugin'; |
|
| 90 | + $pluginClassName = '\\Phile\\Plugin\\'.ucfirst($vendor).'\\'.ucfirst($pluginName).'\\Plugin'; |
|
| 91 | 91 | |
| 92 | 92 | if (!class_exists($pluginClassName)) { |
| 93 | 93 | throw new PluginException( |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | { |
| 121 | 121 | if (empty(static::$pluginFolders)) { |
| 122 | 122 | spl_autoload_register( |
| 123 | - __NAMESPACE__ . '\PluginRepository::autoload' |
|
| 123 | + __NAMESPACE__.'\PluginRepository::autoload' |
|
| 124 | 124 | ); |
| 125 | 125 | } |
| 126 | 126 | static::$pluginFolders[$folder] = $folder; |
@@ -148,9 +148,9 @@ discard block |
||
| 148 | 148 | $classNameParts |
| 149 | 149 | ); |
| 150 | 150 | |
| 151 | - $path = implode(DS, $classPath) . '.php'; |
|
| 151 | + $path = implode(DS, $classPath).'.php'; |
|
| 152 | 152 | foreach (static::$pluginFolders as $folder) { |
| 153 | - $fileName = $folder . $path; |
|
| 153 | + $fileName = $folder.$path; |
|
| 154 | 154 | if (file_exists($fileName)) { |
| 155 | 155 | require_once $fileName; |
| 156 | 156 | return; |