FU r106752: Fixed directory b/c for ForeignAPIRepo, which was moved to Setup.php
authorAaron Schulz <aaron@users.mediawiki.org>
Tue, 20 Dec 2011 07:53:48 +0000 (07:53 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Tue, 20 Dec 2011 07:53:48 +0000 (07:53 +0000)
includes/Setup.php
includes/filerepo/ForeignAPIRepo.php

index 6182086..adbfe57 100644 (file)
@@ -192,7 +192,6 @@ if ( $wgUseInstantCommons ) {
        $wgForeignFileRepos[] = array(
                'class'                   => 'ForeignAPIRepo',
                'name'                    => 'wikimediacommons',
-               'directory'               => $wgUploadDirectory,
                'apibase'                 => 'http://commons.wikimedia.org/w/api.php',
                'hashLevels'              => 2,
                'fetchDescription'        => true,
@@ -218,7 +217,11 @@ unset( $repo ); // no global pollution; destroy reference
  * 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']
index 91f3c18..e544def 100644 (file)
@@ -37,10 +37,7 @@ class ForeignAPIRepo extends FileRepo {
        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