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 switch( $wgTitle->getNamespace() ) {
56 include_once( "$IP/ImagePage.php" );
57 $wgArticle = new ImagePage( $wgTitle );
60 $wgArticle = new Article( $wgTitle );
73 $wgArticle->$action();
80 include_once( "$IP/EditPage.php" );
81 $editor = new EditPage( $wgArticle );
85 $wgOut->errorpage( "nosuchaction", "nosuchactiontext" );
90 foreach ( $wgDeferredUpdateList as $up ) { $up->doUpdate(); }