Added $wgTrxProfilerLimits and slow query limits
[lhc/web/wiklou.git] / includes / MediaWiki.php
index 68d03c8..d0e81cf 100644 (file)
@@ -457,14 +457,16 @@ class MediaWiki {
        }
 
        private function main() {
-               global $wgTitle;
+               global $wgTitle, $wgTrxProfilerLimits;
 
                $request = $this->context->getRequest();
 
                // Send Ajax requests to the Ajax dispatcher.
                if ( $this->config->get( 'UseAjax' ) && $request->getVal( 'action' ) === 'ajax' ) {
                        // Set a dummy title, because $wgTitle == null might break things
-                       $title = Title::makeTitle( NS_MAIN, 'AJAX' );
+                       $title = Title::makeTitle( NS_SPECIAL, 'Badtitle/performing an AJAX call in '
+                               . __METHOD__
+                       );
                        $this->context->setTitle( $title );
                        $wgTitle = $title;
 
@@ -487,10 +489,9 @@ class MediaWiki {
                if ( !$request->wasPosted()
                        && in_array( $action, array( 'view', 'edit', 'history' ) )
                ) {
-                       $trxProfiler->setExpectation( 'masterConns', 0, __METHOD__ );
-                       $trxProfiler->setExpectation( 'writes', 0, __METHOD__ );
+                       $trxProfiler->setExpectations( $wgTrxProfilerLimits['GET'], __METHOD__ );
                } else {
-                       $trxProfiler->setExpectation( 'maxAffected', 500, __METHOD__ );
+                       $trxProfiler->setExpectations( $wgTrxProfilerLimits['POST'], __METHOD__ );
                }
 
                // If the user has forceHTTPS set to true, or if the user
@@ -529,7 +530,7 @@ class MediaWiki {
                                        wfDebugLog( 'RedirectedPosts', "Redirected from HTTP to HTTPS: $oldUrl" );
                                }
                                // Setup dummy Title, otherwise OutputPage::redirect will fail
-                               $title = Title::newFromText( NS_MAIN, 'REDIR' );
+                               $title = Title::newFromText( 'REDIR', NS_MAIN );
                                $this->context->setTitle( $title );
                                $output = $this->context->getOutput();
                                // Since we only do this redir to change proto, always send a vary header