Index: trunk/phase3/includes/filerepo/file/File.php |
— | — | @@ -1293,8 +1293,7 @@ |
1294 | 1294 | * @return bool |
1295 | 1295 | */ |
1296 | 1296 | function isLocal() { |
1297 | | - $repo = $this->getRepo(); |
1298 | | - return $repo && $repo->isLocal(); |
| 1297 | + return $this->repo && $this->repo->isLocal(); |
1299 | 1298 | } |
1300 | 1299 | |
1301 | 1300 | /** |
Index: trunk/phase3/includes/filerepo/FileRepo.php |
— | — | @@ -42,9 +42,6 @@ |
43 | 43 | function __construct( $info ) { |
44 | 44 | // Required settings |
45 | 45 | $this->name = $info['name']; |
46 | | - $this->url = isset( $info['url'] ) |
47 | | - ? $info['url'] |
48 | | - : false; // a subclass will need to set the URL (e.g. ForeignAPIRepo) |
49 | 46 | if ( $info['backend'] instanceof FileBackendBase ) { |
50 | 47 | $this->backend = $info['backend']; // useful for testing |
51 | 48 | } else { |
— | — | @@ -67,9 +64,14 @@ |
68 | 65 | $this->initialCapital = isset( $info['initialCapital'] ) |
69 | 66 | ? $info['initialCapital'] |
70 | 67 | : MWNamespace::isCapitalized( NS_FILE ); |
71 | | - $this->thumbUrl = isset( $info['thumbUrl'] ) |
72 | | - ? $info['thumbUrl'] |
73 | | - : "{$this->url}/thumb"; |
| 68 | + $this->url = isset( $info['url'] ) |
| 69 | + ? $info['url'] |
| 70 | + : false; // a subclass may set the URL (e.g. ForeignAPIRepo) |
| 71 | + if ( isset( $info['thumbUrl'] ) ) { |
| 72 | + $this->thumbUrl = $info['thumbUrl']; |
| 73 | + } else { |
| 74 | + $this->thumbUrl = $this->url ? "{$this->url}/thumb" : false; |
| 75 | + } |
74 | 76 | $this->hashLevels = isset( $info['hashLevels'] ) |
75 | 77 | ? $info['hashLevels'] |
76 | 78 | : 2; |
— | — | @@ -414,7 +416,7 @@ |
415 | 417 | /** |
416 | 418 | * Get the public root URL of the repository |
417 | 419 | * |
418 | | - * @return string |
| 420 | + * @return string|false |
419 | 421 | */ |
420 | 422 | public function getRootUrl() { |
421 | 423 | return $this->url; |
— | — | @@ -526,11 +528,14 @@ |
527 | 529 | * |
528 | 530 | * @param $query mixed Query string to append |
529 | 531 | * @param $entry string Entry point; defaults to index |
530 | | - * @return string |
| 532 | + * @return string|false |
531 | 533 | */ |
532 | 534 | public function makeUrl( $query = '', $entry = 'index' ) { |
533 | | - $ext = isset( $this->scriptExtension ) ? $this->scriptExtension : '.php'; |
534 | | - return wfAppendQuery( "{$this->scriptDirUrl}/{$entry}{$ext}", $query ); |
| 535 | + if ( isset( $this->scriptDirUrl ) ) { |
| 536 | + $ext = isset( $this->scriptExtension ) ? $this->scriptExtension : '.php'; |
| 537 | + return wfAppendQuery( "{$this->scriptDirUrl}/{$entry}{$ext}", $query ); |
| 538 | + } |
| 539 | + return false; |
535 | 540 | } |
536 | 541 | |
537 | 542 | /** |
— | — | @@ -603,13 +608,14 @@ |
604 | 609 | /** |
605 | 610 | * Get the URL of the stylesheet to apply to description pages |
606 | 611 | * |
607 | | - * @return string |
| 612 | + * @return string|false |
608 | 613 | */ |
609 | 614 | public function getDescriptionStylesheetUrl() { |
610 | | - if ( $this->scriptDirUrl ) { |
| 615 | + if ( isset( $this->scriptDirUrl ) ) { |
611 | 616 | return $this->makeUrl( 'title=MediaWiki:Filepage.css&' . |
612 | 617 | wfArrayToCGI( Skin::getDynamicStylesheetQuery() ) ); |
613 | 618 | } |
| 619 | + return false; |
614 | 620 | } |
615 | 621 | |
616 | 622 | /** |