/**
* The MediaWiki class is the helper class for the index.php entry point.
- *
- * @internal documentation reviewed 15 Mar 2010
*/
class MediaWiki {
/**
if ( $action instanceof Action ) {
# Let Squid cache things if we can purge them.
if ( $this->config->get( 'UseSquid' ) &&
- in_array( $request->getFullRequestURL(), $requestTitle->getSquidURLs() )
+ in_array(
+ // Use PROTO_INTERNAL because that's what getSquidURLs() uses
+ wfExpandUrl( $request->getRequestURL(), PROTO_INTERNAL ),
+ $requestTitle->getSquidURLs()
+ )
) {
$output->setSquidMaxage( $this->config->get( 'SquidMaxage' ) );
}
$action = $this->getAction();
$wgTitle = $title;
+ $trxProfiler = Profiler::instance()->getTransactionProfiler();
+
+ // Aside from rollback, master queries should not happen on GET requests.
+ // Periodic or "in passing" updates on GET should use the job queue.
+ if ( !$request->wasPosted()
+ && in_array( $action, array( 'view', 'edit', 'history' ) )
+ ) {
+ $trxProfiler->setExpectation( 'masterConns', 0, __METHOD__ );
+ $trxProfiler->setExpectation( 'writes', 0, __METHOD__ );
+ } else {
+ $trxProfiler->setExpectation( 'maxAffected', 500, __METHOD__ );
+ }
+
// If the user has forceHTTPS set to true, or if the user
// is in a group requiring HTTPS, or if they have the HTTPS
// preference set, redirect them to HTTPS.
* Ends this task peacefully
*/
public function restInPeace() {
+ // Ignore things like master queries/connections on GET requests
+ // as long as they are in deferred updates (which catch errors).
+ Profiler::instance()->getTransactionProfiler()->resetExpectations();
+
// Do any deferred jobs
DeferredUpdates::doUpdates( 'commit' );