MediaWiki REL1_34
|
The MediaWiki class is the helper class for the index.php entry point. More...
Public Member Functions | |
__construct (IContextSource $context=null) | |
doPostOutputShutdown ( $mode='normal') | |
This function does work that can be done after the user gets the HTTP response so they don't block on it. | |
doPreOutputCommit (callable $postCommitWork=null) | |
getAction () | |
Returns the name of the action that will be executed. | |
getTitle () | |
Get the Title object that we'll be acting on, as specified in the WebRequest. | |
restInPeace ( $mode='fast', $blocksHttpClient=true) | |
Ends this task peacefully. | |
run () | |
Run the current MediaWiki instance; index.php just calls this. | |
triggerJobs () | |
Potentially open a socket and sent an HTTP request back to the server to run a specified number of jobs. | |
Static Public Member Functions | |
static | emitBufferedStatsdData (IBufferingStatsdDataFactory $stats, Config $config) |
Send out any buffered statsd data according to sampling rules. | |
static | preOutputCommit (IContextSource $context, callable $postCommitWork=null) |
This function commits all DB and session changes as needed before the client can receive a response (in case DB commit fails) and thus also before the response can trigger a subsequent related request by the client. | |
Private Member Functions | |
initializeArticle () | |
Initialize the main Article object for "standard" actions (view, etc) Create an Article object for the page, following redirects if needed. | |
main () | |
maybeDoHttpsRedirect () | |
If the stars are suitably aligned, do an HTTP->HTTPS redirect. | |
parseTitle () | |
Parse the request to get the Title object. | |
performAction (Page $page, Title $requestTitle) | |
Perform one of the "standard" actions. | |
performRequest () | |
Performs the request. | |
setDBProfilingAgent () | |
shouldDoHttpRedirect () | |
Check if an HTTP->HTTPS redirect should be done. | |
triggerAsyncJobs ( $n, LoggerInterface $runJobsLogger) | |
triggerSyncJobs ( $n, LoggerInterface $runJobsLogger) | |
tryNormaliseRedirect (Title $title) | |
Handle redirects for uncanonical title requests. | |
Static Private Member Functions | |
static | getChronProtStrategy (ILBFactory $lbFactory, OutputPage $output) |
static | getUrlDomainDistance ( $url) |
Private Attributes | |
string | $action |
Cache what action this request is. | |
Config | $config |
IContextSource | $context |
The MediaWiki class is the helper class for the index.php entry point.
Definition at line 34 of file MediaWiki.php.
MediaWiki::__construct | ( | IContextSource | $context = null | ) |
IContextSource | null | $context |
Definition at line 53 of file MediaWiki.php.
References $context.
MediaWiki::doPostOutputShutdown | ( | $mode = 'normal' | ) |
This function does work that can be done after the user gets the HTTP response so they don't block on it.
This manages deferred updates, job insertion, final commit, and the logging of profiling data
string | $mode | Use 'fast' to always skip job running |
Definition at line 745 of file MediaWiki.php.
References restInPeace().
Referenced by run().
MediaWiki::doPreOutputCommit | ( | callable | $postCommitWork = null | ) |
callable | null | $postCommitWork | [default: null] |
Definition at line 581 of file MediaWiki.php.
|
static |
Send out any buffered statsd data according to sampling rules.
IBufferingStatsdDataFactory | $stats | |
Config | $config |
ConfigException |
Definition at line 1009 of file MediaWiki.php.
References IBufferingStatsdDataFactory\clearData(), Config\get(), IBufferingStatsdDataFactory\getData(), and IBufferingStatsdDataFactory\hasData().
MediaWiki::getAction | ( | ) |
Returns the name of the action that will be executed.
Definition at line 153 of file MediaWiki.php.
Referenced by main(), and performAction().
|
staticprivate |
ILBFactory | $lbFactory | |
OutputPage | $output |
Definition at line 692 of file MediaWiki.php.
References OutputPage\getRedirect(), Wikimedia\Rdbms\ILBFactory\hasOrMadeRecentMasterChanges(), and OutputPage\isDisabled().
MediaWiki::getTitle | ( | ) |
Get the Title object that we'll be acting on, as specified in the WebRequest.
Definition at line 137 of file MediaWiki.php.
References parseTitle().
|
staticprivate |
string | $url |
Definition at line 723 of file MediaWiki.php.
|
private |
Initialize the main Article object for "standard" actions (view, etc) Create an Article object for the page, following redirects if needed.
Definition at line 395 of file MediaWiki.php.
References $file, $title, Article\newFromWikiPage(), and wfWarn().
Referenced by performRequest().
|
private |
Definition at line 793 of file MediaWiki.php.
References $cache, $title, $wgTitle, doPreOutputCommit(), getAction(), getTitle(), maybeDoHttpsRedirect(), NS_SPECIAL, performRequest(), print, and HTMLFileCache\useFileCache().
Referenced by run().
|
private |
If the stars are suitably aligned, do an HTTP->HTTPS redirect.
Note: Do this after $wgTitle is setup, otherwise the hooks run from isLoggedIn() will do all sorts of weird stuff.
Definition at line 926 of file MediaWiki.php.
References $title, NS_MAIN, shouldDoHttpRedirect(), and wfDebugLog().
Referenced by main().
|
private |
Parse the request to get the Title object.
MalformedTitleException | If a title has been provided by the user, but is invalid. |
Definition at line 68 of file MediaWiki.php.
References $title, MediaWiki\MediaWikiServices\getInstance(), NS_FILE, and NS_MEDIA.
Referenced by getTitle(), and performRequest().
Perform one of the "standard" actions.
Definition at line 476 of file MediaWiki.php.
References $title, getAction(), Title\getCdnUrls(), PROTO_INTERNAL, and wfExpandUrl().
Referenced by performRequest().
|
private |
Performs the request.
MWException|PermissionsError|BadTitleError|HttpError |
Definition at line 173 of file MediaWiki.php.
References $title, $wgTitle, MediaWiki\MediaWikiServices\getInstance(), initializeArticle(), parseTitle(), performAction(), and tryNormaliseRedirect().
Referenced by main().
|
static |
This function commits all DB and session changes as needed before the client can receive a response (in case DB commit fails) and thus also before the response can trigger a subsequent related request by the client.
If there is a significant amount of content to flush, it can be done in $postCommitWork
IContextSource | $context | |
callable | null | $postCommitWork | [default: null] |
Definition at line 596 of file MediaWiki.php.
References $context, Config\get(), MediaWiki\MediaWikiServices\getInstance(), MessageCache\singleton(), wfDebug(), and wfDebugLog().
MediaWiki::restInPeace | ( | $mode = 'fast', | |
$blocksHttpClient = true ) |
Ends this task peacefully.
string | $mode | Use 'fast' to always skip job running |
bool | $blocksHttpClient | Whether this blocks an HTTP response to a client |
Definition at line 968 of file MediaWiki.php.
References MediaWiki\MediaWikiServices\getInstance(), triggerJobs(), wfDebug(), and wfLogProfilingData().
Referenced by doPostOutputShutdown().
MediaWiki::run | ( | ) |
Run the current MediaWiki instance; index.php just calls this.
Definition at line 523 of file MediaWiki.php.
References $cache, $context, doPostOutputShutdown(), doPreOutputCommit(), MWExceptionRenderer\getHTML(), main(), HTMLFileCache\MODE_OUTAGE, print, ErrorPageError\report(), setDBProfilingAgent(), ErrorPageError\STAGE_OUTPUT, and HTMLFileCache\useFileCache().
|
private |
Definition at line 567 of file MediaWiki.php.
References MediaWiki\MediaWikiServices\getInstance().
Referenced by run().
|
private |
Check if an HTTP->HTTPS redirect should be done.
It may still be aborted by a hook, so this is not the final word.
Definition at line 882 of file MediaWiki.php.
References PROTO_HTTPS, and wfExpandUrl().
Referenced by maybeDoHttpsRedirect().
|
private |
int | $n | Number of jobs to try to run |
LoggerInterface | $runJobsLogger |
Definition at line 1092 of file MediaWiki.php.
References MediaWiki\MediaWikiServices\getInstance(), SpecialRunJobs\getQuerySignature(), and wfParseUrl().
Referenced by triggerJobs().
MediaWiki::triggerJobs | ( | ) |
Potentially open a socket and sent an HTTP request back to the server to run a specified number of jobs.
This registers a callback to cleanup the socket once it's done.
Definition at line 1034 of file MediaWiki.php.
References getTitle(), triggerAsyncJobs(), triggerSyncJobs(), and wfReadOnly().
Referenced by restInPeace().
|
private |
int | $n | Number of jobs to try to run |
LoggerInterface | $runJobsLogger |
Definition at line 1076 of file MediaWiki.php.
Referenced by triggerJobs().
|
private |
Handle redirects for uncanonical title requests.
Handles:
Behaviour:
Title | $title |
HttpError |
Definition at line 335 of file MediaWiki.php.
References $title, MediaWiki\MediaWikiServices\getInstance(), PROTO_CURRENT, and wfExpandUrl().
Referenced by performRequest().
|
private |
Cache what action this request is.
Definition at line 48 of file MediaWiki.php.
|
private |
Definition at line 43 of file MediaWiki.php.
|
private |
Definition at line 38 of file MediaWiki.php.