@@ -1,16 +1,16 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project |
| 4 | - * |
|
| 5 | - * @desc GraphicsMagick image driver class |
|
| 6 | - * @package KCFinder |
|
| 7 | - * @version 2.54 |
|
| 8 | - * @author Pavel Tzonkov <[email protected]> |
|
| 9 | - * @copyright 2010-2014 KCFinder Project |
|
| 10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | - * @link http://kcfinder.sunhater.com |
|
| 13 | - */ |
|
| 4 | + * |
|
| 5 | + * @desc GraphicsMagick image driver class |
|
| 6 | + * @package KCFinder |
|
| 7 | + * @version 2.54 |
|
| 8 | + * @author Pavel Tzonkov <[email protected]> |
|
| 9 | + * @copyright 2010-2014 KCFinder Project |
|
| 10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | + * @link http://kcfinder.sunhater.com |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | class image_gmagick extends image |
| 16 | 16 | { |
@@ -1,30 +1,30 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project |
| 4 | - * |
|
| 5 | - * @desc Input class for GET, POST and COOKIE requests |
|
| 6 | - * @package KCFinder |
|
| 7 | - * @version 2.54 |
|
| 8 | - * @author Pavel Tzonkov <[email protected]> |
|
| 9 | - * @copyright 2010-2014 KCFinder Project |
|
| 10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | - * @link http://kcfinder.sunhater.com |
|
| 13 | - */ |
|
| 4 | + * |
|
| 5 | + * @desc Input class for GET, POST and COOKIE requests |
|
| 6 | + * @package KCFinder |
|
| 7 | + * @version 2.54 |
|
| 8 | + * @author Pavel Tzonkov <[email protected]> |
|
| 9 | + * @copyright 2010-2014 KCFinder Project |
|
| 10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | + * @link http://kcfinder.sunhater.com |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | class input |
| 16 | 16 | { |
| 17 | 17 | |
| 18 | - /** Filtered $_GET array |
|
| 19 | - * @var array */ |
|
| 18 | + /** Filtered $_GET array |
|
| 19 | + * @var array */ |
|
| 20 | 20 | public $get; |
| 21 | 21 | |
| 22 | 22 | /** Filtered $_POST array |
| 23 | - * @var array */ |
|
| 23 | + * @var array */ |
|
| 24 | 24 | public $post; |
| 25 | 25 | |
| 26 | 26 | /** Filtered $_COOKIE array |
| 27 | - * @var array */ |
|
| 27 | + * @var array */ |
|
| 28 | 28 | public $cookie; |
| 29 | 29 | |
| 30 | 30 | public function __construct() |
@@ -35,8 +35,8 @@ discard block |
||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** Magic method to get non-public properties like public. |
| 38 | - * @param string $property |
|
| 39 | - * @return mixed */ |
|
| 38 | + * @param string $property |
|
| 39 | + * @return mixed */ |
|
| 40 | 40 | |
| 41 | 41 | public function __get($property) |
| 42 | 42 | { |
@@ -1,45 +1,45 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project |
| 4 | - * |
|
| 5 | - * @desc GD extension class |
|
| 6 | - * @package KCFinder |
|
| 7 | - * @version 2.51 |
|
| 8 | - * @author Pavel Tzonkov <[email protected]> |
|
| 9 | - * @copyright 2010, 2011 KCFinder Project |
|
| 10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | - * @link http://kcfinder.sunhater.com |
|
| 13 | - */ |
|
| 4 | + * |
|
| 5 | + * @desc GD extension class |
|
| 6 | + * @package KCFinder |
|
| 7 | + * @version 2.51 |
|
| 8 | + * @author Pavel Tzonkov <[email protected]> |
|
| 9 | + * @copyright 2010, 2011 KCFinder Project |
|
| 10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | + * @link http://kcfinder.sunhater.com |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | class gd |
| 16 | 16 | {
|
| 17 | 17 | |
| 18 | - /** GD resource |
|
| 19 | - * @var resource */ |
|
| 18 | + /** GD resource |
|
| 19 | + * @var resource */ |
|
| 20 | 20 | protected $image; |
| 21 | 21 | |
| 22 | 22 | /** Image width |
| 23 | - * @var integer */ |
|
| 23 | + * @var integer */ |
|
| 24 | 24 | protected $width; |
| 25 | 25 | |
| 26 | 26 | /** Image height |
| 27 | - * @var integer */ |
|
| 27 | + * @var integer */ |
|
| 28 | 28 | protected $height; |
| 29 | 29 | |
| 30 | 30 | /** Init error |
| 31 | - * @var bool */ |
|
| 31 | + * @var bool */ |
|
| 32 | 32 | public $init_error = false; |
| 33 | 33 | |
| 34 | 34 | /** Last builded image type constant (IMAGETYPE_XXX) |
| 35 | - * @var integer */ |
|
| 35 | + * @var integer */ |
|
| 36 | 36 | public $type; |
| 37 | 37 | |
| 38 | 38 | /** Returns an array. Element 0 - GD resource. Element 1 - width. Element 2 - height. |
| 39 | - * Returns FALSE on failure. The only one parameter $image can be an instance of this class, |
|
| 40 | - * a GD resource, an array(width, height) or path to image file. |
|
| 41 | - * @param mixed $image |
|
| 42 | - * @return array */ |
|
| 39 | + * Returns FALSE on failure. The only one parameter $image can be an instance of this class, |
|
| 40 | + * a GD resource, an array(width, height) or path to image file. |
|
| 41 | + * @param mixed $image |
|
| 42 | + * @return array */ |
|
| 43 | 43 | |
| 44 | 44 | protected function build_image($image) |
| 45 | 45 | {
|
@@ -88,15 +88,15 @@ discard block |
||
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** Parameter $image can be: |
| 91 | - * 1. An instance of this class (copy instance). |
|
| 92 | - * 2. A GD resource. |
|
| 93 | - * 3. An array with two elements. First - width, second - height. Create a blank image. |
|
| 94 | - * 4. A filename string. Get image form file. |
|
| 95 | - * The non-required parameter $bigger_size is the bigger dimension (width or height) the image |
|
| 96 | - * will be resized to. The other dimension (height or width) will be calculated autamaticaly |
|
| 97 | - * @param mixed $image |
|
| 98 | - * @param integer $bigger_size |
|
| 99 | - * @return gd */ |
|
| 91 | + * 1. An instance of this class (copy instance). |
|
| 92 | + * 2. A GD resource. |
|
| 93 | + * 3. An array with two elements. First - width, second - height. Create a blank image. |
|
| 94 | + * 4. A filename string. Get image form file. |
|
| 95 | + * The non-required parameter $bigger_size is the bigger dimension (width or height) the image |
|
| 96 | + * will be resized to. The other dimension (height or width) will be calculated autamaticaly |
|
| 97 | + * @param mixed $image |
|
| 98 | + * @param integer $bigger_size |
|
| 99 | + * @return gd */ |
|
| 100 | 100 | |
| 101 | 101 | public function __construct($image, $bigger_size=null) |
| 102 | 102 | {
|
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | /** Returns the GD resource |
| 129 | - * @return resource */ |
|
| 129 | + * @return resource */ |
|
| 130 | 130 | |
| 131 | 131 | public function get_image() |
| 132 | 132 | {
|
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | /** Returns the image width |
| 137 | - * @return integer */ |
|
| 137 | + * @return integer */ |
|
| 138 | 138 | |
| 139 | 139 | public function get_width() |
| 140 | 140 | {
|
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | /** Returns the image height |
| 145 | - * @return integer */ |
|
| 145 | + * @return integer */ |
|
| 146 | 146 | |
| 147 | 147 | public function get_height() |
| 148 | 148 | {
|
@@ -150,8 +150,8 @@ discard block |
||
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | /** Returns calculated proportional width from the given height |
| 153 | - * @param integer $resized_height |
|
| 154 | - * @return integer */ |
|
| 153 | + * @param integer $resized_height |
|
| 154 | + * @return integer */ |
|
| 155 | 155 | |
| 156 | 156 | public function get_prop_width($resized_height) |
| 157 | 157 | {
|
@@ -163,8 +163,8 @@ discard block |
||
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | /** Returns calculated proportional height from the given width |
| 166 | - * @param integer $resized_width |
|
| 167 | - * @return integer */ |
|
| 166 | + * @param integer $resized_width |
|
| 167 | + * @return integer */ |
|
| 168 | 168 | |
| 169 | 169 | public function get_prop_height($resized_width) |
| 170 | 170 | {
|
@@ -176,10 +176,10 @@ discard block |
||
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | /** Returns an array with calculated proportional width & height. |
| 179 | - * The parameter $bigger_size is the bigger dimension (width or height) of calculated sizes. |
|
| 180 | - * The other dimension (height or width) will be calculated autamaticaly |
|
| 181 | - * @param integer $bigger_size |
|
| 182 | - * @return array */ |
|
| 179 | + * The parameter $bigger_size is the bigger dimension (width or height) of calculated sizes. |
|
| 180 | + * The other dimension (height or width) will be calculated autamaticaly |
|
| 181 | + * @param integer $bigger_size |
|
| 182 | + * @return array */ |
|
| 183 | 183 | |
| 184 | 184 | public function get_prop_size($bigger_size) |
| 185 | 185 | {
|
@@ -197,9 +197,9 @@ discard block |
||
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | /** Resize image. Returns TRUE on success or FALSE on failure |
| 200 | - * @param integer $width |
|
| 201 | - * @param integer $height |
|
| 202 | - * @return bool */ |
|
| 200 | + * @param integer $width |
|
| 201 | + * @param integer $height |
|
| 202 | + * @return bool */ |
|
| 203 | 203 | |
| 204 | 204 | public function resize($width, $height) |
| 205 | 205 | {
|
@@ -219,9 +219,9 @@ discard block |
||
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | /** Resize the given image source (GD, gd object or image file path) to fit in the own image. |
| 222 | - * The outside ares will be cropped out. Returns TRUE on success or FALSE on failure |
|
| 223 | - * @param mixed $src |
|
| 224 | - * @return bool */ |
|
| 222 | + * The outside ares will be cropped out. Returns TRUE on success or FALSE on failure |
|
| 223 | + * @param mixed $src |
|
| 224 | + * @return bool */ |
|
| 225 | 225 | |
| 226 | 226 | public function resize_crop($src) |
| 227 | 227 | {
|
@@ -249,9 +249,9 @@ discard block |
||
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | /** Resize image to fit in given resolution. Returns TRUE on success or FALSE on failure |
| 252 | - * @param integer $width |
|
| 253 | - * @param integer $height |
|
| 254 | - * @return bool */ |
|
| 252 | + * @param integer $width |
|
| 253 | + * @param integer $height |
|
| 254 | + * @return bool */ |
|
| 255 | 255 | |
| 256 | 256 | public function resize_fit($width, $height) |
| 257 | 257 | {
|
@@ -273,11 +273,11 @@ discard block |
||
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | /** Neka si predstavim vyobrazhaem pravoygylnik s razmeri $width i $height. |
| 276 | - * Izobrazhenieto shte se preorazmeri taka che to shte izliza ot tozi pravoygylnik, |
|
| 277 | - * no samo po edno (x ili y) izmerenie |
|
| 278 | - * @param integer $width |
|
| 279 | - * @param integer $height |
|
| 280 | - * @return bool */ |
|
| 276 | + * Izobrazhenieto shte se preorazmeri taka che to shte izliza ot tozi pravoygylnik, |
|
| 277 | + * no samo po edno (x ili y) izmerenie |
|
| 278 | + * @param integer $width |
|
| 279 | + * @param integer $height |
|
| 280 | + * @return bool */ |
|
| 281 | 281 | |
| 282 | 282 | public function resize_overflow($width, $height) |
| 283 | 283 | {
|
@@ -1,16 +1,16 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project |
| 4 | - * |
|
| 5 | - * @desc ImageMagick image driver class |
|
| 6 | - * @package KCFinder |
|
| 7 | - * @version 2.54 |
|
| 8 | - * @author Pavel Tzonkov <[email protected]> |
|
| 9 | - * @copyright 2010-2014 KCFinder Project |
|
| 10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | - * @link http://kcfinder.sunhater.com |
|
| 13 | - */ |
|
| 4 | + * |
|
| 5 | + * @desc ImageMagick image driver class |
|
| 6 | + * @package KCFinder |
|
| 7 | + * @version 2.54 |
|
| 8 | + * @author Pavel Tzonkov <[email protected]> |
|
| 9 | + * @copyright 2010-2014 KCFinder Project |
|
| 10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | + * @link http://kcfinder.sunhater.com |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | class image_imagick extends image |
| 16 | 16 | { |
@@ -1,17 +1,17 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project. The class are taken from |
| 4 | - * http://www.php.net/manual/en/function.ziparchive-addemptydir.php |
|
| 5 | - * |
|
| 6 | - * @desc Directory to ZIP file archivator |
|
| 7 | - * @package KCFinder |
|
| 8 | - * @version 2.54 |
|
| 9 | - * @author Pavel Tzonkov <[email protected]> |
|
| 10 | - * @copyright 2010-2014 KCFinder Project |
|
| 11 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 12 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 13 | - * @link http://kcfinder.sunhater.com |
|
| 14 | - */ |
|
| 4 | + * http://www.php.net/manual/en/function.ziparchive-addemptydir.php |
|
| 5 | + * |
|
| 6 | + * @desc Directory to ZIP file archivator |
|
| 7 | + * @package KCFinder |
|
| 8 | + * @version 2.54 |
|
| 9 | + * @author Pavel Tzonkov <[email protected]> |
|
| 10 | + * @copyright 2010-2014 KCFinder Project |
|
| 11 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 12 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 13 | + * @link http://kcfinder.sunhater.com |
|
| 14 | + */ |
|
| 15 | 15 | |
| 16 | 16 | class zipFolder |
| 17 | 17 | { |
@@ -1,46 +1,46 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project |
| 4 | - * |
|
| 5 | - * @desc Abstract image driver class |
|
| 6 | - * @package KCFinder |
|
| 7 | - * @version 2.54 |
|
| 8 | - * @author Pavel Tzonkov <[email protected]> |
|
| 9 | - * @copyright 2010-2014 KCFinder Project |
|
| 10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | - * @link http://kcfinder.sunhater.com |
|
| 13 | - */ |
|
| 4 | + * |
|
| 5 | + * @desc Abstract image driver class |
|
| 6 | + * @package KCFinder |
|
| 7 | + * @version 2.54 |
|
| 8 | + * @author Pavel Tzonkov <[email protected]> |
|
| 9 | + * @copyright 2010-2014 KCFinder Project |
|
| 10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | + * @link http://kcfinder.sunhater.com |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | abstract class image |
| 16 | 16 | { |
| 17 | 17 | const DEFAULT_JPEG_QUALITY = 75; |
| 18 | 18 | |
| 19 | 19 | /** Image resource or object |
| 20 | - * @var mixed */ |
|
| 20 | + * @var mixed */ |
|
| 21 | 21 | protected $image; |
| 22 | 22 | |
| 23 | 23 | /** Image width in pixels |
| 24 | - * @var integer */ |
|
| 24 | + * @var integer */ |
|
| 25 | 25 | protected $width; |
| 26 | 26 | |
| 27 | 27 | /** Image height in pixels |
| 28 | - * @var integer */ |
|
| 28 | + * @var integer */ |
|
| 29 | 29 | protected $height; |
| 30 | 30 | |
| 31 | 31 | /** Init error |
| 32 | - * @var bool */ |
|
| 32 | + * @var bool */ |
|
| 33 | 33 | protected $initError = false; |
| 34 | 34 | |
| 35 | 35 | /** Driver specific options |
| 36 | - * @var array */ |
|
| 36 | + * @var array */ |
|
| 37 | 37 | protected $options = array(); |
| 38 | 38 | |
| 39 | 39 | |
| 40 | 40 | /** Magic method which allows read-only access to all protected or private |
| 41 | - * class properties |
|
| 42 | - * @param string $property |
|
| 43 | - * @return mixed */ |
|
| 41 | + * class properties |
|
| 42 | + * @param string $property |
|
| 43 | + * @return mixed */ |
|
| 44 | 44 | |
| 45 | 45 | final public function __get($property) |
| 46 | 46 | { |
@@ -49,15 +49,15 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | /** Constructor. Parameter $image should be: |
| 52 | - * 1. An instance of image driver class (copy instance). |
|
| 53 | - * 2. An image represented by the type of the $image property |
|
| 54 | - * (resource or object). |
|
| 55 | - * 3. An array with two elements. First - width, second - height. |
|
| 56 | - * Creates a blank image. |
|
| 57 | - * 4. A filename string. Get image form file. |
|
| 58 | - * Second paramaeter is used by pass some specific image driver options |
|
| 59 | - * @param mixed $image |
|
| 60 | - * @param array $options */ |
|
| 52 | + * 1. An instance of image driver class (copy instance). |
|
| 53 | + * 2. An image represented by the type of the $image property |
|
| 54 | + * (resource or object). |
|
| 55 | + * 3. An array with two elements. First - width, second - height. |
|
| 56 | + * Creates a blank image. |
|
| 57 | + * 4. A filename string. Get image form file. |
|
| 58 | + * Second paramaeter is used by pass some specific image driver options |
|
| 59 | + * @param mixed $image |
|
| 60 | + * @param array $options */ |
|
| 61 | 61 | |
| 62 | 62 | public function __construct($image, array $options=array()) |
| 63 | 63 | { |
@@ -74,10 +74,10 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | |
| 76 | 76 | /** Factory pattern to load selected driver. $image and $options are passed |
| 77 | - * to the constructor of the image driver |
|
| 78 | - * @param string $driver |
|
| 79 | - * @param mixed $image |
|
| 80 | - * @return object */ |
|
| 77 | + * to the constructor of the image driver |
|
| 78 | + * @param string $driver |
|
| 79 | + * @param mixed $image |
|
| 80 | + * @return object */ |
|
| 81 | 81 | |
| 82 | 82 | final public static function factory($driver, $image, array $options=array()) |
| 83 | 83 | { |
@@ -87,9 +87,9 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | |
| 89 | 89 | /** Checks if the drivers in the array parameter could be used. Returns first |
| 90 | - * found one |
|
| 91 | - * @param array $drivers |
|
| 92 | - * @return string */ |
|
| 90 | + * found one |
|
| 91 | + * @param array $drivers |
|
| 92 | + * @return string */ |
|
| 93 | 93 | |
| 94 | 94 | final public static function getDriver(array $drivers=array('gd')) |
| 95 | 95 | { |
@@ -110,9 +110,9 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | |
| 112 | 112 | /** Returns an array. Element 0 - image resource. Element 1 - width. Element 2 - height. |
| 113 | - * Returns FALSE on failure. |
|
| 114 | - * @param mixed $image |
|
| 115 | - * @return array */ |
|
| 113 | + * Returns FALSE on failure. |
|
| 114 | + * @param mixed $image |
|
| 115 | + * @return array */ |
|
| 116 | 116 | |
| 117 | 117 | final protected function buildImage($image) |
| 118 | 118 | { |
@@ -137,8 +137,8 @@ discard block |
||
| 137 | 137 | |
| 138 | 138 | |
| 139 | 139 | /** Returns calculated proportional width from the given height |
| 140 | - * @param integer $resizedHeight |
|
| 141 | - * @return integer */ |
|
| 140 | + * @param integer $resizedHeight |
|
| 141 | + * @return integer */ |
|
| 142 | 142 | |
| 143 | 143 | final public function getPropWidth($resizedHeight) |
| 144 | 144 | { |
@@ -151,8 +151,8 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | |
| 153 | 153 | /** Returns calculated proportional height from the given width |
| 154 | - * @param integer $resizedWidth |
|
| 155 | - * @return integer */ |
|
| 154 | + * @param integer $resizedWidth |
|
| 155 | + * @return integer */ |
|
| 156 | 156 | |
| 157 | 157 | final public function getPropHeight($resizedWidth) |
| 158 | 158 | { |
@@ -165,51 +165,51 @@ discard block |
||
| 165 | 165 | |
| 166 | 166 | |
| 167 | 167 | /** Checks if PHP needs some extra extensions to use the image driver. This |
| 168 | - * static method should be implemented into driver classes like abstract |
|
| 169 | - * methods |
|
| 170 | - * @return bool */ |
|
| 168 | + * static method should be implemented into driver classes like abstract |
|
| 169 | + * methods |
|
| 170 | + * @return bool */ |
|
| 171 | 171 | public static function available() |
| 172 | 172 | { |
| 173 | 173 | return false; |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | /** Checks if file is an image. This static method should be implemented into |
| 177 | - * driver classes like abstract methods |
|
| 178 | - * @param string $file |
|
| 179 | - * @return bool */ |
|
| 177 | + * driver classes like abstract methods |
|
| 178 | + * @param string $file |
|
| 179 | + * @return bool */ |
|
| 180 | 180 | public static function checkImage($file) |
| 181 | 181 | { |
| 182 | 182 | return false; |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | /** Resize image. Should return TRUE on success or FALSE on failure |
| 186 | - * @param integer $width |
|
| 187 | - * @param integer $height |
|
| 188 | - * @return bool */ |
|
| 186 | + * @param integer $width |
|
| 187 | + * @param integer $height |
|
| 188 | + * @return bool */ |
|
| 189 | 189 | abstract public function resize($width, $height); |
| 190 | 190 | |
| 191 | 191 | /** Resize image to fit in given resolution. Should returns TRUE on success |
| 192 | - * or FALSE on failure. If $background is set, the image size will be |
|
| 193 | - * $width x $height and the empty spaces (if any) will be filled with defined |
|
| 194 | - * color. Background color examples: "#5f5", "#ff67ca", array(255, 255, 255) |
|
| 195 | - * @param integer $width |
|
| 196 | - * @param integer $height |
|
| 197 | - * @param mixed $background |
|
| 198 | - * @return bool */ |
|
| 192 | + * or FALSE on failure. If $background is set, the image size will be |
|
| 193 | + * $width x $height and the empty spaces (if any) will be filled with defined |
|
| 194 | + * color. Background color examples: "#5f5", "#ff67ca", array(255, 255, 255) |
|
| 195 | + * @param integer $width |
|
| 196 | + * @param integer $height |
|
| 197 | + * @param mixed $background |
|
| 198 | + * @return bool */ |
|
| 199 | 199 | abstract public function resizeFit($width, $height, $background=false); |
| 200 | 200 | |
| 201 | 201 | /** Resize and crop the image to fit in given resolution. Returns TRUE on |
| 202 | - * success or FALSE on failure |
|
| 203 | - * @param mixed $src |
|
| 204 | - * @param integer $offset |
|
| 205 | - * @return bool */ |
|
| 202 | + * success or FALSE on failure |
|
| 203 | + * @param mixed $src |
|
| 204 | + * @param integer $offset |
|
| 205 | + * @return bool */ |
|
| 206 | 206 | abstract public function resizeCrop($width, $height, $offset=false); |
| 207 | 207 | |
| 208 | 208 | |
| 209 | 209 | /** Rotate image |
| 210 | - * @param integer $angle |
|
| 211 | - * @param string $background |
|
| 212 | - * @return bool */ |
|
| 210 | + * @param integer $angle |
|
| 211 | + * @param string $background |
|
| 212 | + * @return bool */ |
|
| 213 | 213 | abstract public function rotate($angle, $background="#000000"); |
| 214 | 214 | |
| 215 | 215 | abstract public function flipHorizontal(); |
@@ -217,43 +217,43 @@ discard block |
||
| 217 | 217 | abstract public function flipVertical(); |
| 218 | 218 | |
| 219 | 219 | /** Apply a PNG or GIF watermark to the image. $top and $left parameters sets |
| 220 | - * the offset of the watermark in pixels. Boolean and NULL values are possible |
|
| 221 | - * too. In default case (FALSE, FALSE) the watermark should be applyed to |
|
| 222 | - * the bottom right corner. NULL values means center aligning. If the |
|
| 223 | - * watermark is bigger than the image or it's partialy or fully outside the |
|
| 224 | - * image, it shoudn't be applied |
|
| 225 | - * @param string $file |
|
| 226 | - * @param mixed $top |
|
| 227 | - * @param mixed $left |
|
| 228 | - * @return bool */ |
|
| 220 | + * the offset of the watermark in pixels. Boolean and NULL values are possible |
|
| 221 | + * too. In default case (FALSE, FALSE) the watermark should be applyed to |
|
| 222 | + * the bottom right corner. NULL values means center aligning. If the |
|
| 223 | + * watermark is bigger than the image or it's partialy or fully outside the |
|
| 224 | + * image, it shoudn't be applied |
|
| 225 | + * @param string $file |
|
| 226 | + * @param mixed $top |
|
| 227 | + * @param mixed $left |
|
| 228 | + * @return bool */ |
|
| 229 | 229 | abstract public function watermark($file, $left=false, $top=false); |
| 230 | 230 | |
| 231 | 231 | /** Should output the image. Second parameter is used to pass some options like |
| 232 | - * 'file' - if is set, the output will be written to a file |
|
| 233 | - * 'quality' - compression quality |
|
| 234 | - * It's possible to use extra specific options required by image type ($type) |
|
| 235 | - * @param string $type |
|
| 236 | - * @param array $options |
|
| 237 | - * @return bool */ |
|
| 232 | + * 'file' - if is set, the output will be written to a file |
|
| 233 | + * 'quality' - compression quality |
|
| 234 | + * It's possible to use extra specific options required by image type ($type) |
|
| 235 | + * @param string $type |
|
| 236 | + * @param array $options |
|
| 237 | + * @return bool */ |
|
| 238 | 238 | abstract public function output($type='jpeg', array $options=array()); |
| 239 | 239 | |
| 240 | 240 | /** This method should create a blank image with selected size. Should returns |
| 241 | - * resource or object related to the created image, which will be passed to |
|
| 242 | - * $image property |
|
| 243 | - * @param integer $width |
|
| 244 | - * @param integer $height |
|
| 245 | - * @return mixed */ |
|
| 241 | + * resource or object related to the created image, which will be passed to |
|
| 242 | + * $image property |
|
| 243 | + * @param integer $width |
|
| 244 | + * @param integer $height |
|
| 245 | + * @return mixed */ |
|
| 246 | 246 | abstract protected function getBlankImage($width, $height); |
| 247 | 247 | |
| 248 | 248 | /** This method should create an image from source image. Only first parameter |
| 249 | - * ($image) is input. Its type should be filename string or a type of the |
|
| 250 | - * $image property. See the constructor reference for details. The |
|
| 251 | - * parametters $width and $height are output only. Should returns resource or |
|
| 252 | - * object related to the created image, which will be passed to $image |
|
| 253 | - * property |
|
| 254 | - * @param mixed $image |
|
| 255 | - * @param integer $width |
|
| 256 | - * @param integer $height |
|
| 257 | - * @return mixed */ |
|
| 249 | + * ($image) is input. Its type should be filename string or a type of the |
|
| 250 | + * $image property. See the constructor reference for details. The |
|
| 251 | + * parametters $width and $height are output only. Should returns resource or |
|
| 252 | + * object related to the created image, which will be passed to $image |
|
| 253 | + * property |
|
| 254 | + * @param mixed $image |
|
| 255 | + * @param integer $width |
|
| 256 | + * @param integer $height |
|
| 257 | + * @return mixed */ |
|
| 258 | 258 | abstract protected function getImage($image, &$width, &$height); |
| 259 | 259 | } |
@@ -1,24 +1,24 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project |
| 4 | - * |
|
| 5 | - * @desc Directory helper class |
|
| 6 | - * @package KCFinder |
|
| 7 | - * @version 2.54 |
|
| 8 | - * @author Pavel Tzonkov <[email protected]> |
|
| 9 | - * @copyright 2010-2014 KCFinder Project |
|
| 10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | - * @link http://kcfinder.sunhater.com |
|
| 13 | - */ |
|
| 4 | + * |
|
| 5 | + * @desc Directory helper class |
|
| 6 | + * @package KCFinder |
|
| 7 | + * @version 2.54 |
|
| 8 | + * @author Pavel Tzonkov <[email protected]> |
|
| 9 | + * @copyright 2010-2014 KCFinder Project |
|
| 10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | + * @link http://kcfinder.sunhater.com |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | class dir |
| 16 | 16 | { |
| 17 | 17 | |
| 18 | - /** Checks if the given directory is really writable. The standard PHP |
|
| 19 | - * function is_writable() does not work properly on Windows servers |
|
| 20 | - * @param string $dir |
|
| 21 | - * @return bool */ |
|
| 18 | + /** Checks if the given directory is really writable. The standard PHP |
|
| 19 | + * function is_writable() does not work properly on Windows servers |
|
| 20 | + * @param string $dir |
|
| 21 | + * @return bool */ |
|
| 22 | 22 | |
| 23 | 23 | public static function isWritable($dir) |
| 24 | 24 | { |
@@ -38,15 +38,15 @@ discard block |
||
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** Recursively delete the given directory. Returns TRUE on success. |
| 41 | - * If $firstFailExit parameter is true (default), the method returns the |
|
| 42 | - * path to the first failed file or directory which cannot be deleted. |
|
| 43 | - * If $firstFailExit is false, the method returns an array with failed |
|
| 44 | - * files and directories which cannot be deleted. The third parameter |
|
| 45 | - * $failed is used for internal use only. |
|
| 46 | - * @param string $dir |
|
| 47 | - * @param bool $firstFailExit |
|
| 48 | - * @param array $failed |
|
| 49 | - * @return mixed */ |
|
| 41 | + * If $firstFailExit parameter is true (default), the method returns the |
|
| 42 | + * path to the first failed file or directory which cannot be deleted. |
|
| 43 | + * If $firstFailExit is false, the method returns an array with failed |
|
| 44 | + * files and directories which cannot be deleted. The third parameter |
|
| 45 | + * $failed is used for internal use only. |
|
| 46 | + * @param string $dir |
|
| 47 | + * @param bool $firstFailExit |
|
| 48 | + * @param array $failed |
|
| 49 | + * @return mixed */ |
|
| 50 | 50 | |
| 51 | 51 | public static function prune($dir, $firstFailExit=true, array $failed=null) |
| 52 | 52 | { |
@@ -94,10 +94,10 @@ discard block |
||
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** Get the content of the given directory. Returns an array with filenames |
| 97 | - * or FALSE on failure |
|
| 98 | - * @param string $dir |
|
| 99 | - * @param array $options |
|
| 100 | - * @return mixed */ |
|
| 97 | + * or FALSE on failure |
|
| 98 | + * @param string $dir |
|
| 99 | + * @param array $options |
|
| 100 | + * @return mixed */ |
|
| 101 | 101 | |
| 102 | 102 | public static function content($dir, array $options=null) |
| 103 | 103 | { |
@@ -1,16 +1,16 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project |
| 4 | - * |
|
| 5 | - * @desc File helper class |
|
| 6 | - * @package KCFinder |
|
| 7 | - * @version 2.54 |
|
| 8 | - * @author Pavel Tzonkov <[email protected]> |
|
| 9 | - * @copyright 2010-2014 KCFinder Project |
|
| 10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | - * @link http://kcfinder.sunhater.com |
|
| 13 | - */ |
|
| 4 | + * |
|
| 5 | + * @desc File helper class |
|
| 6 | + * @package KCFinder |
|
| 7 | + * @version 2.54 |
|
| 8 | + * @author Pavel Tzonkov <[email protected]> |
|
| 9 | + * @copyright 2010-2014 KCFinder Project |
|
| 10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | + * @link http://kcfinder.sunhater.com |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | class file |
| 16 | 16 | { |
@@ -101,9 +101,9 @@ discard block |
||
| 101 | 101 | ); |
| 102 | 102 | |
| 103 | 103 | /** Checks if the given file is really writable. The standard PHP function |
| 104 | - * is_writable() does not work properly on Windows servers. |
|
| 105 | - * @param string $dir |
|
| 106 | - * @return bool */ |
|
| 104 | + * is_writable() does not work properly on Windows servers. |
|
| 105 | + * @param string $dir |
|
| 106 | + * @return bool */ |
|
| 107 | 107 | |
| 108 | 108 | public static function isWritable($filename) |
| 109 | 109 | { |
@@ -116,9 +116,9 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** Get the extension from filename |
| 119 | - * @param string $file |
|
| 120 | - * @param bool $toLower |
|
| 121 | - * @return string */ |
|
| 119 | + * @param string $file |
|
| 120 | + * @param bool $toLower |
|
| 121 | + * @return string */ |
|
| 122 | 122 | |
| 123 | 123 | public static function getExtension($filename, $toLower=true) |
| 124 | 124 | { |
@@ -127,15 +127,15 @@ discard block |
||
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /** Get MIME type of the given filename. If Fileinfo PHP extension is |
| 130 | - * available the MIME type will be fetched by the file's content. The |
|
| 131 | - * second parameter is optional and defines the magic file path. If you |
|
| 132 | - * skip it, the default one will be loaded. |
|
| 133 | - * If Fileinfo PHP extension is not available the MIME type will be fetched |
|
| 134 | - * by filename extension regarding $MIME property. If the file extension |
|
| 135 | - * does not exist there, returned type will be application/octet-stream |
|
| 136 | - * @param string $filename |
|
| 137 | - * @param string $magic |
|
| 138 | - * @return string */ |
|
| 130 | + * available the MIME type will be fetched by the file's content. The |
|
| 131 | + * second parameter is optional and defines the magic file path. If you |
|
| 132 | + * skip it, the default one will be loaded. |
|
| 133 | + * If Fileinfo PHP extension is not available the MIME type will be fetched |
|
| 134 | + * by filename extension regarding $MIME property. If the file extension |
|
| 135 | + * does not exist there, returned type will be application/octet-stream |
|
| 136 | + * @param string $filename |
|
| 137 | + * @param string $magic |
|
| 138 | + * @return string */ |
|
| 139 | 139 | |
| 140 | 140 | public static function getMimeType($filename, $magic=null) |
| 141 | 141 | { |
@@ -154,25 +154,25 @@ discard block |
||
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | /** Get inexistant filename based on the given filename. If you skip $dir |
| 157 | - * parameter the directory will be fetched from $filename and returned |
|
| 158 | - * value will be full filename path. The third parameter is optional and |
|
| 159 | - * defines the template, the filename will be renamed to. Default template |
|
| 160 | - * is {name}({sufix}){ext}. Examples: |
|
| 161 | - * |
|
| 162 | - * file::getInexistantFilename("/my/directory/myfile.txt"); |
|
| 163 | - * If myfile.txt does not exist - returns the same path to the file |
|
| 164 | - * otherwise returns "/my/directory/myfile(1).txt" |
|
| 165 | - * |
|
| 166 | - * file::getInexistantFilename("myfile.txt", "/my/directory"); |
|
| 167 | - * returns "myfile.txt" or "myfile(1).txt" or "myfile(2).txt" etc... |
|
| 168 | - * |
|
| 169 | - * file::getInexistantFilename("myfile.txt", "/dir", "{name}[{sufix}]{ext}"); |
|
| 170 | - * returns "myfile.txt" or "myfile[1].txt" or "myfile[2].txt" etc... |
|
| 171 | - * |
|
| 172 | - * @param string $filename |
|
| 173 | - * @param string $dir |
|
| 174 | - * @param string $tpl |
|
| 175 | - * @return string */ |
|
| 157 | + * parameter the directory will be fetched from $filename and returned |
|
| 158 | + * value will be full filename path. The third parameter is optional and |
|
| 159 | + * defines the template, the filename will be renamed to. Default template |
|
| 160 | + * is {name}({sufix}){ext}. Examples: |
|
| 161 | + * |
|
| 162 | + * file::getInexistantFilename("/my/directory/myfile.txt"); |
|
| 163 | + * If myfile.txt does not exist - returns the same path to the file |
|
| 164 | + * otherwise returns "/my/directory/myfile(1).txt" |
|
| 165 | + * |
|
| 166 | + * file::getInexistantFilename("myfile.txt", "/my/directory"); |
|
| 167 | + * returns "myfile.txt" or "myfile(1).txt" or "myfile(2).txt" etc... |
|
| 168 | + * |
|
| 169 | + * file::getInexistantFilename("myfile.txt", "/dir", "{name}[{sufix}]{ext}"); |
|
| 170 | + * returns "myfile.txt" or "myfile[1].txt" or "myfile[2].txt" etc... |
|
| 171 | + * |
|
| 172 | + * @param string $filename |
|
| 173 | + * @param string $dir |
|
| 174 | + * @param string $tpl |
|
| 175 | + * @return string */ |
|
| 176 | 176 | |
| 177 | 177 | public static function getInexistantFilename($filename, $dir=null, $tpl=null) |
| 178 | 178 | { |
@@ -1,16 +1,16 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project |
| 4 | - * |
|
| 5 | - * @desc Browser calling script |
|
| 6 | - * @package KCFinder |
|
| 7 | - * @version 2.54 |
|
| 8 | - * @author Pavel Tzonkov <[email protected]> |
|
| 9 | - * @copyright 2010-2014 KCFinder Project |
|
| 10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | - * @link http://kcfinder.sunhater.com |
|
| 13 | - */ |
|
| 4 | + * |
|
| 5 | + * @desc Browser calling script |
|
| 6 | + * @package KCFinder |
|
| 7 | + * @version 2.54 |
|
| 8 | + * @author Pavel Tzonkov <[email protected]> |
|
| 9 | + * @copyright 2010-2014 KCFinder Project |
|
| 10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | + * @link http://kcfinder.sunhater.com |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | require "core/autoload.php"; // Init MODX |
| 16 | 16 | |