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" );
11 session_register( "wsUploadFiles" );
14 include_once( "./LocalSettings.php" );
15 include_once( "$IP/Setup.php" );
17 wfProfileIn( "main-misc-setup" );
18 OutputPage::setEncodings(); # Not really used yet
21 wfDebug( "\nStart request\n" );
22 wfDebug( "$REQUEST_METHOD $REQUEST_URI\n" );
23 $headers = getallheaders();
24 foreach ($headers as $name => $value) {
25 wfDebug( "$name: $value\n" );
30 global $action, $title, $search, $go, $target, $printable;
31 global $returnto, $diff, $oldid;
33 $action = strtolower( trim( $action ) );
34 if ( "" == $action ) { $action = "view"; }
35 if ( "yes" == $printable ) { $wgOut->setPrintable(); }
37 if ( "" == $title && "delete" != $action ) {
38 $wgTitle = Title::newFromText( wfMsg( "mainpage" ) );
40 $wgTitle = Title::newFromURL( $title );
41 # if( $wgTitle->getInterwiki() != "" or $wgTitle->getDBkey() == "" or strncmp($wgTitle->getDBkey(),"_",1) == 0 ) {
42 if( $wgTitle->getInterwiki() != "" or $wgTitle->getDBkey() == "" ) {
43 $wgOut->errorpage( "badtitle", "badtitletext" );
49 if ( -1 == $wgTitle->getNamespace() ) {
51 } else if ( "" != $search ) {
63 switch( $wgTitle->getNamespace() ) {
65 include_once( "$IP/ImagePage.php" );
66 $wgArticle = new ImagePage( $wgTitle );
69 $wgArticle = new Article( $wgTitle );
82 $wgArticle->$action();
89 include_once( "$IP/EditPage.php" );
90 $editor = new EditPage( $wgArticle );
94 $wgOut->errorpage( "nosuchaction", "nosuchactiontext" );
99 foreach ( $wgDeferredUpdateList as $up ) { $up->doUpdate(); }