2004-02-28 03:04:02 +00:00
|
|
|
<?php
|
2006-01-13 17:33:37 +00:00
|
|
|
|
2007-03-12 15:57:17 +00:00
|
|
|
/**
|
|
|
|
|
* This is the main web entry point for MediaWiki.
|
|
|
|
|
*
|
|
|
|
|
* If you are reading this in your web browser, your server is probably
|
|
|
|
|
* not configured correctly to run PHP applications!
|
|
|
|
|
*
|
|
|
|
|
* See the README, INSTALL, and UPGRADE files for basic setup instructions
|
|
|
|
|
* and pointers to the online documentation.
|
|
|
|
|
*
|
|
|
|
|
* http://www.mediawiki.org/
|
|
|
|
|
*
|
|
|
|
|
* ----------
|
|
|
|
|
*
|
2008-02-04 04:50:55 +00:00
|
|
|
* Copyright (C) 2001-2008 Magnus Manske, Brion Vibber, Lee Daniel Crocker,
|
2007-03-12 15:57:17 +00:00
|
|
|
* Tim Starling, Erik Möller, Gabriel Wicke, Ævar Arnfjörð Bjarmason,
|
|
|
|
|
* Niklas Laxström, Domas Mituzas, Rob Church and others.
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2006-07-14 05:35:31 +00:00
|
|
|
# Initialise common code
|
2008-02-09 16:24:09 +00:00
|
|
|
$preIP = dirname( __FILE__ );
|
|
|
|
|
require_once( "$preIP/includes/WebStart.php" );
|
2006-01-13 12:10:59 +00:00
|
|
|
|
2006-01-13 17:33:37 +00:00
|
|
|
# Initialize MediaWiki base class
|
2008-02-09 16:24:09 +00:00
|
|
|
require_once( "$preIP/includes/Wiki.php" );
|
2006-01-13 17:33:37 +00:00
|
|
|
$mediaWiki = new MediaWiki();
|
2006-01-13 12:52:04 +00:00
|
|
|
|
2006-01-13 17:33:37 +00:00
|
|
|
wfProfileIn( 'main-misc-setup' );
|
|
|
|
|
OutputPage::setEncodings(); # Not really used yet
|
2005-12-29 20:46:25 +00:00
|
|
|
|
2007-04-22 21:17:10 +00:00
|
|
|
$maxLag = $wgRequest->getVal( 'maxlag' );
|
|
|
|
|
if ( !is_null( $maxLag ) ) {
|
|
|
|
|
if ( !$mediaWiki->checkMaxLag( $maxLag ) ) {
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2006-01-13 17:33:37 +00:00
|
|
|
# Query string fields
|
|
|
|
|
$action = $wgRequest->getVal( 'action', 'view' );
|
|
|
|
|
$title = $wgRequest->getVal( 'title' );
|
2006-01-13 12:10:59 +00:00
|
|
|
|
2008-02-19 21:19:55 +00:00
|
|
|
$wgTitle = $mediaWiki->checkInitialQueries( $title, $action, $wgOut, $wgRequest, $wgContLang );
|
2007-01-09 21:00:14 +00:00
|
|
|
if ($wgTitle == NULL) {
|
|
|
|
|
unset( $wgTitle );
|
|
|
|
|
}
|
|
|
|
|
|
2006-03-27 18:53:15 +00:00
|
|
|
#
|
|
|
|
|
# Send Ajax requests to the Ajax dispatcher.
|
|
|
|
|
#
|
2007-01-21 03:14:06 +00:00
|
|
|
if ( $wgUseAjax && $action == 'ajax' ) {
|
|
|
|
|
require_once( $IP . '/includes/AjaxDispatcher.php' );
|
|
|
|
|
|
|
|
|
|
$dispatcher = new AjaxDispatcher();
|
|
|
|
|
$dispatcher->performAction();
|
|
|
|
|
$mediaWiki->restInPeace( $wgLoadBalancer );
|
|
|
|
|
exit;
|
2006-03-27 18:53:15 +00:00
|
|
|
}
|
|
|
|
|
|
2005-12-29 20:46:25 +00:00
|
|
|
|
2006-01-13 17:33:37 +00:00
|
|
|
wfProfileOut( 'main-misc-setup' );
|
|
|
|
|
|
2006-01-11 15:46:01 +00:00
|
|
|
# Setting global variables in mediaWiki
|
2006-01-15 23:07:19 +00:00
|
|
|
$mediaWiki->setVal( 'Server', $wgServer );
|
|
|
|
|
$mediaWiki->setVal( 'DisableInternalSearch', $wgDisableInternalSearch );
|
|
|
|
|
$mediaWiki->setVal( 'action', $action );
|
|
|
|
|
$mediaWiki->setVal( 'SquidMaxage', $wgSquidMaxage );
|
|
|
|
|
$mediaWiki->setVal( 'EnableDublinCoreRdf', $wgEnableDublinCoreRdf );
|
|
|
|
|
$mediaWiki->setVal( 'EnableCreativeCommonsRdf', $wgEnableCreativeCommonsRdf );
|
|
|
|
|
$mediaWiki->setVal( 'CommandLineMode', $wgCommandLineMode );
|
|
|
|
|
$mediaWiki->setVal( 'UseExternalEditor', $wgUseExternalEditor );
|
|
|
|
|
$mediaWiki->setVal( 'DisabledActions', $wgDisabledActions );
|
2006-01-11 13:28:23 +00:00
|
|
|
|
2006-01-13 17:33:37 +00:00
|
|
|
$wgArticle = $mediaWiki->initialize ( $wgTitle, $wgOut, $wgUser, $wgRequest );
|
2006-01-11 19:33:15 +00:00
|
|
|
$mediaWiki->finalCleanup ( $wgDeferredUpdateList, $wgLoadBalancer, $wgOut );
|
2006-01-13 17:33:37 +00:00
|
|
|
|
|
|
|
|
# Not sure when $wgPostCommitUpdateList gets set, so I keep this separate from finalCleanup
|
2006-01-11 15:46:01 +00:00
|
|
|
$mediaWiki->doUpdates( $wgPostCommitUpdateList );
|
2006-01-13 17:33:37 +00:00
|
|
|
|
2006-01-11 15:46:01 +00:00
|
|
|
$mediaWiki->restInPeace( $wgLoadBalancer );
|
2007-06-29 01:19:14 +00:00
|
|
|
|