Index: trunk/phase3/includes/filerepo/LocalFile.php |
— | — | @@ -484,7 +484,7 @@ |
485 | 485 | /** |
486 | 486 | * Delete all previously generated thumbnails, refresh metadata in memcached and purge the squid |
487 | 487 | */ |
488 | | - function purgeCache() { |
| 488 | + function purgeCache( $archiveFiles = array() ) { |
489 | 489 | // Refresh metadata cache |
490 | 490 | $this->purgeMetadataCache(); |
491 | 491 | |
Index: trunk/phase3/includes/filerepo/UnregisteredLocalFile.php |
— | — | @@ -72,7 +72,7 @@ |
73 | 73 | return $this->mime; |
74 | 74 | } |
75 | 75 | |
76 | | - function getImageSize() { |
| 76 | + function getImageSize( $filename ) { |
77 | 77 | if ( !$this->getHandler() ) { |
78 | 78 | return false; |
79 | 79 | } |
— | — | @@ -105,5 +105,7 @@ |
106 | 106 | return false; |
107 | 107 | } |
108 | 108 | } |
| 109 | + |
| 110 | + function getMediaType() { return MEDIATYPE_UNKNOWN; } |
109 | 111 | } |
110 | 112 | ?> |
Index: trunk/phase3/includes/filerepo/File.php |
— | — | @@ -1,8 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | /** |
5 | | - * Base file class. Do not instantiate. |
6 | | - * |
7 | 5 | * Implements some public methods and some protected utility functions which |
8 | 6 | * are required by multiple child classes. Contains stub functionality for |
9 | 7 | * unimplemented public methods. |
— | — | @@ -21,7 +19,7 @@ |
22 | 20 | * |
23 | 21 | * @addtogroup FileRepo |
24 | 22 | */ |
25 | | -class File { |
| 23 | +abstract class File { |
26 | 24 | const DELETED_FILE = 1; |
27 | 25 | const DELETED_COMMENT = 2; |
28 | 26 | const DELETED_USER = 4; |
— | — | @@ -115,9 +113,8 @@ |
116 | 114 | |
117 | 115 | /** |
118 | 116 | * Return the name of this file |
119 | | - * @public |
120 | 117 | */ |
121 | | - function getName() { |
| 118 | + public function getName() { |
122 | 119 | if ( !isset( $this->name ) ) { |
123 | 120 | $this->name = $this->repo->getNameFromTitle( $this->title ); |
124 | 121 | } |
— | — | @@ -200,9 +197,8 @@ |
201 | 198 | * |
202 | 199 | * STUB |
203 | 200 | * Overridden by LocalFile, UnregisteredLocalFile |
204 | | - * @public |
205 | 201 | */ |
206 | | - function getWidth( $page = 1 ) { return false; } |
| 202 | + public function getWidth( $page = 1 ) { return false; } |
207 | 203 | |
208 | 204 | /** |
209 | 205 | * Return the height of the image. Returns false if the height is unknown |
— | — | @@ -210,24 +206,22 @@ |
211 | 207 | * |
212 | 208 | * STUB |
213 | 209 | * Overridden by LocalFile, UnregisteredLocalFile |
214 | | - * @public |
215 | 210 | */ |
216 | | - function getHeight( $page = 1 ) { return false; } |
| 211 | + public function getHeight( $page = 1 ) { return false; } |
217 | 212 | |
218 | 213 | /** |
219 | 214 | * Get handler-specific metadata |
220 | 215 | * Overridden by LocalFile, UnregisteredLocalFile |
221 | 216 | * STUB |
222 | 217 | */ |
223 | | - function getMetadata() { return false; } |
| 218 | + public function getMetadata() { return false; } |
224 | 219 | |
225 | 220 | /** |
226 | 221 | * Return the size of the image file, in bytes |
227 | 222 | * Overridden by LocalFile, UnregisteredLocalFile |
228 | 223 | * STUB |
229 | | - * @public |
230 | 224 | */ |
231 | | - function getSize() { return false; } |
| 225 | + public function getSize() { return false; } |
232 | 226 | |
233 | 227 | /** |
234 | 228 | * Returns the mime type of the file. |
— | — | @@ -357,9 +351,8 @@ |
358 | 352 | * Overridden by LocalFile to avoid unnecessary stat calls. |
359 | 353 | * |
360 | 354 | * @return boolean Whether file exists in the repository. |
361 | | - * @public |
362 | 355 | */ |
363 | | - function exists() { |
| 356 | + public function exists() { |
364 | 357 | return $this->getPath() && file_exists( $this->path ); |
365 | 358 | } |
366 | 359 | |
— | — | @@ -399,9 +392,8 @@ |
400 | 393 | * Return the file name of a thumbnail with the specified parameters |
401 | 394 | * |
402 | 395 | * @param array $params Handler-specific parameters |
403 | | - * @private |
404 | 396 | */ |
405 | | - function thumbName( $params ) { |
| 397 | + protected function thumbName( $params ) { |
406 | 398 | if ( !$this->getHandler() ) { |
407 | 399 | return null; |
408 | 400 | } |
— | — | @@ -428,9 +420,8 @@ |
429 | 421 | * |
430 | 422 | * @param integer $width maximum width of the generated thumbnail |
431 | 423 | * @param integer $height maximum height of the image (optional) |
432 | | - * @public |
433 | 424 | */ |
434 | | - function createThumb( $width, $height = -1 ) { |
| 425 | + public function createThumb( $width, $height = -1 ) { |
435 | 426 | $params = array( 'width' => $width ); |
436 | 427 | if ( $height != -1 ) { |
437 | 428 | $params['height'] = $height; |
— | — | @@ -453,11 +444,10 @@ |
454 | 445 | * false to just return the URL |
455 | 446 | * |
456 | 447 | * @return ThumbnailImage or null on failure |
457 | | - * @public |
458 | 448 | * |
459 | 449 | * @deprecated use transform() |
460 | 450 | */ |
461 | | - function getThumbnail( $width, $height=-1, $render = true ) { |
| 451 | + public function getThumbnail( $width, $height=-1, $render = true ) { |
462 | 452 | $params = array( 'width' => $width ); |
463 | 453 | if ( $height != -1 ) { |
464 | 454 | $params['height'] = $height; |
— | — | @@ -535,7 +525,7 @@ |
536 | 526 | * STUB |
537 | 527 | * Overridden by LocalFile |
538 | 528 | */ |
539 | | - function migrateThumbFile() {} |
| 529 | + function migrateThumbFile( $thumbName ) {} |
540 | 530 | |
541 | 531 | /** |
542 | 532 | * Get a MediaHandler instance for this file |
— | — | @@ -624,21 +614,19 @@ |
625 | 615 | * then old versions. Should return an object similar to an image/oldimage |
626 | 616 | * database row. |
627 | 617 | * |
628 | | - * @public |
629 | 618 | * STUB |
630 | 619 | * Overridden in LocalFile |
631 | 620 | */ |
632 | | - function nextHistoryLine() { |
| 621 | + public function nextHistoryLine() { |
633 | 622 | return false; |
634 | 623 | } |
635 | 624 | |
636 | 625 | /** |
637 | 626 | * Reset the history pointer to the first element of the history |
638 | | - * @public |
639 | 627 | * STUB |
640 | 628 | * Overridden in LocalFile. |
641 | 629 | */ |
642 | | - function resetHistory() {} |
| 630 | + public function resetHistory() {} |
643 | 631 | |
644 | 632 | /** |
645 | 633 | * Get the filename hash component of the directory including trailing slash, |