Added $wgTrxProfilerLimits and slow query limits
[lhc/web/wiklou.git] / includes / MediaWiki.php
index 86531bb..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