* @file
*/
+use MediaWiki\Logger\LoggerFactory;
+
/**
* The MediaWiki class is the helper class for the index.php entry point.
*/
throw new PermissionsError( 'read', $permErrors );
}
- $pageView = false; // was an article or special page viewed?
-
// Interwiki redirects
if ( $title->isExternal() ) {
$rdfrom = $request->getVal( 'rdfrom' );
}
// Special pages
} elseif ( NS_SPECIAL == $title->getNamespace() ) {
- $pageView = true;
// Actions that need to be made when we have a special pages
SpecialPageFactory::executePath( $title, $this->context );
} else {
// may be a redirect to another article or URL.
$article = $this->initializeArticle();
if ( is_object( $article ) ) {
- $pageView = true;
$this->performAction( $article, $requestTitle );
} elseif ( is_string( $article ) ) {
$output->redirect( $article );
. " returned neither an object nor a URL" );
}
}
-
- if ( $pageView ) {
- // Promote user to any groups they meet the criteria for
- $user->addAutopromoteOnceGroups( 'onView' );
- }
-
}
/**
// 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;
$wgTitle = $title;
$trxProfiler = Profiler::instance()->getTransactionProfiler();
+ $trxProfiler->setLogger( LoggerFactory::getInstance( 'DBPerformance' ) );
// Aside from rollback, master queries should not happen on GET requests.
// Periodic or "in passing" updates on GET should use the job queue.
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
$n = intval( $jobRunRate );
}
- $runJobsLogger = MWLoggerFactory::getInstance( 'runJobs' );
+ $runJobsLogger = LoggerFactory::getInstance( 'runJobs' );
if ( !$this->config->get( 'RunJobsAsync' ) ) {
// Fall back to running the job here while the user waits
}
$url = wfAppendQuery( wfScript( 'index' ), $query );
- $req = "POST $url HTTP/1.1\r\nHost: {$info['host']}\r\nConnection: Close\r\nContent-Length: 0\r\n\r\n";
+ $req = (
+ "POST $url HTTP/1.1\r\n" .
+ "Host: {$info['host']}\r\n" .
+ "Connection: Close\r\n" .
+ "Content-Length: 0\r\n\r\n"
+ );
$runJobsLogger->info( "Running $n job(s) via '$url'" );
// Send a cron API request to be performed in the background.