Chad has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/332666 )
Change subject: Turn getMediaWiki() into back-compat to MWMultiVersion::getMediaWiki() ...................................................................... Turn getMediaWiki() into back-compat to MWMultiVersion::getMediaWiki() Change-Id: If3602ac4bcd1edaf03a2dc753a48459612b64dc8 --- M multiversion/MWVersion.php 1 file changed, 3 insertions(+), 49 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/66/332666/1 diff --git a/multiversion/MWVersion.php b/multiversion/MWVersion.php index 7466077..a151293 100644 --- a/multiversion/MWVersion.php +++ b/multiversion/MWVersion.php @@ -1,54 +1,8 @@ <?php /** - * Get the location of the correct version of a MediaWiki web - * entry-point file given environmental variables such as the server name. - * This function should only be called on web views. - * - * If the wiki doesn't exist, then wmf-config/missing.php will - * be included (and thus displayed) and PHP will exit. - * - * If it does, then this function also has some other effects: - * (a) Sets the $IP global variable (path to MediaWiki) - * (b) Sets the MW_INSTALL_PATH environmental variable - * (c) Changes PHP's current directory to the directory of this file. - * - * @param $file string File path (relative to MediaWiki dir) - * @param $wiki string Force the Wiki ID rather than detecting it - * @return string Absolute file path with proper MW location + * @see MWMultiVersion::getMediaWiki() */ function getMediaWiki( $file, $wiki = null ) { - global $IP; - require_once( __DIR__ . '/MWMultiVersion.php' ); - - if ( $wiki === null ) { - $scriptName = @$_SERVER['SCRIPT_NAME']; - $serverName = @$_SERVER['SERVER_NAME']; - # Upload URL hit (to upload.wikimedia.org rather than wiki of origin)... - if ( $scriptName === '/w/thumb.php' && $serverName === 'upload.wikimedia.org' ) { - $multiVersion = MWMultiVersion::initializeForUploadWiki( $_SERVER['PATH_INFO'] ); - # Regular URL hit (wiki of origin)... - } else { - $multiVersion = MWMultiVersion::initializeForWiki( $serverName ); - } - } else { - $multiVersion = MWMultiVersion::initializeFromDBName( $wiki ); - } - - # Wiki doesn't exist yet? - if ( $multiVersion->isMissing() ) { - header( "Cache-control: no-cache" ); // same hack as CommonSettings.php - include( MEDIAWIKI_DEPLOYMENT_DIR . '/wmf-config/missing.php' ); - exit; - } - - # Get the MediaWiki version running on this wiki... - $version = $multiVersion->getVersion(); - - # Get the correct MediaWiki path based on this version... - $IP = MEDIAWIKI_DEPLOYMENT_DIR . "/$version"; - - chdir( $IP ); - putenv( "MW_INSTALL_PATH=$IP" ); - - return "$IP/$file"; + require_once __DIR__ . '/MWMultiVersion.php'; + return MWMultiVersion::getMediaWiki( $file, $wiki ); } -- To view, visit https://gerrit.wikimedia.org/r/332666 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If3602ac4bcd1edaf03a2dc753a48459612b64dc8 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Chad <ch...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits