@@ -25,5 +25,5 @@ |
||
| 25 | 25 | \CloudControl\Cms\CloudControl::run(); |
| 26 | 26 | |
| 27 | 27 | if (php_sapi_name() != "cli") { |
| 28 | - ob_end_flush(); |
|
| 28 | + ob_end_flush(); |
|
| 29 | 29 | } |
| 30 | 30 | \ No newline at end of file |
@@ -12,10 +12,10 @@ |
||
| 12 | 12 | namespace CloudControl\Cms\images\methods |
| 13 | 13 | { |
| 14 | 14 | |
| 15 | - use CloudControl\Cms\images\Image; |
|
| 16 | - use CloudControl\Cms\images\IMethod; |
|
| 15 | + use CloudControl\Cms\images\Image; |
|
| 16 | + use CloudControl\Cms\images\IMethod; |
|
| 17 | 17 | |
| 18 | - class Watermark extends IMethod |
|
| 18 | + class Watermark extends IMethod |
|
| 19 | 19 | { |
| 20 | 20 | protected $_x = 0; |
| 21 | 21 | protected $_y = 0; |
@@ -63,7 +63,9 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | protected function calculateX($imageResource) |
| 65 | 65 | { |
| 66 | - if (intval($this->_x) === $this->_x) return $this->_x; |
|
| 66 | + if (intval($this->_x) === $this->_x) { |
|
| 67 | + return $this->_x; |
|
| 68 | + } |
|
| 67 | 69 | |
| 68 | 70 | $x = strtolower($this->_x); |
| 69 | 71 | |
@@ -88,7 +90,9 @@ discard block |
||
| 88 | 90 | */ |
| 89 | 91 | public function calculateY($imageResource) |
| 90 | 92 | { |
| 91 | - if (intval($this->_y) === $this->_y) return $this->_y; |
|
| 93 | + if (intval($this->_y) === $this->_y) { |
|
| 94 | + return $this->_y; |
|
| 95 | + } |
|
| 92 | 96 | |
| 93 | 97 | $y = strtolower($this->_y); |
| 94 | 98 | |
@@ -125,7 +129,9 @@ discard block |
||
| 125 | 129 | */ |
| 126 | 130 | public function GetWatermark() |
| 127 | 131 | { |
| 128 | - if ($this->_watermark == null) throw new \Exception('A watermark is not set. Please supply a \CloudControl\Cms\image\Image using $this->SetWatermark'); |
|
| 132 | + if ($this->_watermark == null) { |
|
| 133 | + throw new \Exception('A watermark is not set. Please supply a \CloudControl\Cms\image\Image using $this->SetWatermark'); |
|
| 134 | + } |
|
| 129 | 135 | return $this->_watermark; |
| 130 | 136 | } |
| 131 | 137 | |
@@ -11,9 +11,9 @@ discard block |
||
| 11 | 11 | namespace CloudControl\Cms\images\methods |
| 12 | 12 | { |
| 13 | 13 | |
| 14 | - use CloudControl\Cms\images\IMethod; |
|
| 14 | + use CloudControl\Cms\images\IMethod; |
|
| 15 | 15 | |
| 16 | - class Crop extends IMethod |
|
| 16 | + class Crop extends IMethod |
|
| 17 | 17 | { |
| 18 | 18 | protected $_width; |
| 19 | 19 | protected $_height; |
@@ -116,8 +116,8 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | // Preserve transparency |
| 118 | 118 | imagecolortransparent($new, imagecolorallocatealpha($new, 0, 0, 0, 127)); |
| 119 | - imagealphablending($new, false); |
|
| 120 | - imagesavealpha($new, true); |
|
| 119 | + imagealphablending($new, false); |
|
| 120 | + imagesavealpha($new, true); |
|
| 121 | 121 | |
| 122 | 122 | imagecopyresampled($new, $imageResource, $this->_destX, $this->_destY, $this->_x, $this->_y, $this->_destWidth, $this->_destHeight, $this->_destWidth, $this->_destHeight); |
| 123 | 123 | |
@@ -11,9 +11,9 @@ |
||
| 11 | 11 | namespace CloudControl\Cms\images\methods |
| 12 | 12 | { |
| 13 | 13 | |
| 14 | - use CloudControl\Cms\images\IMethod; |
|
| 14 | + use CloudControl\Cms\images\IMethod; |
|
| 15 | 15 | |
| 16 | - class Resize extends IMethod |
|
| 16 | + class Resize extends IMethod |
|
| 17 | 17 | { |
| 18 | 18 | protected $_width; |
| 19 | 19 | protected $_height; |
@@ -62,8 +62,8 @@ |
||
| 62 | 62 | |
| 63 | 63 | // Preserve transparency |
| 64 | 64 | imagecolortransparent($new, imagecolorallocatealpha($new, 0, 0, 0, 127)); |
| 65 | - imagealphablending($new, false); |
|
| 66 | - imagesavealpha($new, true); |
|
| 65 | + imagealphablending($new, false); |
|
| 66 | + imagesavealpha($new, true); |
|
| 67 | 67 | |
| 68 | 68 | imagecopyresampled($new, $imageResource, $this->_destX, $this->_destY, $this->_x, $this->_y, $this->_destWidth, $this->_destHeight, $originalWidth, $originalHeight); |
| 69 | 69 | |
@@ -40,7 +40,9 @@ |
||
| 40 | 40 | |
| 41 | 41 | // Define which ratio will be used, depending on which is the biggest side |
| 42 | 42 | $ratio = $wRatio < $hRatio ? $wRatio : $hRatio; |
| 43 | - if ($ratio < 1) $ratio = 1; |
|
| 43 | + if ($ratio < 1) { |
|
| 44 | + $ratio = 1; |
|
| 45 | + } |
|
| 44 | 46 | |
| 45 | 47 | // Calculate the destination width, height, x and y |
| 46 | 48 | $this->_destWidth = $originalWidth / $ratio; |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | /** |
| 18 | 18 | * @param resource $imageResource |
| 19 | 19 | * @return resource |
| 20 | - */ |
|
| 20 | + */ |
|
| 21 | 21 | public function Execute($imageResource) |
| 22 | 22 | { |
| 23 | 23 | // Define the origial width and height |
@@ -26,7 +26,9 @@ |
||
| 26 | 26 | |
| 27 | 27 | // Define which ratio will be used, depending on which is the smallest side |
| 28 | 28 | $ratio = min($hRatio, $wRatio); |
| 29 | - if($ratio > 1) $ratio = 1; |
|
| 29 | + if($ratio > 1) { |
|
| 30 | + $ratio = 1; |
|
| 31 | + } |
|
| 30 | 32 | |
| 31 | 33 | // Define sizes |
| 32 | 34 | $this->_destWidth = floor($originalWidth * $ratio); |
@@ -9,9 +9,9 @@ |
||
| 9 | 9 | namespace CloudControl\Cms\images\methods |
| 10 | 10 | { |
| 11 | 11 | |
| 12 | - use CloudControl\Cms\images\IMethod; |
|
| 12 | + use CloudControl\Cms\images\IMethod; |
|
| 13 | 13 | |
| 14 | - class Grayscale extends IMethod |
|
| 14 | + class Grayscale extends IMethod |
|
| 15 | 15 | { |
| 16 | 16 | public function Execute($imageResource) |
| 17 | 17 | { |
@@ -2,9 +2,9 @@ |
||
| 2 | 2 | namespace CloudControl\Cms\images |
| 3 | 3 | { |
| 4 | 4 | |
| 5 | - use CloudControl\Cms\cc\StringUtil; |
|
| 5 | + use CloudControl\Cms\cc\StringUtil; |
|
| 6 | 6 | |
| 7 | - /** |
|
| 7 | + /** |
|
| 8 | 8 | * Class ImageResizer |
| 9 | 9 | * @package CloudControl\Cms\images |
| 10 | 10 | */ |
@@ -1,10 +1,10 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace CloudControl\Cms\cc |
| 3 | 3 | { |
| 4 | - /** |
|
| 5 | - * Class Request |
|
| 6 | - * @package CloudControl\Cms\cc |
|
| 7 | - */ |
|
| 4 | + /** |
|
| 5 | + * Class Request |
|
| 6 | + * @package CloudControl\Cms\cc |
|
| 7 | + */ |
|
| 8 | 8 | class Request { |
| 9 | 9 | |
| 10 | 10 | /** |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | public function __construct() |
| 47 | 47 | { |
| 48 | - $rootPath = str_replace('\\', '/', realpath(str_replace('\\', '/', dirname(__FILE__)) . '/../../') . '/'); |
|
| 48 | + $rootPath = str_replace('\\', '/', realpath(str_replace('\\', '/', dirname(__FILE__)) . '/../../') . '/'); |
|
| 49 | 49 | |
| 50 | 50 | self::$subfolders = '/' . str_replace('//', '/', str_replace(str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']), "", $rootPath)); |
| 51 | 51 | self::$subfolders = str_replace('//', '/', self::$subfolders); |