MediaWiki fundraising/REL1_35
|
The MediaWiki class is the helper class for the index.php entry point. More...
Public Member Functions | |
__construct (IContextSource $context=null) | |
doPostOutputShutdown () | |
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 () | |
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 () | |
Determine and send the response headers and body for this web request. | |
maybeDoHttpsRedirect () | |
If the stars are suitably aligned, do an HTTP->HTTPS redirect. | |
outputResponsePayload ( $content) | |
Print the actual output to the buffer (or webserver if there is none) | |
parseTitle () | |
Parse the request to get the Title object. | |
performAction (Article $article, Title $requestTitle) | |
Perform one of the "standard" actions. | |
performRequest () | |
Performs the request. | |
schedulePostSendJobs () | |
If enabled, after everything specific to this request is done, occasionally run jobs. | |
setDBProfilingAgent () | |
Add a comment to future SQL queries for easy SHOW PROCESSLIST interpretation. | |
shouldDoHttpRedirect () | |
Check if an HTTP->HTTPS redirect should be done. | |
triggerAsyncJobs ( $n, LoggerInterface $runJobsLogger) | |
triggerSyncJobs ( $n) | |
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 |
int | $postSendStrategy |
Class DEFER_* constant; how non-blocking post-response tasks should run. | |
The MediaWiki class is the helper class for the index.php entry point.
Definition at line 36 of file MediaWiki.php.
MediaWiki::__construct | ( | IContextSource | $context = null | ) |
IContextSource | null | $context |
Definition at line 57 of file MediaWiki.php.
MediaWiki::doPostOutputShutdown | ( | ) |
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
Definition at line 833 of file MediaWiki.php.
MediaWiki::doPreOutputCommit | ( | callable | $postCommitWork = null | ) |
callable | null | $postCommitWork | [default: null] |
Definition at line 651 of file MediaWiki.php.
|
static |
Send out any buffered statsd data according to sampling rules.
IBufferingStatsdDataFactory | $stats | |
Config | $config |
ConfigException |
Definition at line 1109 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 164 of file MediaWiki.php.
|
staticprivate |
ILBFactory | $lbFactory | |
OutputPage | $output |
Definition at line 781 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 148 of file MediaWiki.php.
References SpecialPage\getTitleFor(), and parseTitle().
|
staticprivate |
string | $url |
Definition at line 812 of file MediaWiki.php.
|
private |
|
private |
Determine and send the response headers and body for this web request.
Definition at line 883 of file MediaWiki.php.
References $cache, $title, $wgTitle, getTitle(), NS_SPECIAL, and HTMLFileCache\useFileCache().
|
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 1020 of file MediaWiki.php.
References $title, NS_MAIN, and wfDebugLog().
|
private |
Print the actual output to the buffer (or webserver if there is none)
string | $content |
Definition at line 1062 of file MediaWiki.php.
|
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 73 of file MediaWiki.php.
References $title, MediaWiki\MediaWikiServices\getInstance(), SpecialPage\getTitleFor(), NS_FILE, and NS_MEDIA.
Referenced by getTitle().
Perform one of the "standard" actions.
Definition at line 491 of file MediaWiki.php.
References $title, Title\getCdnUrls(), PROTO_INTERNAL, and wfExpandUrl().
|
private |
Performs the request.
MWException|PermissionsError|BadTitleError|HttpError |
Definition at line 184 of file MediaWiki.php.
References $title, $wgTitle, and SpecialPage\getTitleFor().
|
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 666 of file MediaWiki.php.
References IContextSource\getConfig(), IContextSource\getOutput(), IContextSource\getRequest(), IContextSource\getUser(), wfDebug(), and wfDebugLog().
MediaWiki::restInPeace | ( | ) |
Ends this task peacefully.
Definition at line 1070 of file MediaWiki.php.
References wfDebug(), and wfLogProfilingData().
MediaWiki::run | ( | ) |
Run the current MediaWiki instance; index.php just calls this.
Definition at line 543 of file MediaWiki.php.
References $cache, MWExceptionRenderer\getHTML(), HTMLFileCache\MODE_OUTAGE, print, ErrorPageError\report(), ErrorPageError\STAGE_OUTPUT, and HTMLFileCache\useFileCache().
|
private |
If enabled, after everything specific to this request is done, occasionally run jobs.
Definition at line 603 of file MediaWiki.php.
References getTitle(), and wfReadOnly().
|
private |
Add a comment to future SQL queries for easy SHOW PROCESSLIST interpretation.
Definition at line 592 of file MediaWiki.php.
|
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 976 of file MediaWiki.php.
References PROTO_HTTPS, and wfExpandUrl().
|
private |
int | $n | Number of jobs to try to run |
LoggerInterface | $runJobsLogger |
Definition at line 1192 of file MediaWiki.php.
References SpecialRunJobs\getQuerySignature(), and wfParseUrl().
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 1135 of file MediaWiki.php.
References getTitle(), and wfReadOnly().
|
private |
int | $n | Number of jobs to try to run |
Definition at line 1176 of file MediaWiki.php.
|
private |
Handle redirects for uncanonical title requests.
Handles:
Behaviour:
Title | $title |
HttpError |
Definition at line 347 of file MediaWiki.php.
References $title, SpecialPage\getTitleFor(), PROTO_CURRENT, and wfExpandUrl().
|
private |
Cache what action this request is.
Definition at line 45 of file MediaWiki.php.
|
private |
Definition at line 42 of file MediaWiki.php.
|
private |
Definition at line 40 of file MediaWiki.php.
|
private |
Class DEFER_* constant; how non-blocking post-response tasks should run.
Definition at line 47 of file MediaWiki.php.