2 # Main wiki script; see design.doc
4 $wgRequestTime = microtime();
6 session_cache_limiter( "private, must-revalidate" );
8 session_register( "wsUserID" );
9 session_register( "wsUserName" );
10 session_register( "wsUserPassword" );
13 include_once( "./LocalSettings.php" );
14 include_once( "$IP/Setup.php" );
16 wfProfileIn( "main-misc-setup" );
17 OutputPage::setEncodings(); # Not really used yet
20 wfDebug( "\nStart request\n" );
21 wfDebug( "$REQUEST_METHOD $REQUEST_URI\n" );
22 $headers = getallheaders();
23 foreach ($headers as $name => $value) {
24 wfDebug( "$name: $value\n" );
29 global $action, $title, $search, $go, $target, $printable;
30 global $returnto, $diff, $oldid;
32 $action = strtolower( trim( $action ) );
33 if ( "" == $action ) { $action = "view"; }
34 if ( "yes" == $printable ) { $wgOut->setPrintable(); }
36 if ( "" == $title && "delete" != $action ) {
37 $wgTitle = Title::newFromText( wfMsg( "mainpage" ) );
39 $wgTitle = Title::newFromURL( $title );
40 # if( $wgTitle->getInterwiki() != "" or $wgTitle->getDBkey() == "" or strncmp($wgTitle->getDBkey(),"_",1) == 0 ) {
41 if( $wgTitle->getInterwiki() != "" or $wgTitle->getDBkey() == "" ) {
42 $wgOut->errorpage( "badtitle", "badtitletext" );
48 if ( -1 == $wgTitle->getNamespace() ) {
50 } else if ( "" != $search ) {
62 switch( $wgTitle->getNamespace() ) {
64 include_once( "$IP/ImagePage.php" );
65 $wgArticle = new ImagePage( $wgTitle );
68 $wgArticle = new Article( $wgTitle );
81 $wgArticle->$action();
88 include_once( "$IP/EditPage.php" );
89 $editor = new EditPage( $wgArticle );
93 $wgOut->errorpage( "nosuchaction", "nosuchactiontext" );
98 foreach ( $wgDeferredUpdateList as $up ) { $up->doUpdate(); }