X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=index.php;h=979304404352df499b2dd2dec963152f3b5f4b25;hb=d786c5b539b15ed80136f58943ec59e58dc30c59;hp=449616019828f1c250e9e469353932354af09dab;hpb=014093acc4e0c277d0d92fdc54fb620210d6ec8a;p=lhc%2Fweb%2Fwiklou.git diff --git a/index.php b/index.php index 4496160198..9793044043 100644 --- a/index.php +++ b/index.php @@ -26,7 +26,7 @@ OutputPage::setEncodings(); # Not really used yet # Query string fields $action = $wgRequest->getVal( "action", "view" ); -if( isset( $_SERVER['PATH_INFO'] ) ) { +if( isset( $_SERVER['PATH_INFO'] ) && $wgUsePathInfo ) { $title = substr( $_SERVER['PATH_INFO'], 1 ); } else { $title = $wgRequest->getVal( "title" ); @@ -93,6 +93,9 @@ if ( $search = $wgRequest->getText( 'search' ) ) { wfQuery("BEGIN", DB_WRITE); switch( $action ) { case "view": + $wgOut->setSquidMaxage( $wgSquidMaxage ); + $wgArticle->$action(); + break; case "watch": case "unwatch": case "delete": @@ -105,6 +108,22 @@ if ( $search = $wgRequest->getText( 'search' ) ) { case "print": $wgArticle->view(); break; + case "dublincore": + if( !$wgEnableDublinCoreRdf ) { + wfHttpError( 403, "Forbidden", wfMsg( "nodublincore" ) ); + } else { + include_once( "Metadata.php" ); + wfDublinCoreRdf( $wgArticle ); + } + break; + case "creativecommons": + if( !$wgEnableCreativeCommonsRdf ) { + wfHttpError( 403, "Forbidden", wfMsg("nocreativecommons") ); + } else { + include_once( "Metadata.php" ); + wfCreativeCommonsRdf( $wgArticle ); + } + break; case "edit": case "submit": if( !$wgCommandLineMode && !$wgRequest->checkSessionCookie() ) { @@ -115,10 +134,18 @@ if ( $search = $wgRequest->getText( 'search' ) ) { $editor->$action(); break; case "history": + if ($_SERVER["REQUEST_URI"] == $wgTitle->getInternalURL('action=history')) { + $wgOut->setSquidMaxage( $wgSquidMaxage ); + } include_once( "PageHistory.php" ); $history = new PageHistory( $wgArticle ); $history->history(); break; + case "purge": + wfPurgeSquidServers(array($wgTitle->getInternalURL())); + $wgOut->setSquidMaxage( $wgSquidMaxage ); + $wgArticle->view(); + break; default: $wgOut->errorpage( "nosuchaction", "nosuchactiontext" ); } @@ -126,6 +153,7 @@ if ( $search = $wgRequest->getText( 'search' ) ) { } $wgOut->output(); + foreach ( $wgDeferredUpdateList as $up ) { $up->doUpdate(); } logProfilingData(); wfDebug( "Request ended normally\n" );