Index: trunk/phase3/includes/filerepo/File.php |
— | — | @@ -117,6 +117,8 @@ |
118 | 118 | * |
119 | 119 | * @param $old File Old file |
120 | 120 | * @param $new string New name |
| 121 | + * |
| 122 | + * @return bool|null |
121 | 123 | */ |
122 | 124 | static function checkExtensionCompatibility( File $old, $new ) { |
123 | 125 | $oldMime = $old->getMimeType(); |
— | — | @@ -151,6 +153,8 @@ |
152 | 154 | |
153 | 155 | /** |
154 | 156 | * Return the name of this file |
| 157 | + * |
| 158 | + * @return string |
155 | 159 | */ |
156 | 160 | public function getName() { |
157 | 161 | if ( !isset( $this->name ) ) { |
— | — | @@ -161,6 +165,8 @@ |
162 | 166 | |
163 | 167 | /** |
164 | 168 | * Get the file extension, e.g. "svg" |
| 169 | + * |
| 170 | + * @return string |
165 | 171 | */ |
166 | 172 | function getExtension() { |
167 | 173 | if ( !isset( $this->extension ) ) { |
— | — | @@ -179,15 +185,20 @@ |
180 | 186 | |
181 | 187 | /** |
182 | 188 | * Return the title used to find this file |
| 189 | + * |
| 190 | + * @return Title |
183 | 191 | */ |
184 | 192 | public function getOriginalTitle() { |
185 | | - if ( $this->redirected ) |
| 193 | + if ( $this->redirected ) { |
186 | 194 | return $this->getRedirectedTitle(); |
| 195 | + } |
187 | 196 | return $this->title; |
188 | 197 | } |
189 | 198 | |
190 | 199 | /** |
191 | 200 | * Return the URL of the file |
| 201 | + * |
| 202 | + * @return string |
192 | 203 | */ |
193 | 204 | public function getUrl() { |
194 | 205 | if ( !isset( $this->url ) ) { |
— | — | @@ -207,12 +218,14 @@ |
208 | 219 | return wfExpandUrl( $this->getUrl() ); |
209 | 220 | } |
210 | 221 | |
| 222 | + /** |
| 223 | + * @return string |
| 224 | + */ |
211 | 225 | function getViewURL() { |
212 | 226 | if( $this->mustRender()) { |
213 | 227 | if( $this->canRender() ) { |
214 | 228 | return $this->createThumb( $this->getWidth() ); |
215 | | - } |
216 | | - else { |
| 229 | + } else { |
217 | 230 | wfDebug(__METHOD__.': supposed to render '.$this->getName().' ('.$this->getMimeType()."), but can't!\n"); |
218 | 231 | return $this->getURL(); #hm... return NULL? |
219 | 232 | } |
— | — | @@ -231,6 +244,8 @@ |
232 | 245 | * |
233 | 246 | * Most callers don't check the return value, but ForeignAPIFile::getPath |
234 | 247 | * returns false. |
| 248 | + * |
| 249 | + * @return string|false |
235 | 250 | */ |
236 | 251 | public function getPath() { |
237 | 252 | if ( !isset( $this->path ) ) { |
— | — | @@ -240,10 +255,12 @@ |
241 | 256 | } |
242 | 257 | |
243 | 258 | /** |
244 | | - * Alias for getPath() |
245 | | - * |
246 | | - * @deprecated since 1.18 Use getPath(). |
247 | | - */ |
| 259 | + * Alias for getPath() |
| 260 | + * |
| 261 | + * @deprecated since 1.18 Use getPath(). |
| 262 | + * |
| 263 | + * @return string |
| 264 | + */ |
248 | 265 | public function getFullPath() { |
249 | 266 | wfDeprecated( __METHOD__ ); |
250 | 267 | return $this->getPath(); |
— | — | @@ -255,8 +272,14 @@ |
256 | 273 | * |
257 | 274 | * STUB |
258 | 275 | * Overridden by LocalFile, UnregisteredLocalFile |
| 276 | + * |
| 277 | + * @param $page int |
| 278 | + * |
| 279 | + * @return number |
259 | 280 | */ |
260 | | - public function getWidth( $page = 1 ) { return false; } |
| 281 | + public function getWidth( $page = 1 ) { |
| 282 | + return false; |
| 283 | + } |
261 | 284 | |
262 | 285 | /** |
263 | 286 | * Return the height of the image. Returns false if the height is unknown |
— | — | @@ -265,7 +288,9 @@ |
266 | 289 | * STUB |
267 | 290 | * Overridden by LocalFile, UnregisteredLocalFile |
268 | 291 | */ |
269 | | - public function getHeight( $page = 1 ) { return false; } |
| 292 | + public function getHeight( $page = 1 ) { |
| 293 | + return false; |
| 294 | + } |
270 | 295 | |
271 | 296 | /** |
272 | 297 | * Returns ID or name of user who uploaded the file |
— | — | @@ -273,10 +298,14 @@ |
274 | 299 | * |
275 | 300 | * @param $type string 'text' or 'id' |
276 | 301 | */ |
277 | | - public function getUser( $type='text' ) { return null; } |
| 302 | + public function getUser( $type='text' ) { |
| 303 | + return null; |
| 304 | + } |
278 | 305 | |
279 | 306 | /** |
280 | 307 | * Get the duration of a media file in seconds |
| 308 | + * |
| 309 | + * @return number |
281 | 310 | */ |
282 | 311 | public function getLength() { |
283 | 312 | $handler = $this->getHandler(); |
— | — | @@ -289,6 +318,8 @@ |
290 | 319 | |
291 | 320 | /** |
292 | 321 | * Return true if the file is vectorized |
| 322 | + * |
| 323 | + * @retur bool |
293 | 324 | */ |
294 | 325 | public function isVectorized() { |
295 | 326 | $handler = $this->getHandler(); |
— | — | @@ -299,7 +330,6 @@ |
300 | 331 | } |
301 | 332 | } |
302 | 333 | |
303 | | - |
304 | 334 | /** |
305 | 335 | * Get handler-specific metadata |
306 | 336 | * Overridden by LocalFile, UnregisteredLocalFile |
— | — | @@ -345,6 +375,8 @@ |
346 | 376 | * Returns the mime type of the file. |
347 | 377 | * Overridden by LocalFile, UnregisteredLocalFile |
348 | 378 | * STUB |
| 379 | + * |
| 380 | + * @return string |
349 | 381 | */ |
350 | 382 | function getMimeType() { return 'unknown/unknown'; } |
351 | 383 | |
— | — | @@ -365,6 +397,8 @@ |
366 | 398 | * that can be converted to a format |
367 | 399 | * supported by all browsers (namely GIF, PNG and JPEG), |
368 | 400 | * or if it is an SVG image and SVG conversion is enabled. |
| 401 | + * |
| 402 | + * @return bool |
369 | 403 | */ |
370 | 404 | function canRender() { |
371 | 405 | if ( !isset( $this->canRender ) ) { |
— | — | @@ -396,6 +430,8 @@ |
397 | 431 | |
398 | 432 | /** |
399 | 433 | * Alias for canRender() |
| 434 | + * |
| 435 | + * @return bool |
400 | 436 | */ |
401 | 437 | function allowInlineDisplay() { |
402 | 438 | return $this->canRender(); |
— | — | @@ -411,6 +447,8 @@ |
412 | 448 | * |
413 | 449 | * Note that this function will always return true if allowInlineDisplay() |
414 | 450 | * or isTrustedFile() is true for this file. |
| 451 | + * |
| 452 | + * @return bool |
415 | 453 | */ |
416 | 454 | function isSafeFile() { |
417 | 455 | if ( !isset( $this->isSafeFile ) ) { |
— | — | @@ -426,34 +464,49 @@ |
427 | 465 | |
428 | 466 | /** Uncached accessor */ |
429 | 467 | protected function _getIsSafeFile() { |
430 | | - if ($this->allowInlineDisplay()) return true; |
431 | | - if ($this->isTrustedFile()) return true; |
| 468 | + if ( $this->allowInlineDisplay() ) { |
| 469 | + return true; |
| 470 | + } |
| 471 | + if ($this->isTrustedFile()) { |
| 472 | + return true; |
| 473 | + } |
432 | 474 | |
433 | 475 | global $wgTrustedMediaFormats; |
434 | 476 | |
435 | | - $type= $this->getMediaType(); |
436 | | - $mime= $this->getMimeType(); |
| 477 | + $type = $this->getMediaType(); |
| 478 | + $mime = $this->getMimeType(); |
437 | 479 | #wfDebug("LocalFile::isSafeFile: type= $type, mime= $mime\n"); |
438 | 480 | |
439 | | - if (!$type || $type===MEDIATYPE_UNKNOWN) return false; #unknown type, not trusted |
440 | | - if ( in_array( $type, $wgTrustedMediaFormats) ) return true; |
| 481 | + if ( !$type || $type === MEDIATYPE_UNKNOWN ) { |
| 482 | + return false; #unknown type, not trusted |
| 483 | + } |
| 484 | + if ( in_array( $type, $wgTrustedMediaFormats ) ) { |
| 485 | + return true; |
| 486 | + } |
441 | 487 | |
442 | | - if ($mime==="unknown/unknown") return false; #unknown type, not trusted |
443 | | - if ( in_array( $mime, $wgTrustedMediaFormats) ) return true; |
| 488 | + if ( $mime === "unknown/unknown" ) { |
| 489 | + return false; #unknown type, not trusted |
| 490 | + } |
| 491 | + if ( in_array( $mime, $wgTrustedMediaFormats) ) { |
| 492 | + return true; |
| 493 | + } |
444 | 494 | |
445 | 495 | return false; |
446 | 496 | } |
447 | 497 | |
448 | | - /** Returns true if the file is flagged as trusted. Files flagged that way |
449 | | - * can be linked to directly, even if that is not allowed for this type of |
450 | | - * file normally. |
451 | | - * |
452 | | - * This is a dummy function right now and always returns false. It could be |
453 | | - * implemented to extract a flag from the database. The trusted flag could be |
454 | | - * set on upload, if the user has sufficient privileges, to bypass script- |
455 | | - * and html-filters. It may even be coupled with cryptographics signatures |
456 | | - * or such. |
457 | | - */ |
| 498 | + /** |
| 499 | + * Returns true if the file is flagged as trusted. Files flagged that way |
| 500 | + * can be linked to directly, even if that is not allowed for this type of |
| 501 | + * file normally. |
| 502 | + * |
| 503 | + * This is a dummy function right now and always returns false. It could be |
| 504 | + * implemented to extract a flag from the database. The trusted flag could be |
| 505 | + * set on upload, if the user has sufficient privileges, to bypass script- |
| 506 | + * and html-filters. It may even be coupled with cryptographics signatures |
| 507 | + * or such. |
| 508 | + * |
| 509 | + * @return bool |
| 510 | + */ |
458 | 511 | function isTrustedFile() { |
459 | 512 | #this could be implemented to check a flag in the databas, |
460 | 513 | #look for signatures, etc |
— | — | @@ -481,6 +534,9 @@ |
482 | 535 | return $this->exists(); |
483 | 536 | } |
484 | 537 | |
| 538 | + /** |
| 539 | + * @return string |
| 540 | + */ |
485 | 541 | function getTransformScript() { |
486 | 542 | if ( !isset( $this->transformScript ) ) { |
487 | 543 | $this->transformScript = false; |
— | — | @@ -496,6 +552,10 @@ |
497 | 553 | |
498 | 554 | /** |
499 | 555 | * Get a ThumbnailImage which is the same size as the source |
| 556 | + * |
| 557 | + * @param $handlerParams array |
| 558 | + * |
| 559 | + * @return string |
500 | 560 | */ |
501 | 561 | function getUnscaledThumb( $handlerParams = array() ) { |
502 | 562 | $hp =& $handlerParams; |
— | — | @@ -513,6 +573,8 @@ |
514 | 574 | * |
515 | 575 | * @param $params Array: handler-specific parameters |
516 | 576 | * @private -ish |
| 577 | + * |
| 578 | + * @return string |
517 | 579 | */ |
518 | 580 | function thumbName( $params ) { |
519 | 581 | return $this->generateThumbName( $this->getName(), $params ); |
— | — | @@ -523,6 +585,8 @@ |
524 | 586 | * |
525 | 587 | * @param string $name |
526 | 588 | * @param array $params Parameters which will be passed to MediaHandler::makeParamString |
| 589 | + * |
| 590 | + * @return string |
527 | 591 | */ |
528 | 592 | function generateThumbName( $name, $params ) { |
529 | 593 | if ( !$this->getHandler() ) { |
— | — | @@ -551,6 +615,8 @@ |
552 | 616 | * |
553 | 617 | * @param $width Integer: maximum width of the generated thumbnail |
554 | 618 | * @param $height Integer: maximum height of the image (optional) |
| 619 | + * |
| 620 | + * @return string |
555 | 621 | */ |
556 | 622 | public function createThumb( $width, $height = -1 ) { |
557 | 623 | $params = array( 'width' => $width ); |
— | — | @@ -691,7 +757,9 @@ |
692 | 758 | * STUB |
693 | 759 | * Overridden by LocalFile |
694 | 760 | */ |
695 | | - function getThumbnails() { return array(); } |
| 761 | + function getThumbnails() { |
| 762 | + return array(); |
| 763 | + } |
696 | 764 | |
697 | 765 | /** |
698 | 766 | * Purge shared caches such as thumbnails and DB data caching |
— | — | @@ -738,6 +806,8 @@ |
739 | 807 | * @param $start timestamp Only revisions older than $start will be returned |
740 | 808 | * @param $end timestamp Only revisions newer than $end will be returned |
741 | 809 | * @param $inc bool Include the endpoints of the time range |
| 810 | + * |
| 811 | + * @return array |
742 | 812 | */ |
743 | 813 | function getHistory($limit = null, $start = null, $end = null, $inc=true) { |
744 | 814 | return array(); |
— | — | @@ -767,6 +837,8 @@ |
768 | 838 | * Get the filename hash component of the directory including trailing slash, |
769 | 839 | * e.g. f/fa/ |
770 | 840 | * If the repository is not hashed, returns an empty string. |
| 841 | + * |
| 842 | + * @return string |
771 | 843 | */ |
772 | 844 | function getHashPath() { |
773 | 845 | if ( !isset( $this->hashPath ) ) { |
— | — | @@ -777,6 +849,8 @@ |
778 | 850 | |
779 | 851 | /** |
780 | 852 | * Get the path of the file relative to the public zone root |
| 853 | + * |
| 854 | + * @return string |
781 | 855 | */ |
782 | 856 | function getRel() { |
783 | 857 | return $this->getHashPath() . $this->getName(); |
— | — | @@ -784,12 +858,20 @@ |
785 | 859 | |
786 | 860 | /** |
787 | 861 | * Get urlencoded relative path of the file |
| 862 | + * |
| 863 | + * @return string |
788 | 864 | */ |
789 | 865 | function getUrlRel() { |
790 | 866 | return $this->getHashPath() . rawurlencode( $this->getName() ); |
791 | 867 | } |
792 | 868 | |
793 | | - /** Get the relative path for an archive file */ |
| 869 | + /** |
| 870 | + * Get the relative path for an archive file |
| 871 | + * |
| 872 | + * @param $suffix bool |
| 873 | + * |
| 874 | + * @return string |
| 875 | + */ |
794 | 876 | function getArchiveRel( $suffix = false ) { |
795 | 877 | $path = 'archive/' . $this->getHashPath(); |
796 | 878 | if ( $suffix === false ) { |
— | — | @@ -800,12 +882,24 @@ |
801 | 883 | return $path; |
802 | 884 | } |
803 | 885 | |
804 | | - /** Get the path of the archive directory, or a particular file if $suffix is specified */ |
| 886 | + /** |
| 887 | + * Get the path of the archive directory, or a particular file if $suffix is specified |
| 888 | + * |
| 889 | + * @param $suffix bool |
| 890 | + * |
| 891 | + * @return string |
| 892 | + */ |
805 | 893 | function getArchivePath( $suffix = false ) { |
806 | 894 | return $this->repo->getZonePath('public') . '/' . $this->getArchiveRel( $suffix ); |
807 | 895 | } |
808 | 896 | |
809 | | - /** Get the path of the thumbnail directory, or a particular file if $suffix is specified */ |
| 897 | + /** |
| 898 | + * Get the path of the thumbnail directory, or a particular file if $suffix is specified |
| 899 | + * |
| 900 | + * @param $suffix bool |
| 901 | + * |
| 902 | + * @return string |
| 903 | + */ |
810 | 904 | function getThumbPath( $suffix = false ) { |
811 | 905 | $path = $this->repo->getZonePath('thumb') . '/' . $this->getRel(); |
812 | 906 | if ( $suffix !== false ) { |
— | — | @@ -814,7 +908,13 @@ |
815 | 909 | return $path; |
816 | 910 | } |
817 | 911 | |
818 | | - /** Get the URL of the archive directory, or a particular file if $suffix is specified */ |
| 912 | + /** |
| 913 | + * Get the URL of the archive directory, or a particular file if $suffix is specified |
| 914 | + * |
| 915 | + * @param $suffix bool |
| 916 | + * |
| 917 | + * @return string |
| 918 | + */ |
819 | 919 | function getArchiveUrl( $suffix = false ) { |
820 | 920 | $path = $this->repo->getZoneUrl('public') . '/archive/' . $this->getHashPath(); |
821 | 921 | if ( $suffix === false ) { |
— | — | @@ -825,7 +925,13 @@ |
826 | 926 | return $path; |
827 | 927 | } |
828 | 928 | |
829 | | - /** Get the URL of the thumbnail directory, or a particular file if $suffix is specified */ |
| 929 | + /** |
| 930 | + * Get the URL of the thumbnail directory, or a particular file if $suffix is specified |
| 931 | + * |
| 932 | + * @param $suffix bool |
| 933 | + * |
| 934 | + * @return path |
| 935 | + */ |
830 | 936 | function getThumbUrl( $suffix = false ) { |
831 | 937 | $path = $this->repo->getZoneUrl('thumb') . '/' . $this->getUrlRel(); |
832 | 938 | if ( $suffix !== false ) { |
— | — | @@ -834,7 +940,13 @@ |
835 | 941 | return $path; |
836 | 942 | } |
837 | 943 | |
838 | | - /** Get the virtual URL for an archive file or directory */ |
| 944 | + /** |
| 945 | + * Get the virtual URL for an archive file or directory |
| 946 | + * |
| 947 | + * @param $suffix string |
| 948 | + * |
| 949 | + * @return string |
| 950 | + */ |
839 | 951 | function getArchiveVirtualUrl( $suffix = false ) { |
840 | 952 | $path = $this->repo->getVirtualUrl() . '/public/archive/' . $this->getHashPath(); |
841 | 953 | if ( $suffix === false ) { |
— | — | @@ -845,7 +957,13 @@ |
846 | 958 | return $path; |
847 | 959 | } |
848 | 960 | |
849 | | - /** Get the virtual URL for a thumbnail file or directory */ |
| 961 | + /** |
| 962 | + * Get the virtual URL for a thumbnail file or directory |
| 963 | + * |
| 964 | + * @param $suffix bool |
| 965 | + * |
| 966 | + * @return string |
| 967 | + */ |
850 | 968 | function getThumbVirtualUrl( $suffix = false ) { |
851 | 969 | $path = $this->repo->getVirtualUrl() . '/thumb/' . $this->getUrlRel(); |
852 | 970 | if ( $suffix !== false ) { |
— | — | @@ -854,7 +972,13 @@ |
855 | 973 | return $path; |
856 | 974 | } |
857 | 975 | |
858 | | - /** Get the virtual URL for the file itself */ |
| 976 | + /** |
| 977 | + * Get the virtual URL for the file itself |
| 978 | + * |
| 979 | + * @param $suffix bool |
| 980 | + * |
| 981 | + * @return string |
| 982 | + */ |
859 | 983 | function getVirtualUrl( $suffix = false ) { |
860 | 984 | $path = $this->repo->getVirtualUrl() . '/public/' . $this->getUrlRel(); |
861 | 985 | if ( $suffix !== false ) { |
— | — | @@ -878,6 +1002,12 @@ |
879 | 1003 | * Record a file upload in the upload log and the image table |
880 | 1004 | * STUB |
881 | 1005 | * Overridden by LocalFile |
| 1006 | + * @param $oldver |
| 1007 | + * @param $desc |
| 1008 | + * @param $license string |
| 1009 | + * @param $copyStatus string |
| 1010 | + * @param $source string |
| 1011 | + * @param $watch bool |
882 | 1012 | */ |
883 | 1013 | function recordUpload( $oldver, $desc, $license = '', $copyStatus = '', $source = '', $watch = false ) { |
884 | 1014 | $this->readOnlyError(); |
— | — | @@ -905,6 +1035,9 @@ |
906 | 1036 | $this->readOnlyError(); |
907 | 1037 | } |
908 | 1038 | |
| 1039 | + /** |
| 1040 | + * @return bool |
| 1041 | + */ |
909 | 1042 | function formatMetadata() { |
910 | 1043 | if ( !$this->getHandler() ) { |
911 | 1044 | return false; |
— | — | @@ -931,8 +1064,10 @@ |
932 | 1065 | return $this->repo ? $this->repo->getName() : 'unknown'; |
933 | 1066 | } |
934 | 1067 | |
935 | | - /* |
| 1068 | + /** |
936 | 1069 | * Returns the repository |
| 1070 | + * |
| 1071 | + * @return FileRepo |
937 | 1072 | */ |
938 | 1073 | function getRepo() { |
939 | 1074 | return $this->repo; |
— | — | @@ -941,6 +1076,8 @@ |
942 | 1077 | /** |
943 | 1078 | * Returns true if the image is an old version |
944 | 1079 | * STUB |
| 1080 | + * |
| 1081 | + * @return bool |
945 | 1082 | */ |
946 | 1083 | function isOld() { |
947 | 1084 | return false; |
— | — | @@ -949,6 +1086,10 @@ |
950 | 1087 | /** |
951 | 1088 | * Is this file a "deleted" file in a private archive? |
952 | 1089 | * STUB |
| 1090 | + * |
| 1091 | + * @param $field |
| 1092 | + * |
| 1093 | + * @return bool |
953 | 1094 | */ |
954 | 1095 | function isDeleted( $field ) { |
955 | 1096 | return false; |
— | — | @@ -1012,15 +1153,15 @@ |
1013 | 1154 | * |
1014 | 1155 | * May throw database exceptions on error. |
1015 | 1156 | * |
1016 | | - * @param $versions set of record ids of deleted items to restore, |
| 1157 | + * @param $versions array set of record ids of deleted items to restore, |
1017 | 1158 | * or empty to restore all revisions. |
1018 | | - * @param $unsuppress remove restrictions on content upon restoration? |
1019 | | - * @return the number of file revisions restored if successful, |
| 1159 | + * @param $unsuppress bool remove restrictions on content upon restoration? |
| 1160 | + * @return int|false the number of file revisions restored if successful, |
1020 | 1161 | * or false on failure |
1021 | 1162 | * STUB |
1022 | 1163 | * Overridden by LocalFile |
1023 | 1164 | */ |
1024 | | - function restore( $versions=array(), $unsuppress=false ) { |
| 1165 | + function restore( $versions = array(), $unsuppress = false ) { |
1025 | 1166 | $this->readOnlyError(); |
1026 | 1167 | } |
1027 | 1168 | |
— | — | @@ -1038,6 +1179,8 @@ |
1039 | 1180 | /** |
1040 | 1181 | * Returns the number of pages of a multipage document, or false for |
1041 | 1182 | * documents which aren't multipage documents |
| 1183 | + * |
| 1184 | + * @return false|int |
1042 | 1185 | */ |
1043 | 1186 | function pageCount() { |
1044 | 1187 | if ( !isset( $this->pageCount ) ) { |
— | — | @@ -1052,6 +1195,12 @@ |
1053 | 1196 | |
1054 | 1197 | /** |
1055 | 1198 | * Calculate the height of a thumbnail using the source and destination width |
| 1199 | + * |
| 1200 | + * @param $srcWidth |
| 1201 | + * @param $srcHeight |
| 1202 | + * @param $dstWidth |
| 1203 | + * |
| 1204 | + * @return int |
1056 | 1205 | */ |
1057 | 1206 | static function scaleHeight( $srcWidth, $srcHeight, $dstWidth ) { |
1058 | 1207 | // Exact integer multiply followed by division |
— | — | @@ -1079,6 +1228,8 @@ |
1080 | 1229 | /** |
1081 | 1230 | * Get the URL of the image description page. May return false if it is |
1082 | 1231 | * unknown or not applicable. |
| 1232 | + * |
| 1233 | + * @return string |
1083 | 1234 | */ |
1084 | 1235 | function getDescriptionUrl() { |
1085 | 1236 | return $this->repo->getDescriptionUrl( $this->getName() ); |
— | — | @@ -1086,6 +1237,8 @@ |
1087 | 1238 | |
1088 | 1239 | /** |
1089 | 1240 | * Get the HTML text of the description page, if available |
| 1241 | + * |
| 1242 | + * @return string |
1090 | 1243 | */ |
1091 | 1244 | function getDescriptionText() { |
1092 | 1245 | global $wgMemc, $wgLang; |
— | — | @@ -1119,6 +1272,8 @@ |
1120 | 1273 | /** |
1121 | 1274 | * Get discription of file revision |
1122 | 1275 | * STUB |
| 1276 | + * |
| 1277 | + * @return string |
1123 | 1278 | */ |
1124 | 1279 | function getDescription() { |
1125 | 1280 | return null; |
— | — | @@ -1127,6 +1282,8 @@ |
1128 | 1283 | /** |
1129 | 1284 | * Get the 14-character timestamp of the file upload, or false if |
1130 | 1285 | * it doesn't exist |
| 1286 | + * |
| 1287 | + * @return string |
1131 | 1288 | */ |
1132 | 1289 | function getTimestamp() { |
1133 | 1290 | $path = $this->getPath(); |
— | — | @@ -1138,6 +1295,8 @@ |
1139 | 1296 | |
1140 | 1297 | /** |
1141 | 1298 | * Get the SHA-1 base 36 hash of the file |
| 1299 | + * |
| 1300 | + * @return string |
1142 | 1301 | */ |
1143 | 1302 | function getSha1() { |
1144 | 1303 | return self::sha1Base36( $this->getPath() ); |
— | — | @@ -1145,6 +1304,8 @@ |
1146 | 1305 | |
1147 | 1306 | /** |
1148 | 1307 | * Get the deletion archive key, <sha1>.<ext> |
| 1308 | + * |
| 1309 | + * @return string |
1149 | 1310 | */ |
1150 | 1311 | function getStorageKey() { |
1151 | 1312 | $hash = $this->getSha1(); |
— | — | @@ -1173,6 +1334,8 @@ |
1174 | 1335 | * @param $path String: absolute local filesystem path |
1175 | 1336 | * @param $ext Mixed: the file extension, or true to extract it from the filename. |
1176 | 1337 | * Set it to false to ignore the extension. |
| 1338 | + * |
| 1339 | + * @return array |
1177 | 1340 | */ |
1178 | 1341 | static function getPropsFromPath( $path, $ext = true ) { |
1179 | 1342 | wfProfileIn( __METHOD__ ); |
— | — | @@ -1246,6 +1409,10 @@ |
1247 | 1410 | * fairly neatly. |
1248 | 1411 | * |
1249 | 1412 | * Returns false on failure |
| 1413 | + * |
| 1414 | + * @param $path string |
| 1415 | + * |
| 1416 | + * @return false|string |
1250 | 1417 | */ |
1251 | 1418 | static function sha1Base36( $path ) { |
1252 | 1419 | wfSuppressWarnings(); |
— | — | @@ -1258,6 +1425,9 @@ |
1259 | 1426 | } |
1260 | 1427 | } |
1261 | 1428 | |
| 1429 | + /** |
| 1430 | + * @return string |
| 1431 | + */ |
1262 | 1432 | function getLongDesc() { |
1263 | 1433 | $handler = $this->getHandler(); |
1264 | 1434 | if ( $handler ) { |
— | — | @@ -1267,6 +1437,9 @@ |
1268 | 1438 | } |
1269 | 1439 | } |
1270 | 1440 | |
| 1441 | + /** |
| 1442 | + * @return string |
| 1443 | + */ |
1271 | 1444 | function getShortDesc() { |
1272 | 1445 | $handler = $this->getHandler(); |
1273 | 1446 | if ( $handler ) { |
— | — | @@ -1276,6 +1449,9 @@ |
1277 | 1450 | } |
1278 | 1451 | } |
1279 | 1452 | |
| 1453 | + /** |
| 1454 | + * @return string |
| 1455 | + */ |
1280 | 1456 | function getDimensionsString() { |
1281 | 1457 | $handler = $this->getHandler(); |
1282 | 1458 | if ( $handler ) { |
— | — | @@ -1285,10 +1461,16 @@ |
1286 | 1462 | } |
1287 | 1463 | } |
1288 | 1464 | |
| 1465 | + /** |
| 1466 | + * @return |
| 1467 | + */ |
1289 | 1468 | function getRedirected() { |
1290 | 1469 | return $this->redirected; |
1291 | 1470 | } |
1292 | 1471 | |
| 1472 | + /** |
| 1473 | + * @return Title |
| 1474 | + */ |
1293 | 1475 | function getRedirectedTitle() { |
1294 | 1476 | if ( $this->redirected ) { |
1295 | 1477 | if ( !$this->redirectTitle ) { |
— | — | @@ -1298,10 +1480,17 @@ |
1299 | 1481 | } |
1300 | 1482 | } |
1301 | 1483 | |
| 1484 | + /** |
| 1485 | + * @param $from |
| 1486 | + * @return void |
| 1487 | + */ |
1302 | 1488 | function redirectedFrom( $from ) { |
1303 | 1489 | $this->redirected = $from; |
1304 | 1490 | } |
1305 | 1491 | |
| 1492 | + /** |
| 1493 | + * @return bool |
| 1494 | + */ |
1306 | 1495 | function isMissing() { |
1307 | 1496 | return false; |
1308 | 1497 | } |