X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=index.php;h=f18fa8a6ed3e16a21b43391b2700fe1659ba1e51;hb=4e717c01589378893c98e333884315c166c217b3;hp=eb8531f32db6aa81d7d33ecd0c0c54bbfbfbc6f2;hpb=b71834bdecb980febf07dcbfd5522caf37e76aa2;p=lhc%2Fweb%2Fwiklou.git
diff --git a/index.php b/index.php
index eb8531f32d..f18fa8a6ed 100644
--- a/index.php
+++ b/index.php
@@ -3,58 +3,128 @@
* Main wiki script; see docs/design.txt
* @package MediaWiki
*/
+$wgRequestTime = microtime(true);
+
+# getrusage() does not exist on the Microsoft Windows platforms, catching this
+if ( function_exists ( 'getrusage' ) ) {
+ $wgRUstart = getrusage();
+} else {
+ $wgRUstart = array();
+}
-# In the beginning...
-require_once( "./includes/Wiki.php" );
-$wgRequestTime = microtime();
-$wgRUstart = MediaWiki::getRUsage();
unset( $IP );
-MediaWiki::ckeckGlobalsVulnerability();
+@ini_set( 'allow_url_fopen', 0 ); # For security...
+
+if ( isset( $_REQUEST['GLOBALS'] ) ) {
+ die( '$GLOBALS overwrite vulnerability');
+}
# Valid web server entry point, enable includes.
-# Please don't move this line to includes/Defines.php. This line essentially defines
-# a valid entry point. If you put it in includes/Defines.php, then any script that includes
-# it becomes an entry point, thereby defeating its purpose.
+# Please don't move this line to includes/Defines.php. This line essentially
+# defines a valid entry point. If you put it in includes/Defines.php, then
+# any script that includes it becomes an entry point, thereby defeating
+# its purpose.
define( 'MEDIAWIKI', true );
+
+# Load up some global defines.
require_once( './includes/Defines.php' );
+# LocalSettings.php is the per site customization file. If it does not exit
+# the wiki installer need to be launched or the generated file moved from
+# ./config/ to ./
+if( !file_exists( 'LocalSettings.php' ) ) {
+ $IP = '.';
+ require_once( 'includes/DefaultSettings.php' ); # used for printing the version
+?>
+
+
+
+ MediaWiki
+
+
+
+
+
-# Initialize MediaWiki base class
-$mediaWiki = new MediaWiki();
-$mediaWiki->checkSetup();
+ MediaWiki
+
+ config/LocalSettings.php to the parent directory.' );
+ } else {
+ echo( 'Please
setup the wiki first.' );
+ }
+ ?>
+
+
+
+
+setVal( "Request", $wgRequest );
+wfProfileIn( 'main-misc-setup' );
+OutputPage::setEncodings(); # Not really used yet
# Query string fields
-$mediaWiki->initializeActionTitle();
-$action = $mediaWiki->getVal( 'action' ); # Global might be needed somewhere, sadly...
+$action = $wgRequest->getVal( 'action', 'view' );
+$title = $wgRequest->getVal( 'title' );
+
+#
+# Send Ajax requests to the Ajax dispatcher.
+#
+if ( $wgUseAjax && $action == 'ajax' ) {
+ require_once( 'AjaxDispatcher.php' );
-# Run initial queries
-$wgTitle = $mediaWiki->checkInitialQueries( $wgOut, $wgContLang );
+ $dispatcher = new AjaxDispatcher();
+ $dispatcher->performAction();
-# Is this necessary? Who knows...
+ exit;
+}
+
+$wgTitle = $mediaWiki->checkInitialQueries( $title,$action,$wgOut, $wgRequest, $wgContLang );
if ($wgTitle == NULL) {
unset( $wgTitle );
}
+wfProfileOut( 'main-misc-setup' );
+
# Setting global variables in mediaWiki
-$mediaWiki->setVal( "Server", $wgServer );
-$mediaWiki->setVal( "DisableInternalSearch", $wgDisableInternalSearch );
-$mediaWiki->setVal( "SquidMaxage", $wgSquidMaxage );
-$mediaWiki->setVal( "EnableDublinCoreRdf", $wgEnableDublinCoreRdf );
-$mediaWiki->setVal( "EnableCreativeCommonsRdf", $wgEnableCreativeCommonsRdf );
-$mediaWiki->setVal( "CommandLineMode", $wgCommandLineMode );
-$mediaWiki->setVal( "UseExternalEditor", $wgUseExternalEditor );
-$mediaWiki->setVal( "DisabledActions", $wgDisabledActions );
-
-$wgArticle = $mediaWiki->initialize ( $wgTitle, $wgOut, $wgUser );
+$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 );
+
+$wgArticle = $mediaWiki->initialize ( $wgTitle, $wgOut, $wgUser, $wgRequest );
$mediaWiki->finalCleanup ( $wgDeferredUpdateList, $wgLoadBalancer, $wgOut );
+
+# Not sure when $wgPostCommitUpdateList gets set, so I keep this separate from finalCleanup
$mediaWiki->doUpdates( $wgPostCommitUpdateList );
+
$mediaWiki->restInPeace( $wgLoadBalancer );
?>