@@ -260,6 +260,9 @@ |
||
| 260 | 260 | |
| 261 | 261 | |
| 262 | 262 | |
| 263 | + /** |
|
| 264 | + * @param string $char |
|
| 265 | + */ |
|
| 263 | 266 | public static function IntString2Bool($char) { |
| 264 | 267 | |
| 265 | 268 | return $char == '1' ? true : ($char == '0' ? false : null); |
@@ -295,6 +295,9 @@ discard block |
||
| 295 | 295 | )); |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | + /** |
|
| 299 | + * @param string $file |
|
| 300 | + */ |
|
| 298 | 301 | protected function unlink($file){ |
| 299 | 302 | $file = realpath($file); |
| 300 | 303 | if ($this->basedir==$file || strlen($this->basedir)>=strlen($file)) |
@@ -312,6 +315,9 @@ discard block |
||
| 312 | 315 | } |
| 313 | 316 | } |
| 314 | 317 | |
| 318 | + /** |
|
| 319 | + * @param string $dir |
|
| 320 | + */ |
|
| 315 | 321 | protected function getName($file, $dir){ |
| 316 | 322 | $files = array(); |
| 317 | 323 | foreach ((array)glob($dir . '/*') as $f) |
@@ -340,11 +346,17 @@ discard block |
||
| 340 | 346 | return $this->checkFile($dir) ? $dir : $this->basedir; |
| 341 | 347 | } |
| 342 | 348 | |
| 349 | + /** |
|
| 350 | + * @param string $file |
|
| 351 | + */ |
|
| 343 | 352 | protected function getPath($file){ |
| 344 | 353 | $file = $this->normalize(substr($file, $this->length)); |
| 345 | 354 | return substr($file, FileManagerUtility::startsWith($file, '/') ? 1 : 0); |
| 346 | 355 | } |
| 347 | 356 | |
| 357 | + /** |
|
| 358 | + * @param string $file |
|
| 359 | + */ |
|
| 348 | 360 | protected function checkFile($file){ |
| 349 | 361 | $mimes = $this->getAllowedMimeTypes(); |
| 350 | 362 | $hasFilter = $this->options['filter'] && count($mimes); |
@@ -379,6 +391,9 @@ discard block |
||
| 379 | 391 | /* Stripped-down version of some Styx PHP Framework-Functionality bundled with this FileBrowser. Styx is located at: http://styx.og5.net */ |
| 380 | 392 | class FileManagerUtility { |
| 381 | 393 | |
| 394 | + /** |
|
| 395 | + * @param string $look |
|
| 396 | + */ |
|
| 382 | 397 | public static function endsWith($string, $look){ |
| 383 | 398 | return strrpos($string, $look)===strlen($string)-strlen($look); |
| 384 | 399 | } |
@@ -403,6 +418,9 @@ discard block |
||
| 403 | 418 | return !empty($options) ? self::checkTitle($data, $options) : $data; |
| 404 | 419 | } |
| 405 | 420 | |
| 421 | + /** |
|
| 422 | + * @param string $data |
|
| 423 | + */ |
|
| 406 | 424 | protected static function checkTitle($data, $options = array(), $i = 0){ |
| 407 | 425 | if (!is_array($options)) return $data; |
| 408 | 426 | |
@@ -413,6 +431,9 @@ discard block |
||
| 413 | 431 | return $data.($i ? '_' . $i : ''); |
| 414 | 432 | } |
| 415 | 433 | |
| 434 | + /** |
|
| 435 | + * @param string $str |
|
| 436 | + */ |
|
| 416 | 437 | public static function isBinary($str){ |
| 417 | 438 | $array = array(0, 255); |
| 418 | 439 | for($i = 0; $i < strlen($str); $i++) |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | * @param string $file |
| 19 | 19 | * @param string $to |
| 20 | 20 | * @param array $options |
| 21 | - * @return bool|string Path to moved file or false if the specified upload does not exist |
|
| 21 | + * @return false|string Path to moved file or false if the specified upload does not exist |
|
| 22 | 22 | */ |
| 23 | 23 | public static function move($file, $to, $options = null){ |
| 24 | 24 | if(!self::exists($file)) return false; |
@@ -462,7 +462,6 @@ discard block |
||
| 462 | 462 | |
| 463 | 463 | /** |
| 464 | 464 | * HTTP level error handling. |
| 465 | - * @param integer $code The HTTP error code to return to the client. This defaults to 400. |
|
| 466 | 465 | * @param string $message Error message to send to the client. This defaults to the standard HTTP error messages. |
| 467 | 466 | */ |
| 468 | 467 | function http_error_exit($error = 'HTTP_CLIENT_BAD_REQUEST', $message='') { |
@@ -483,6 +482,7 @@ discard block |
||
| 483 | 482 | |
| 484 | 483 | /** |
| 485 | 484 | * Check to see if the supplied filename is inside |
| 485 | + * @param string $checkfile |
|
| 486 | 486 | */ |
| 487 | 487 | function directory_contains($container_directory, $checkfile) { |
| 488 | 488 | |
@@ -778,6 +778,9 @@ discard block |
||
| 778 | 778 | * **************************************************************************}} |
| 779 | 779 | */ |
| 780 | 780 | |
| 781 | +/** |
|
| 782 | + * @param string $chroot |
|
| 783 | + */ |
|
| 781 | 784 | function store_uploaded_file($filename, $filedata, $chroot) { |
| 782 | 785 | |
| 783 | 786 | // If chroot is empty, then we will not perform the operation. |
@@ -262,6 +262,9 @@ discard block |
||
| 262 | 262 | Resize |
| 263 | 263 | *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ |
| 264 | 264 | |
| 265 | + /** |
|
| 266 | + * @param string $newHeight |
|
| 267 | + */ |
|
| 265 | 268 | public function resizeImage($newWidth, $newHeight, $option = 0, $sharpen = false, $autoRotate = false) |
| 266 | 269 | # Author: Jarrod Oberto |
| 267 | 270 | # Date: 27-02-08 |
@@ -393,6 +396,9 @@ discard block |
||
| 393 | 396 | |
| 394 | 397 | ## -------------------------------------------------------- |
| 395 | 398 | |
| 399 | + /** |
|
| 400 | + * @param resource $im |
|
| 401 | + */ |
|
| 396 | 402 | private function keepTransparancy($width, $height, $im) |
| 397 | 403 | # Author: Jarrod Oberto |
| 398 | 404 | # Date: 08-04-11 |
@@ -828,6 +834,9 @@ discard block |
||
| 828 | 834 | |
| 829 | 835 | ## -------------------------------------------------------- |
| 830 | 836 | |
| 837 | + /** |
|
| 838 | + * @param integer $orig |
|
| 839 | + */ |
|
| 831 | 840 | private function findSharp($orig, $final) |
| 832 | 841 | # Author: Ryan Rud (http://adryrun.com) |
| 833 | 842 | # Purpose: Find optimal sharpness |
@@ -1629,6 +1638,11 @@ discard block |
||
| 1629 | 1638 | |
| 1630 | 1639 | ## -------------------------------------------------------- |
| 1631 | 1640 | |
| 1641 | + /** |
|
| 1642 | + * @param string $side |
|
| 1643 | + * @param integer $thickness |
|
| 1644 | + * @param integer $padding |
|
| 1645 | + */ |
|
| 1632 | 1646 | private function calculateCaptionBoxPosition($side, $thickness, $padding) |
| 1633 | 1647 | { |
| 1634 | 1648 | $positionArray = array(); |
@@ -1972,6 +1986,9 @@ discard block |
||
| 1972 | 1986 | |
| 1973 | 1987 | ## -------------------------------------------------------- |
| 1974 | 1988 | |
| 1989 | + /** |
|
| 1990 | + * @param integer $dat |
|
| 1991 | + */ |
|
| 1975 | 1992 | private function writeIPTC($dat, $value) |
| 1976 | 1993 | { |
| 1977 | 1994 | |
@@ -1984,6 +2001,9 @@ discard block |
||
| 1984 | 2001 | |
| 1985 | 2002 | ## -------------------------------------------------------- |
| 1986 | 2003 | |
| 2004 | + /** |
|
| 2005 | + * @param integer $rec |
|
| 2006 | + */ |
|
| 1987 | 2007 | private function iptc_maketag($rec,$dat,$val) |
| 1988 | 2008 | # Author: Thies C. Arntzen |
| 1989 | 2009 | # Purpose: Function to format the new IPTC text |
@@ -2090,6 +2110,10 @@ discard block |
||
| 2090 | 2110 | |
| 2091 | 2111 | ## -------------------------------------------------------- |
| 2092 | 2112 | |
| 2113 | + /** |
|
| 2114 | + * @param integer $fontSize |
|
| 2115 | + * @param integer $angle |
|
| 2116 | + */ |
|
| 2093 | 2117 | private function getTextSize($fontSize, $angle, $font, $text) |
| 2094 | 2118 | { |
| 2095 | 2119 | |
@@ -2163,6 +2187,9 @@ discard block |
||
| 2163 | 2187 | |
| 2164 | 2188 | ## -------------------------------------------------------- |
| 2165 | 2189 | |
| 2190 | + /** |
|
| 2191 | + * @param integer $padding |
|
| 2192 | + */ |
|
| 2166 | 2193 | private function calculatePosition($pos, $padding, $assetWidth, $assetHeight, $upperLeft = true) |
| 2167 | 2194 | # |
| 2168 | 2195 | # Author: Jarrod Oberto |
@@ -2727,6 +2754,9 @@ discard block |
||
| 2727 | 2754 | |
| 2728 | 2755 | ## -------------------------------------------------------- |
| 2729 | 2756 | |
| 2757 | + /** |
|
| 2758 | + * @param boolean $isEnabled |
|
| 2759 | + */ |
|
| 2730 | 2760 | private function checkInterlaceImage($isEnabled) |
| 2731 | 2761 | # jpg will use progressive (they don't use interace) |
| 2732 | 2762 | { |
@@ -2879,6 +2909,10 @@ discard block |
||
| 2879 | 2909 | |
| 2880 | 2910 | ## -------------------------------------------------------- |
| 2881 | 2911 | |
| 2912 | + /** |
|
| 2913 | + * @param integer $value |
|
| 2914 | + * @param integer $originalMax |
|
| 2915 | + */ |
|
| 2882 | 2916 | private function invertTransparency($value, $originalMax, $invert=true) |
| 2883 | 2917 | # Purpose: This does two things: |
| 2884 | 2918 | # 1) Convert the range from 0-127 to 0-100 |
@@ -2904,6 +2938,9 @@ discard block |
||
| 2904 | 2938 | |
| 2905 | 2939 | ## -------------------------------------------------------- |
| 2906 | 2940 | |
| 2941 | + /** |
|
| 2942 | + * @param resource $src |
|
| 2943 | + */ |
|
| 2907 | 2944 | private function transparentImage($src) |
| 2908 | 2945 | { |
| 2909 | 2946 | // *** making images with white bg transparent |
@@ -2932,6 +2969,9 @@ discard block |
||
| 2932 | 2969 | |
| 2933 | 2970 | ## -------------------------------------------------------- |
| 2934 | 2971 | |
| 2972 | + /** |
|
| 2973 | + * @param string $needle |
|
| 2974 | + */ |
|
| 2935 | 2975 | function checkStringStartsWith($needle, $haystack) |
| 2936 | 2976 | # Check if a string starts with a specific pattern |
| 2937 | 2977 | { |
@@ -2942,6 +2982,9 @@ discard block |
||
| 2942 | 2982 | BMP SUPPORT (SAVING) - James Heinrich |
| 2943 | 2983 | *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*/ |
| 2944 | 2984 | |
| 2985 | + /** |
|
| 2986 | + * @param resource $gd_image |
|
| 2987 | + */ |
|
| 2945 | 2988 | private function GD2BMPstring(&$gd_image) |
| 2946 | 2989 | # Author: James Heinrich |
| 2947 | 2990 | # Purpose: Save file as type bmp |
@@ -2995,6 +3038,10 @@ discard block |
||
| 2995 | 3038 | |
| 2996 | 3039 | ## -------------------------------------------------------- |
| 2997 | 3040 | |
| 3041 | + /** |
|
| 3042 | + * @param integer $x |
|
| 3043 | + * @param integer $y |
|
| 3044 | + */ |
|
| 2998 | 3045 | private function GetPixelColor(&$img, $x, $y) |
| 2999 | 3046 | # Author: James Heinrich |
| 3000 | 3047 | # Purpose: |
@@ -3013,6 +3060,9 @@ discard block |
||
| 3013 | 3060 | |
| 3014 | 3061 | ## -------------------------------------------------------- |
| 3015 | 3062 | |
| 3063 | + /** |
|
| 3064 | + * @param integer $number |
|
| 3065 | + */ |
|
| 3016 | 3066 | private function LittleEndian2String($number, $minbytes=1) |
| 3017 | 3067 | # Author: James Heinrich |
| 3018 | 3068 | # Purpose: BMP SUPPORT (SAVING) |
@@ -57,6 +57,9 @@ discard block |
||
| 57 | 57 | return false; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | +/** |
|
| 61 | + * @param string $imgthumb |
|
| 62 | + */ |
|
| 60 | 63 | function create_img($imgfile, $imgthumb, $newwidth, $newheight="") { |
| 61 | 64 | if(image_check_memory_usage($imgfile,$newwidth,$newheight)){ |
| 62 | 65 | require_once('php_image_magician.php'); |
@@ -217,6 +220,9 @@ discard block |
||
| 217 | 220 | return false; |
| 218 | 221 | } |
| 219 | 222 | |
| 223 | +/** |
|
| 224 | + * @param string $max_hoogte |
|
| 225 | + */ |
|
| 220 | 226 | function image_check_memory_usage($img, $max_breedte, $max_hoogte){ |
| 221 | 227 | if(file_exists($img)){ |
| 222 | 228 | $K64 = 65536; // number of bytes in 64K |
@@ -197,6 +197,7 @@ discard block |
||
| 197 | 197 | |
| 198 | 198 | /** |
| 199 | 199 | * Log a message on the current output, as a HTML comment. |
| 200 | + * @param string $function |
|
| 200 | 201 | */ |
| 201 | 202 | protected function logDebug($function, $msg, $htmlComment=true) { |
| 202 | 203 | $output = "[DEBUG] [$function] $msg"; |
@@ -210,6 +211,7 @@ discard block |
||
| 210 | 211 | /** |
| 211 | 212 | * Log a message to the PHP log. |
| 212 | 213 | * Declared "protected" so it may be Extended if you require customised logging (e.g. particular log file location). |
| 214 | + * @param string $function |
|
| 213 | 215 | */ |
| 214 | 216 | protected function logPHPDebug($function, $msg) { |
| 215 | 217 | if ($this->classparams['debug_php'] === true) { |
@@ -259,7 +261,7 @@ discard block |
||
| 259 | 261 | * the document.embeds[] array while in others, it is accessible via the |
| 260 | 262 | * document.applets[] array. |
| 261 | 263 | * |
| 262 | - * @return A string, containing the necessary wrapper function (named JUploadSetProperty) |
|
| 264 | + * @return string string, containing the necessary wrapper function (named JUploadSetProperty) |
|
| 263 | 265 | */ |
| 264 | 266 | private function str_jsinit() { |
| 265 | 267 | $N = "\n"; |
@@ -279,7 +281,7 @@ discard block |
||
| 279 | 281 | /** |
| 280 | 282 | * Build a string, containing the applet tag with all parameters. |
| 281 | 283 | * |
| 282 | - * @return A string, containing the applet tag |
|
| 284 | + * @return string string, containing the applet tag |
|
| 283 | 285 | */ |
| 284 | 286 | private function str_applet() { |
| 285 | 287 | $N = "\n"; |
@@ -340,6 +342,9 @@ discard block |
||
| 340 | 342 | return; |
| 341 | 343 | } |
| 342 | 344 | |
| 345 | + /** |
|
| 346 | + * @param string $path |
|
| 347 | + */ |
|
| 343 | 348 | private function mkdirp($path) { |
| 344 | 349 | // create subdir (hierary) below destdir; |
| 345 | 350 | $dirs = explode('/', $path); |
@@ -88,7 +88,6 @@ discard block |
||
| 88 | 88 | /** |
| 89 | 89 | * Get initial content |
| 90 | 90 | * |
| 91 | - * @param bool $encode To sanitizer the text? Default value should be "true"; however we have to set "false" for backward compat |
|
| 92 | 91 | * @return string |
| 93 | 92 | */ |
| 94 | 93 | function getValue() { |
@@ -115,7 +114,7 @@ discard block |
||
| 115 | 114 | /** |
| 116 | 115 | * prepare HTML for output |
| 117 | 116 | * |
| 118 | - * @return sting HTML |
|
| 117 | + * @return string HTML |
|
| 119 | 118 | */ |
| 120 | 119 | function render() |
| 121 | 120 | { |
@@ -88,7 +88,6 @@ discard block |
||
| 88 | 88 | /** |
| 89 | 89 | * Get initial content |
| 90 | 90 | * |
| 91 | - * @param bool $encode To sanitizer the text? Default value should be "true"; however we have to set "false" for backward compat |
|
| 92 | 91 | * @return string |
| 93 | 92 | */ |
| 94 | 93 | function getValue() { |
@@ -115,7 +114,7 @@ discard block |
||
| 115 | 114 | /** |
| 116 | 115 | * prepare HTML for output |
| 117 | 116 | * |
| 118 | - * @return sting HTML |
|
| 117 | + * @return string HTML |
|
| 119 | 118 | */ |
| 120 | 119 | function render() |
| 121 | 120 | { |