@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | } elseif ($name === 'content') { |
| 49 | 49 | if ($this->dbHandle === null) { |
| 50 | - throw new \Exception('Document doesnt have a dbHandle handle. (path: ' . $this->path . ')'); |
|
| 50 | + throw new \Exception('Document doesnt have a dbHandle handle. (path: '.$this->path.')'); |
|
| 51 | 51 | } else { |
| 52 | 52 | if ($this->content === null) { |
| 53 | 53 | $this->getContent(); |
@@ -76,19 +76,19 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | protected function getContent() |
| 78 | 78 | { |
| 79 | - $folderPathWithWildcard = $this->path . '%'; |
|
| 79 | + $folderPathWithWildcard = $this->path.'%'; |
|
| 80 | 80 | $sql = ' SELECT * |
| 81 | 81 | FROM documents |
| 82 | - WHERE `path` LIKE ' . $this->dbHandle->quote($folderPathWithWildcard) . ' |
|
| 83 | - AND substr(`path`, ' . (strlen($this->path) + 2) . ') NOT LIKE "%/%" |
|
| 84 | - AND substr(`path`, ' . (strlen($this->path) + 1) . ', 1) = "/" |
|
| 85 | - AND path != ' . $this->dbHandle->quote($this->path) . ' |
|
| 82 | + WHERE `path` LIKE ' . $this->dbHandle->quote($folderPathWithWildcard).' |
|
| 83 | + AND substr(`path`, ' . (strlen($this->path) + 2).') NOT LIKE "%/%" |
|
| 84 | + AND substr(`path`, ' . (strlen($this->path) + 1).', 1) = "/" |
|
| 85 | + AND path != ' . $this->dbHandle->quote($this->path).' |
|
| 86 | 86 | '; |
| 87 | 87 | $stmt = $this->dbHandle->query($sql); |
| 88 | 88 | if ($stmt === false) { |
| 89 | 89 | $errorInfo = $this->dbHandle->errorInfo(); |
| 90 | 90 | $errorMsg = $errorInfo[2]; |
| 91 | - throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>'); |
|
| 91 | + throw new \Exception('SQLite Exception: '.$errorMsg.' in SQL: <br /><pre>'.$sql.'</pre>'); |
|
| 92 | 92 | } |
| 93 | 93 | $contents = $stmt->fetchAll(\PDO::FETCH_CLASS, '\library\storage\Document'); |
| 94 | 94 | foreach ($contents as $key => $document) { |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | public function __toString() |
| 107 | 107 | { |
| 108 | - return 'Document:' . $this->title; |
|
| 108 | + return 'Document:'.$this->title; |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | } elseif (is_string($imageContainer)) { |
| 36 | 36 | $this->_imageResource = imagecreatefromstring($imageContainer); |
| 37 | 37 | } else { |
| 38 | - throw new \Exception('Could not create image resource, accepted inputs are: "resource of type (gd)", path_to_image and "string". <br /><pre>' . var_export($imageContainer, true) . '</pre>'); |
|
| 38 | + throw new \Exception('Could not create image resource, accepted inputs are: "resource of type (gd)", path_to_image and "string". <br /><pre>'.var_export($imageContainer, true).'</pre>'); |
|
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | |
@@ -179,9 +179,9 @@ discard block |
||
| 179 | 179 | // Cut it in parts of 2 bytes |
| 180 | 180 | $header_parts = str_split($header, 2); |
| 181 | 181 | // Get the width 4 bytes |
| 182 | - $width = hexdec($header_parts[19] . $header_parts[18]); |
|
| 182 | + $width = hexdec($header_parts[19].$header_parts[18]); |
|
| 183 | 183 | // Get the height 4 bytes |
| 184 | - $height = hexdec($header_parts[23] . $header_parts[22]); |
|
| 184 | + $height = hexdec($header_parts[23].$header_parts[22]); |
|
| 185 | 185 | // Unset the header params |
| 186 | 186 | unset($header_parts); |
| 187 | 187 | |
@@ -226,9 +226,9 @@ discard block |
||
| 226 | 226 | } |
| 227 | 227 | // Calculation of the RGB-pixel (defined as BGR in image-data). Define $iPos as absolute position in the body |
| 228 | 228 | $iPos = $i * 2; |
| 229 | - $r = hexdec($body[$iPos + 4] . $body[$iPos + 5]); |
|
| 230 | - $g = hexdec($body[$iPos + 2] . $body[$iPos + 3]); |
|
| 231 | - $b = hexdec($body[$iPos] . $body[$iPos + 1]); |
|
| 229 | + $r = hexdec($body[$iPos + 4].$body[$iPos + 5]); |
|
| 230 | + $g = hexdec($body[$iPos + 2].$body[$iPos + 3]); |
|
| 231 | + $b = hexdec($body[$iPos].$body[$iPos + 1]); |
|
| 232 | 232 | // Calculate and draw the pixel |
| 233 | 233 | $color = imagecolorallocate($image, $r, $g, $b); |
| 234 | 234 | imagesetpixel($image, $x, $height - $y, $color); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | return $returnFileNames; |
| 45 | 45 | } else { |
| 46 | - throw new \Exception('Image doesnt exist: ' . $imagePath); |
|
| 46 | + throw new \Exception('Image doesnt exist: '.$imagePath); |
|
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | 49 | |
@@ -54,10 +54,10 @@ discard block |
||
| 54 | 54 | * @return string |
| 55 | 55 | * @throws \Exception |
| 56 | 56 | */ |
| 57 | - public function resize($imagePath='', $width='',$height='') |
|
| 57 | + public function resize($imagePath = '', $width = '', $height = '') |
|
| 58 | 58 | { |
| 59 | - $modifier = '-r' . $width . 'x' . $height; |
|
| 60 | - return $this->applyMethod('Resize', $imagePath, $width,$height, $modifier); |
|
| 59 | + $modifier = '-r'.$width.'x'.$height; |
|
| 60 | + return $this->applyMethod('Resize', $imagePath, $width, $height, $modifier); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -67,10 +67,10 @@ discard block |
||
| 67 | 67 | * @return string |
| 68 | 68 | * @throws \Exception |
| 69 | 69 | */ |
| 70 | - public function smartcrop($imagePath='', $width='',$height='') |
|
| 70 | + public function smartcrop($imagePath = '', $width = '', $height = '') |
|
| 71 | 71 | { |
| 72 | - $modifier = '-s' . $width . 'x' . $height; |
|
| 73 | - return $this->applyMethod('SmartCrop', $imagePath, $width,$height, $modifier); |
|
| 72 | + $modifier = '-s'.$width.'x'.$height; |
|
| 73 | + return $this->applyMethod('SmartCrop', $imagePath, $width, $height, $modifier); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |
@@ -80,10 +80,10 @@ discard block |
||
| 80 | 80 | * @return string |
| 81 | 81 | * @throws \Exception |
| 82 | 82 | */ |
| 83 | - public function boxcrop($imagePath='', $width='',$height='') |
|
| 83 | + public function boxcrop($imagePath = '', $width = '', $height = '') |
|
| 84 | 84 | { |
| 85 | - $modifier = '-b' . $width . 'x' . $height; |
|
| 86 | - return $this->applyMethod('BoxCrop', $imagePath, $width,$height, $modifier); |
|
| 85 | + $modifier = '-b'.$width.'x'.$height; |
|
| 86 | + return $this->applyMethod('BoxCrop', $imagePath, $width, $height, $modifier); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | * |
| 93 | 93 | * @return string |
| 94 | 94 | */ |
| 95 | - private function modifyName($imagePath, $modifier='') |
|
| 95 | + private function modifyName($imagePath, $modifier = '') |
|
| 96 | 96 | { |
| 97 | 97 | $filename = basename($imagePath); |
| 98 | 98 | $path = dirname($imagePath); |
@@ -102,30 +102,30 @@ discard block |
||
| 102 | 102 | array_pop($fileParts); |
| 103 | 103 | $fileNameWithoutExtension = implode('-', $fileParts); |
| 104 | 104 | $fileNameWithoutExtension = slugify($fileNameWithoutExtension); |
| 105 | - $filename = $fileNameWithoutExtension . $modifier . '.' . $extension; |
|
| 105 | + $filename = $fileNameWithoutExtension.$modifier.'.'.$extension; |
|
| 106 | 106 | } else { |
| 107 | 107 | $filename = slugify($filename); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - if (file_exists($path . '/' . $filename)) { |
|
| 110 | + if (file_exists($path.'/'.$filename)) { |
|
| 111 | 111 | $fileParts = explode('.', $filename); |
| 112 | 112 | if (count($fileParts) > 1) { |
| 113 | 113 | $extension = end($fileParts); |
| 114 | 114 | array_pop($fileParts); |
| 115 | 115 | $fileNameWithoutExtension = implode('-', $fileParts); |
| 116 | 116 | $fileNameWithoutExtension .= '-copy'; |
| 117 | - $filename = $fileNameWithoutExtension . '.' . $extension; |
|
| 117 | + $filename = $fileNameWithoutExtension.'.'.$extension; |
|
| 118 | 118 | } else { |
| 119 | 119 | $filename .= '-copy'; |
| 120 | 120 | } |
| 121 | - return $this->modifyName($path . '/' . $filename); |
|
| 121 | + return $this->modifyName($path.'/'.$filename); |
|
| 122 | 122 | } |
| 123 | - return $path . '/' . $filename; |
|
| 123 | + return $path.'/'.$filename; |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | private function applyMethod($method, $imagePath, $width, $height, $modifier) |
| 127 | 127 | { |
| 128 | - $method = 'library\\images\\methods\\' . $method; |
|
| 128 | + $method = 'library\\images\\methods\\'.$method; |
|
| 129 | 129 | $destination = $this->modifyName($imagePath, $modifier); |
| 130 | 130 | if (file_exists($imagePath)) { |
| 131 | 131 | $image = new Image(); |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | $resizedImage->saveImage($destination, $resizedImage->getImageMimeType($imagePath), 80); |
| 140 | 140 | return basename($destination); |
| 141 | 141 | } else { |
| 142 | - throw new \Exception('Image doesnt exist: ' . $imagePath); |
|
| 142 | + throw new \Exception('Image doesnt exist: '.$imagePath); |
|
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | private function config() |
| 65 | 65 | { |
| 66 | - $configPath = __DIR__ . '/../../config.json'; |
|
| 66 | + $configPath = __DIR__.'/../../config.json'; |
|
| 67 | 67 | if (realpath($configPath) !== false) { |
| 68 | 68 | $json = file_get_contents($configPath); |
| 69 | 69 | $this->config = json_decode($json); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | private function sitemapMatching($request) |
| 91 | 91 | { |
| 92 | 92 | $sitemap = $this->storage->getSitemap()->getSitemap(); |
| 93 | - $relativeUri = '/' . $request::$relativeUri; |
|
| 93 | + $relativeUri = '/'.$request::$relativeUri; |
|
| 94 | 94 | |
| 95 | 95 | foreach ($sitemap as $sitemapItem) { |
| 96 | 96 | if ($sitemapItem->regex) { |
@@ -153,17 +153,17 @@ discard block |
||
| 153 | 153 | * @return mixed |
| 154 | 154 | * @throws \Exception |
| 155 | 155 | */ |
| 156 | - private function getComponentObject($class='', $template='', $parameters=array(), $matchedSitemapItem) |
|
| 156 | + private function getComponentObject($class = '', $template = '', $parameters = array(), $matchedSitemapItem) |
|
| 157 | 157 | { |
| 158 | - $libraryComponentName = '\\library\\components\\' . $class; |
|
| 159 | - $userComponentName = '\\components\\' . $class; |
|
| 158 | + $libraryComponentName = '\\library\\components\\'.$class; |
|
| 159 | + $userComponentName = '\\components\\'.$class; |
|
| 160 | 160 | |
| 161 | 161 | if (AutoloadUtil::autoLoad($libraryComponentName, false)) { |
| 162 | 162 | $component = new $libraryComponentName($template, $this->request, $parameters, $matchedSitemapItem); |
| 163 | 163 | } elseif (AutoloadUtil::autoLoad($userComponentName, false)) { |
| 164 | 164 | $component = new $userComponentName($template, $this->request, $parameters, $matchedSitemapItem); |
| 165 | 165 | } else { |
| 166 | - throw new \Exception('Could not load component ' . $class); |
|
| 166 | + throw new \Exception('Could not load component '.$class); |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | if (!$component instanceof Component) { |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | public function setCachingHeaders() |
| 223 | 223 | { |
| 224 | 224 | header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60 * 24 * 2))); // 2 days |
| 225 | - header("Cache-Control: max-age=" . (60 * 60 * 24 * 2)); |
|
| 225 | + header("Cache-Control: max-age=".(60 * 60 * 24 * 2)); |
|
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | /** |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_SITEMAP); |
| 58 | 58 | if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$post[CmsComponent::POST_PARAMETER_TEMPLATE], $request::$post[CmsComponent::POST_PARAMETER_COMPONENT])) { |
| 59 | 59 | $cmsComponent->storage->getSitemap()->addSitemapItem($request::$post); |
| 60 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/sitemap'); |
|
| 60 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/sitemap'); |
|
| 61 | 61 | exit; |
| 62 | 62 | } |
| 63 | 63 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | $sitemapItem = $cmsComponent->storage->getSitemap()->getSitemapItemBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]); |
| 74 | 74 | if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$post[CmsComponent::POST_PARAMETER_TEMPLATE], $request::$post[CmsComponent::POST_PARAMETER_COMPONENT])) { |
| 75 | 75 | $cmsComponent->storage->getSitemap()->saveSitemapItem($request::$get[CmsComponent::GET_PARAMETER_SLUG], $request::$post); |
| 76 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/sitemap'); |
|
| 76 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/sitemap'); |
|
| 77 | 77 | exit; |
| 78 | 78 | } |
| 79 | 79 | $cmsComponent->setParameter(CmsComponent::PARAMETER_SITEMAP_ITEM, $sitemapItem); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | private function deleteRoute($request, $cmsComponent) |
| 87 | 87 | { |
| 88 | 88 | $cmsComponent->storage->getSitemap()->deleteSitemapItemBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]); |
| 89 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/sitemap'); |
|
| 89 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/sitemap'); |
|
| 90 | 90 | exit; |
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | \ No newline at end of file |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_IMAGES); |
| 65 | 65 | if (isset($_FILES[CmsComponent::FILES_PARAMETER_FILE])) { |
| 66 | 66 | $cmsComponent->storage->getImages()->addImage($_FILES[CmsComponent::FILES_PARAMETER_FILE]); |
| 67 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/images'); |
|
| 67 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/images'); |
|
| 68 | 68 | exit; |
| 69 | 69 | } |
| 70 | 70 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | private function deleteRoute($request, $cmsComponent) |
| 77 | 77 | { |
| 78 | 78 | $cmsComponent->storage->getImages()->deleteImageByName($request::$get[CmsComponent::FILES_PARAMETER_FILE]); |
| 79 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/images'); |
|
| 79 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/images'); |
|
| 80 | 80 | exit; |
| 81 | 81 | } |
| 82 | 82 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $imageSet = $cmsComponent->storage->getImageSet()->getImageSetBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]); |
| 57 | 57 | if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE])) { |
| 58 | 58 | $cmsComponent->storage->getImageSet()->saveImageSet($request::$get[CmsComponent::GET_PARAMETER_SLUG], $request::$post); |
| 59 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/image-set'); |
|
| 59 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/image-set'); |
|
| 60 | 60 | exit; |
| 61 | 61 | } |
| 62 | 62 | $cmsComponent->setParameter(CmsComponent::PARAMETER_IMAGE_SET, $imageSet); |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_CONFIGURATION); |
| 73 | 73 | if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE])) { |
| 74 | 74 | $cmsComponent->storage->getImageSet()->addImageSet($request::$post); |
| 75 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/image-set'); |
|
| 75 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/image-set'); |
|
| 76 | 76 | exit; |
| 77 | 77 | } |
| 78 | 78 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | private function deleteRoute($request, $cmsComponent) |
| 85 | 85 | { |
| 86 | 86 | $cmsComponent->storage->getImageSet()->deleteImageSetBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]); |
| 87 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/image-set'); |
|
| 87 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/image-set'); |
|
| 88 | 88 | exit; |
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | \ No newline at end of file |
@@ -33,13 +33,13 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | public function addImage($postValues) |
| 35 | 35 | { |
| 36 | - $destinationPath = realpath(__DIR__ . '/../../../www/images/'); |
|
| 36 | + $destinationPath = realpath(__DIR__.'/../../../www/images/'); |
|
| 37 | 37 | |
| 38 | 38 | $filename = $this->validateFilename($postValues['name'], $destinationPath); |
| 39 | - $destination = $destinationPath . '/' . $filename; |
|
| 39 | + $destination = $destinationPath.'/'.$filename; |
|
| 40 | 40 | |
| 41 | 41 | if ($postValues['error'] != '0') { |
| 42 | - throw new \Exception('Error uploading file. Error code: ' . $postValues['error']); |
|
| 42 | + throw new \Exception('Error uploading file. Error code: '.$postValues['error']); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | if (move_uploaded_file($postValues['tmp_name'], $destination)) { |
@@ -64,14 +64,14 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function deleteImageByName($filename) |
| 66 | 66 | { |
| 67 | - $destinationPath = realpath(__DIR__ . '/../../../www/images/'); |
|
| 67 | + $destinationPath = realpath(__DIR__.'/../../../www/images/'); |
|
| 68 | 68 | |
| 69 | 69 | $images = $this->getImages(); |
| 70 | 70 | |
| 71 | 71 | foreach ($images as $key => $image) { |
| 72 | 72 | if ($image->file == $filename) { |
| 73 | 73 | foreach ($image->set as $imageSetFilename) { |
| 74 | - $destination = $destinationPath . '/' . $imageSetFilename; |
|
| 74 | + $destination = $destinationPath.'/'.$imageSetFilename; |
|
| 75 | 75 | if (file_exists($destination)) { |
| 76 | 76 | unlink($destination); |
| 77 | 77 | } else { |
@@ -39,21 +39,21 @@ discard block |
||
| 39 | 39 | private function downloadRoute($slug, $cmsComponent) |
| 40 | 40 | { |
| 41 | 41 | $file = $cmsComponent->storage->getFiles()->getFileByName($slug); |
| 42 | - $path = realpath(__DIR__ . '/../../../www/files/'); |
|
| 43 | - $quoted = sprintf('"%s"', addcslashes(basename($path . '/' . $file->file), '"\\')); |
|
| 44 | - $size = filesize($path . '/' . $file->file); |
|
| 42 | + $path = realpath(__DIR__.'/../../../www/files/'); |
|
| 43 | + $quoted = sprintf('"%s"', addcslashes(basename($path.'/'.$file->file), '"\\')); |
|
| 44 | + $size = filesize($path.'/'.$file->file); |
|
| 45 | 45 | |
| 46 | 46 | header('Content-Description: File Transfer'); |
| 47 | - header('Content-Type: ' . $file->type); |
|
| 48 | - header('Content-Disposition: attachment; filename=' . $quoted); |
|
| 47 | + header('Content-Type: '.$file->type); |
|
| 48 | + header('Content-Disposition: attachment; filename='.$quoted); |
|
| 49 | 49 | header('Content-Transfer-Encoding: binary'); |
| 50 | 50 | header('Connection: Keep-Alive'); |
| 51 | 51 | header('Expires: 0'); |
| 52 | 52 | header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
| 53 | 53 | header('Pragma: public'); |
| 54 | - header('Content-Length: ' . $size); |
|
| 54 | + header('Content-Length: '.$size); |
|
| 55 | 55 | |
| 56 | - readfile($path . '/' . $file->file); |
|
| 56 | + readfile($path.'/'.$file->file); |
|
| 57 | 57 | exit; |
| 58 | 58 | } |
| 59 | 59 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_FILES); |
| 78 | 78 | if (isset($_FILES[CmsComponent::FILES_PARAMETER_FILE])) { |
| 79 | 79 | $cmsComponent->storage->getFiles()->addFile($_FILES[CmsComponent::FILES_PARAMETER_FILE]); |
| 80 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/files'); |
|
| 80 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/files'); |
|
| 81 | 81 | exit; |
| 82 | 82 | } |
| 83 | 83 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | private function deleteRoute($request, $cmsComponent) |
| 90 | 90 | { |
| 91 | 91 | $cmsComponent->storage->getFiles()->deleteFileByName($request::$get[CmsComponent::FILES_PARAMETER_FILE]); |
| 92 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/files'); |
|
| 92 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/files'); |
|
| 93 | 93 | exit; |
| 94 | 94 | } |
| 95 | 95 | |