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
21 global $action, $title, $search, $go, $target, $printable;
22 global $returnto, $diff, $oldid;
24 $action = strtolower( trim( $action ) );
25 if ( "" == $action ) { $action = "view"; }
26 if ( "yes" == $printable ) { $wgOut->setPrintable(); }
28 if ( "" == $title && "delete" != $action ) {
29 $wgTitle = Title::newFromText( wfMsg( "mainpage" ) );
31 $wgTitle = Title::newFromURL( $title );
32 # if( $wgTitle->getInterwiki() != "" or $wgTitle->getDBkey() == "" or strncmp($wgTitle->getDBkey(),"_",1) == 0 ) {
33 if( $wgTitle->getInterwiki() != "" or $wgTitle->getDBkey() == "" ) {
34 $wgOut->errorpage( "badtitle", "badtitletext" );
40 if ( -1 == $wgTitle->getNamespace() ) {
42 } else if ( "" != $search ) {
54 $wgArticle = new Article();
56 if ( "view" == $action ) { $wgArticle->view(); }
57 else if ( "edit" == $action ) { $wgArticle->edit(); }
58 else if ( "submit" == $action ) { $wgArticle->submit(); }
59 else if ( "print" == $action ) { $wgArticle->view(); }
60 else if ( "watch" == $action ) { $wgArticle->watch(); }
61 else if ( "unwatch" == $action ) { $wgArticle->unwatch(); }
62 else if ( "history" == $action ) { $wgArticle->history(); }
63 else if ( "delete" == $action ) { $wgArticle->delete(); }
64 else if ( "revert" == $action ) { $wgArticle->revert(); }
65 else if ( "rollback" == $action ) { $wgArticle->rollback(); }
66 else if ( "protect" == $action ) { $wgArticle->protect(); }
67 else if ( "unprotect" == $action ) { $wgArticle->unprotect(); }
68 else { $wgOut->errorpage( "nosuchaction", "nosuchactiontext" ); }
72 foreach ( $wgDeferredUpdateList as $up ) { $up->doUpdate(); }