From: Aaron Schulz Date: Tue, 20 Dec 2011 07:53:48 +0000 (+0000) Subject: FU r106752: Fixed directory b/c for ForeignAPIRepo, which was moved to Setup.php X-Git-Tag: 1.31.0-rc.0~25881 X-Git-Url: http://git.cyclocoop.org//%27http:/code.google.com/p/ie7-js//%27?a=commitdiff_plain;h=8bf318d90f94b860033266ad479d6b2f7f42fedb;p=lhc%2Fweb%2Fwiklou.git FU r106752: Fixed directory b/c for ForeignAPIRepo, which was moved to Setup.php --- diff --git a/includes/Setup.php b/includes/Setup.php index 6182086171..adbfe57a7c 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -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'] diff --git a/includes/filerepo/ForeignAPIRepo.php b/includes/filerepo/ForeignAPIRepo.php index 91f3c18dcf..e544defb62 100644 --- a/includes/filerepo/ForeignAPIRepo.php +++ b/includes/filerepo/ForeignAPIRepo.php @@ -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