@@ -872,6 +872,9 @@ discard block |
||
| 872 | 872 | return ""; |
| 873 | 873 | } |
| 874 | 874 | |
| 875 | + /** |
|
| 876 | + * @param string $message |
|
| 877 | + */ |
|
| 875 | 878 | protected function errorMsg($message, array $data=null) { |
| 876 | 879 | if (in_array($this->action, array("thumb", "upload", "download", "downloadDir"))) |
| 877 | 880 | die($this->label($message, $data)); |
@@ -887,6 +890,9 @@ discard block |
||
| 887 | 890 | return htmlentities($str, null, strtoupper($this->charset)); |
| 888 | 891 | } |
| 889 | 892 | |
| 893 | + /** |
|
| 894 | + * @param string $dir |
|
| 895 | + */ |
|
| 890 | 896 | protected function downloadURL($url, $dir) { |
| 891 | 897 | |
| 892 | 898 | if (!preg_match(phpGet::$urlExpr, $url, $match)) |
@@ -328,6 +328,9 @@ discard block |
||
| 328 | 328 | $this->callBack($url, $message); |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | + /** |
|
| 332 | + * @return string |
|
| 333 | + */ |
|
| 331 | 334 | protected function normalizeFilename($filename) { |
| 332 | 335 | |
| 333 | 336 | if (isset($this->config['filenameChangeChars']) && |
@@ -341,6 +344,9 @@ discard block |
||
| 341 | 344 | return $filename; |
| 342 | 345 | } |
| 343 | 346 | |
| 347 | + /** |
|
| 348 | + * @param string $dirname |
|
| 349 | + */ |
|
| 344 | 350 | protected function normalizeDirname($dirname) { |
| 345 | 351 | |
| 346 | 352 | if (isset($this->config['dirnameChangeChars']) && |
@@ -480,6 +486,9 @@ discard block |
||
| 480 | 486 | return (is_dir($path) && is_readable($path)) ? $return : false; |
| 481 | 487 | } |
| 482 | 488 | |
| 489 | + /** |
|
| 490 | + * @param string $ext |
|
| 491 | + */ |
|
| 483 | 492 | protected function validateExtension($ext, $type) { |
| 484 | 493 | $ext = trim(strtolower($ext)); |
| 485 | 494 | if (!isset($this->types[$type])) |
@@ -505,11 +514,17 @@ discard block |
||
| 505 | 514 | return in_array($ext, $exts); |
| 506 | 515 | } |
| 507 | 516 | |
| 517 | + /** |
|
| 518 | + * @return string |
|
| 519 | + */ |
|
| 508 | 520 | protected function getTypeFromPath($path) { |
| 509 | 521 | return preg_match('/^([^\/]*)\/.*$/', $path, $patt) |
| 510 | 522 | ? $patt[1] : $path; |
| 511 | 523 | } |
| 512 | 524 | |
| 525 | + /** |
|
| 526 | + * @param string $path |
|
| 527 | + */ |
|
| 513 | 528 | protected function removeTypeFromPath($path) { |
| 514 | 529 | return preg_match('/^[^\/]*\/(.*)$/', $path, $patt) |
| 515 | 530 | ? $patt[1] : ""; |
@@ -693,6 +708,9 @@ discard block |
||
| 693 | 708 | die; |
| 694 | 709 | } |
| 695 | 710 | |
| 711 | + /** |
|
| 712 | + * @param string $url |
|
| 713 | + */ |
|
| 696 | 714 | protected function callBack($url, $message="") { |
| 697 | 715 | $message = text::jsValue($message); |
| 698 | 716 | |
@@ -199,6 +199,9 @@ discard block |
||
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | |
| 202 | + /** |
|
| 203 | + * @param integer $n |
|
| 204 | + */ |
|
| 202 | 205 | private function getChars($n) |
| 203 | 206 | { |
| 204 | 207 | $response = null; |
@@ -240,6 +243,9 @@ discard block |
||
| 240 | 243 | } |
| 241 | 244 | |
| 242 | 245 | |
| 246 | + /** |
|
| 247 | + * @param false|string $str |
|
| 248 | + */ |
|
| 243 | 249 | private function readInt($str) |
| 244 | 250 | { |
| 245 | 251 | $size = unpack("C*", $str); |
@@ -181,7 +181,6 @@ |
||
| 181 | 181 | |
| 182 | 182 | /** Resize and crop the image to fit in given resolution. Returns TRUE on |
| 183 | 183 | * success or FALSE on failure |
| 184 | - * @param mixed $src |
|
| 185 | 184 | * @param integer $offset |
| 186 | 185 | * @return bool */ |
| 187 | 186 | abstract public function resizeCrop($width, $height, $offset=false); |
@@ -327,6 +327,11 @@ |
||
| 327 | 327 | return imagecolorallocate($this->image, $r, $g, $b); |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | + /** |
|
| 331 | + * @param integer $x1 |
|
| 332 | + * @param integer $y1 |
|
| 333 | + * @param boolean $color |
|
| 334 | + */ |
|
| 330 | 335 | protected function imageFilledRectangle($x1, $y1, $x2, $y2, $color) { |
| 331 | 336 | $color = $this->gdColor($color); |
| 332 | 337 | if ($color === false) return false; |
@@ -20,6 +20,9 @@ discard block |
||
| 20 | 20 | protected $root; |
| 21 | 21 | protected $ignored; |
| 22 | 22 | |
| 23 | + /** |
|
| 24 | + * @param string $folder |
|
| 25 | + */ |
|
| 23 | 26 | function __construct($file, $folder, $ignored=null) { |
| 24 | 27 | $this->zip = new \ZipArchive(); |
| 25 | 28 | |
@@ -41,6 +44,9 @@ discard block |
||
| 41 | 44 | $this->zip->close(); |
| 42 | 45 | } |
| 43 | 46 | |
| 47 | + /** |
|
| 48 | + * @param string $folder |
|
| 49 | + */ |
|
| 44 | 50 | function zip($folder, $parent=null) { |
| 45 | 51 | $full_path = "{$this->root}$parent$folder"; |
| 46 | 52 | $zip_path = "$parent$folder"; |
@@ -20,6 +20,9 @@ |
||
| 20 | 20 | static public $urlExpr = '/^([a-z]+):\/\/((([\p{L}\d\-]+\.)+[\p{L}]{1,4})(\:(\d{1,6}))?(\/.*)*)?$/u'; |
| 21 | 21 | static public $socketExpr = '/^[A-Z]+\/\d+(\.\d+)\s+\d+\s+OK\s*([a-zA-Z0-9\-]+\:\s*[^\n]*\n)*\s*([a-f0-9]+\r?\n)?(.*)$/s'; |
| 22 | 22 | |
| 23 | + /** |
|
| 24 | + * @param string $file |
|
| 25 | + */ |
|
| 23 | 26 | static public function get($url, $file=null, $method=null) { |
| 24 | 27 | if ($file === true) |
| 25 | 28 | $file = basename($url); |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | * Creates one instance of the tinyMCE object |
| 47 | 47 | * |
| 48 | 48 | * @param array $config The configuration |
| 49 | - * @return object $instance The instance of tinyMCE object |
|
| 49 | + * @return TinyMCE $instance The instance of tinyMCE object |
|
| 50 | 50 | **/ |
| 51 | 51 | |
| 52 | 52 | function &instance( $config ) |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | 72 | * Initializes the tinyMCE |
| 73 | - * @return true |
|
| 73 | + * @return boolean |
|
| 74 | 74 | **/ |
| 75 | 75 | |
| 76 | 76 | function init() |