$wgForeignFileRepos[] = array(
'class' => 'ForeignAPIRepo',
'name' => 'wikimediacommons',
- 'directory' => $wgUploadDirectory,
'apibase' => 'http://commons.wikimedia.org/w/api.php',
'hashLevels' => 2,
'fetchDescription' => true,
* Also updates the repo config to use the backend.
*/
function wfBackendForLegacyRepoConf( &$info ) {
+ global $wgUploadDirectory;
// Local vars that used to be FSRepo members...
+ if ( !isset( $info['directory'] ) && $info['class'] === 'ForeignAPIRepo' ) {
+ $info['directory'] = $wgUploadDirectory; // b/c
+ }
$directory = $info['directory'];
$deletedDir = isset( $info['deletedDir'] )
? $info['deletedDir']
protected $mFileExists = array();
function __construct( $info ) {
- global $wgLocalFileRepo, $wgUploadDirectory;
- if ( !isset( $info['directory'] ) ) { // b/c
- $info['directory'] = $wgUploadDirectory; // Local image directory
- }
+ global $wgLocalFileRepo;
parent::__construct( $info );
// http://commons.wikimedia.org/w/api.php