Index: trunk/phase3/includes/Setup.php |
— | — | @@ -192,7 +192,6 @@ |
193 | 193 | $wgForeignFileRepos[] = array( |
194 | 194 | 'class' => 'ForeignAPIRepo', |
195 | 195 | 'name' => 'wikimediacommons', |
196 | | - 'directory' => $wgUploadDirectory, |
197 | 196 | 'apibase' => 'http://commons.wikimedia.org/w/api.php', |
198 | 197 | 'hashLevels' => 2, |
199 | 198 | 'fetchDescription' => true, |
— | — | @@ -218,7 +217,11 @@ |
219 | 218 | * Also updates the repo config to use the backend. |
220 | 219 | */ |
221 | 220 | function wfBackendForLegacyRepoConf( &$info ) { |
| 221 | + global $wgUploadDirectory; |
222 | 222 | // Local vars that used to be FSRepo members... |
| 223 | + if ( !isset( $info['directory'] ) && $info['class'] === 'ForeignAPIRepo' ) { |
| 224 | + $info['directory'] = $wgUploadDirectory; // b/c |
| 225 | + } |
223 | 226 | $directory = $info['directory']; |
224 | 227 | $deletedDir = isset( $info['deletedDir'] ) |
225 | 228 | ? $info['deletedDir'] |
Index: trunk/phase3/includes/filerepo/ForeignAPIRepo.php |
— | — | @@ -37,10 +37,7 @@ |
38 | 38 | protected $mFileExists = array(); |
39 | 39 | |
40 | 40 | function __construct( $info ) { |
41 | | - global $wgLocalFileRepo, $wgUploadDirectory; |
42 | | - if ( !isset( $info['directory'] ) ) { // b/c |
43 | | - $info['directory'] = $wgUploadDirectory; // Local image directory |
44 | | - } |
| 41 | + global $wgLocalFileRepo; |
45 | 42 | parent::__construct( $info ); |
46 | 43 | |
47 | 44 | // http://commons.wikimedia.org/w/api.php |