MediaWiki
1.34.0
|
The MediaWiki class is the helper class for the index.php entry point. More...
Classes | |
class | MediaWikiServices |
MediaWikiServices is the service locator for the application scope of MediaWiki. More... | |
class | OutputHandler |
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. More... | |
doPreOutputCommit (callable $postCommitWork=null) | |
getAction () | |
Returns the name of the action that will be executed. More... | |
getTitle () | |
Get the Title object that we'll be acting on, as specified in the WebRequest. More... | |
restInPeace ( $mode='fast', $blocksHttpClient=true) | |
Ends this task peacefully. More... | |
run () | |
Run the current MediaWiki instance; index.php just calls this. More... | |
triggerJobs () | |
Potentially open a socket and sent an HTTP request back to the server to run a specified number of jobs. More... | |
Static Public Member Functions | |
static | emitBufferedStatsdData (IBufferingStatsdDataFactory $stats, Config $config) |
Send out any buffered statsd data according to sampling rules. More... | |
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. More... | |
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. More... | |
main () | |
parseTitle () | |
Parse the request to get the Title object. More... | |
performAction (Page $page, Title $requestTitle) | |
Perform one of the "standard" actions. More... | |
performRequest () | |
Performs the request. More... | |
setDBProfilingAgent () | |
triggerAsyncJobs ( $n, LoggerInterface $runJobsLogger) | |
triggerSyncJobs ( $n, LoggerInterface $runJobsLogger) | |
tryNormaliseRedirect (Title $title) | |
Handle redirects for uncanonical title requests. More... | |
Static Private Member Functions | |
static | getChronProtStrategy (ILBFactory $lbFactory, OutputPage $output) |
static | getUrlDomainDistance ( $url) |
Private Attributes | |
string | $action |
Cache what action this request is. More... | |
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, IContextSource\getConfig(), and RequestContext\getMain().
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 WebResponse\disableForPostSend(), Profiler\instance(), MWExceptionHandler\logException(), restInPeace(), and MWExceptionHandler\rollbackMasterChangesAndLog().
Referenced by run().
MediaWiki::doPreOutputCommit | ( | callable | $postCommitWork = null | ) |
callable | null | $postCommitWork | [default: null] |
Definition at line 581 of file MediaWiki.php.
References preOutputCommit().
|
static |
Send out any buffered statsd data according to sampling rules.
IBufferingStatsdDataFactory | $stats | |
Config | $config |
ConfigException |
Definition at line 968 of file MediaWiki.php.
References $config, IBufferingStatsdDataFactory\clearData(), Config\get(), IBufferingStatsdDataFactory\getData(), IBufferingStatsdDataFactory\hasData(), and MWExceptionHandler\logException().
Referenced by Maintenance\output(), Maintenance\setLBFactoryTriggers(), and wfLogProfilingData().
MediaWiki::getAction | ( | ) |
Returns the name of the action that will be executed.
Definition at line 153 of file MediaWiki.php.
References $action, and Action\getActionName().
Referenced by main(), and performAction().
|
staticprivate |
ILBFactory | $lbFactory | |
OutputPage | $output |
Definition at line 692 of file MediaWiki.php.
References $output, getUrlDomainDistance(), and Wikimedia\Rdbms\ILBFactory\hasOrMadeRecentMasterChanges().
Referenced by preOutputCommit().
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 SpecialPage\getTitleFor(), and parseTitle().
Referenced by MediaWiki\Extension\OATHAuth\Special\OATHManage\addCustomContent(), MediaWiki\Extension\OATHAuth\Special\OATHManage\clearPage(), MediaWiki\Extension\OATHAuth\Special\OATHManage\getGenericContent(), main(), MediaWiki\Extension\OATHAuth\Special\OATHManage\showDisableWarning(), and triggerJobs().
|
staticprivate |
string | $url |
Definition at line 723 of file MediaWiki.php.
References WikiMap\getWikiFromUrl(), and WikiMap\isCurrentWikiId().
Referenced by getChronProtStrategy().
|
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 $action, $file, $title, WikiPage\factory(), ContentHandler\getForTitle(), Article\newFromWikiPage(), Hooks\run(), and wfWarn().
Referenced by performRequest().
|
private |
Definition at line 793 of file MediaWiki.php.
References $action, $cache, $output, $title, $wgTitle, doPreOutputCommit(), getAction(), getTitle(), Profiler\instance(), Title\makeTitle(), Title\newFromText(), NS_MAIN, NS_SPECIAL, performRequest(), PROTO_HTTPS, Hooks\run(), HTMLFileCache\useFileCache(), wfDebugLog(), and wfExpandUrl().
Referenced by run().
|
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 $action, $title, MediaWiki\MediaWikiServices\getInstance(), SpecialPage\getTitleFor(), Title\makeTitle(), Revision\newFromId(), Title\newFromID(), Title\newFromTextThrow(), Title\newFromURL(), Title\newMainPage(), 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 $action, $output, $title, Action\factory(), getAction(), Title\getCdnUrls(), Profiler\instance(), PROTO_INTERNAL, Hooks\run(), and wfExpandUrl().
Referenced by performRequest().
|
private |
Performs the request.
MWException|PermissionsError|BadTitleError|HttpError |
Definition at line 173 of file MediaWiki.php.
References $output, $title, $wgTitle, MediaWiki\MediaWikiServices\getInstance(), SpecialPage\getTitleFor(), initializeArticle(), parseTitle(), performAction(), Hooks\run(), FauxRequest\setRequestURL(), 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 $config, $context, $output, DeferredUpdates\doUpdates(), Config\get(), getChronProtStrategy(), IContextSource\getConfig(), MediaWiki\MediaWikiServices\getInstance(), IContextSource\getOutput(), IContextSource\getRequest(), MWExceptionHandler\logException(), DeferredUpdates\PRESEND, MessageCache\singleton(), wfDebug(), and wfDebugLog().
Referenced by doPreOutputCommit(), MediaWiki\Rest\EntryPoint\execute(), and ApiMain\executeActionWithErrorHandling().
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 927 of file MediaWiki.php.
References DeferredUpdates\doUpdates(), MediaWiki\MediaWikiServices\getInstance(), Profiler\instance(), 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 $action, $cache, $context, doPostOutputShutdown(), doPreOutputCommit(), MWExceptionRenderer\getHTML(), IContextSource\getRequest(), IContextSource\getTitle(), MWExceptionHandler\handleException(), main(), HTMLFileCache\MODE_OUTAGE, ErrorPageError\report(), setDBProfilingAgent(), ErrorPageError\STAGE_OUTPUT, and HTMLFileCache\useFileCache().
Referenced by MediaWiki\Rest\SimpleHandler\execute().
|
private |
Definition at line 567 of file MediaWiki.php.
References MediaWiki\MediaWikiServices\getInstance().
Referenced by run().
|
private |
int | $n | Number of jobs to try to run |
LoggerInterface | $runJobsLogger |
Definition at line 1051 of file MediaWiki.php.
References $status, MediaWiki\MediaWikiServices\getInstance(), SpecialRunJobs\getQuerySignature(), JobQueueGroup\singleton(), JobQueueGroup\TYPE_DEFAULT, 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 993 of file MediaWiki.php.
References getTitle(), MWExceptionHandler\logException(), triggerAsyncJobs(), triggerSyncJobs(), and wfReadOnly().
Referenced by restInPeace().
|
private |
int | $n | Number of jobs to try to run |
LoggerInterface | $runJobsLogger |
Definition at line 1035 of file MediaWiki.php.
References Profiler\instance().
Referenced by triggerJobs().
|
private |
Handle redirects for uncanonical title requests.
Handles:
Behaviour:
Title | $title |
HttpError |
Definition at line 335 of file MediaWiki.php.
References $output, $title, MediaWiki\MediaWikiServices\getInstance(), SpecialPage\getTitleFor(), PROTO_CURRENT, Hooks\run(), and wfExpandUrl().
Referenced by performRequest().
|
private |
Cache what action this request is.
Definition at line 48 of file MediaWiki.php.
Referenced by MediaWiki\Permissions\PermissionManager\checkActionPermissions(), MediaWiki\Permissions\PermissionManager\checkCascadingSourcesRestrictions(), MediaWiki\Permissions\PermissionManager\checkPageRestrictions(), MediaWiki\Permissions\PermissionManager\checkPermissionHooks(), MediaWiki\Permissions\PermissionManager\checkQuickPermissions(), MediaWiki\Permissions\PermissionManager\checkReadPermissions(), MediaWiki\Permissions\PermissionManager\checkSiteConfigPermissions(), MediaWiki\Permissions\PermissionManager\checkSpecialsAndNSPermissions(), MediaWiki\Permissions\PermissionManager\checkUserBlock(), MediaWiki\Permissions\PermissionManager\checkUserConfigPermissions(), MediaWiki\Auth\AuthManager\fillRequests(), getAction(), MediaWiki\Extension\OATHAuth\Auth\TOTPSecondaryAuthenticationProvider\getAuthenticationRequests(), MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider\getAuthenticationRequests(), MediaWiki\Auth\AbstractPasswordPrimaryAuthenticationProvider\getAuthenticationRequests(), MediaWiki\Auth\AuthManager\getAuthenticationRequests(), MediaWiki\Extension\OATHAuth\Module\TOTP\getManageForm(), MediaWiki\Permissions\PermissionManager\getPermissionErrors(), MediaWiki\Permissions\PermissionManager\getPermissionErrorsInternal(), initializeArticle(), MediaWiki\Rest\BasicAccess\MWBasicRequestAuthorizer\isAllowed(), main(), MediaWiki\Permissions\PermissionManager\missingPermissionError(), parseTitle(), performAction(), MediaWiki\Block\AbstractBlock\prevents(), MediaWiki\Permissions\PermissionManager\quickUserCan(), run(), MediaWiki\Permissions\PermissionManager\userCan(), MediaWiki\Permissions\PermissionManager\userHasAllRights(), MediaWiki\Permissions\PermissionManager\userHasAnyRight(), MediaWiki\Permissions\PermissionManager\userHasRight(), and MediaWiki\Preferences\DefaultPreferencesFactory\watchlistPreferences().
|
private |
Definition at line 43 of file MediaWiki.php.
Referenced by MediaWiki\Widget\PendingTextInputWidget\__construct(), MediaWiki\Widget\UserInputWidget\__construct(), MediaWiki\Widget\UsersMultiselectWidget\__construct(), MediaWiki\Widget\NamespacesMultiselectWidget\__construct(), MediaWiki\Widget\TitlesMultiselectWidget\__construct(), MediaWiki\Widget\NamespaceInputWidget\__construct(), MediaWiki\Widget\DateTimeInputWidget\__construct(), MediaWiki\Widget\SearchInputWidget\__construct(), MediaWiki\Widget\TitleInputWidget\__construct(), MediaWiki\Widget\TagMultiselectWidget\__construct(), MediaWiki\Widget\CheckMatrixWidget\__construct(), MediaWiki\Widget\DateInputWidget\__construct(), MediaWiki\Auth\Throttler\__construct(), MediaWiki\Config\ConfigRepository\add(), MediaWiki\Block\AbstractBlock\appliesToRight(), MediaWiki\Block\AbstractBlock\appliesToUsertalk(), MediaWiki\Extension\OATHAuth\Hook\GetUserPermissionsErrors\CheckExclusiveRights\callback(), emitBufferedStatsdData(), MediaWiki\Widget\UsersMultiselectWidget\getConfig(), MediaWiki\Widget\NamespacesMultiselectWidget\getConfig(), MediaWiki\Widget\UserInputWidget\getConfig(), MediaWiki\Widget\TitlesMultiselectWidget\getConfig(), MediaWiki\Widget\DateTimeInputWidget\getConfig(), MediaWiki\Widget\ExpiryInputWidget\getConfig(), MediaWiki\Widget\NamespaceInputWidget\getConfig(), MediaWiki\Widget\TagMultiselectWidget\getConfig(), MediaWiki\Widget\TitleInputWidget\getConfig(), MediaWiki\Widget\SearchInputWidget\getConfig(), MediaWiki\Widget\DateInputWidget\getConfig(), MediaWiki\Widget\CheckMatrixWidget\getConfig(), MediaWiki\Config\ConfigRepository\getDescriptionOf(), MediaWiki\Auth\UserDataAuthenticationRequest\getFieldInfo(), MediaWiki\Widget\DateInputWidget\getInputElement(), MediaWiki\Widget\NamespaceInputWidget\getNamespaceDropdownOptions(), MediaWiki\Config\ConfigRepository\getValueOf(), MediaWiki\Auth\TemporaryPasswordAuthenticationRequest\newRandom(), preOutputCommit(), MediaWiki\Block\AbstractBlock\prevents(), and MediaWiki\Block\DatabaseBlock\shouldTrackWithCookie().
|
private |
Definition at line 38 of file MediaWiki.php.
Referenced by __construct(), MediaWiki\Shell\Command\__destruct(), MediaWiki\Special\SpecialPageFactory\capturePath(), MediaWiki\Storage\PageEditStash\checkCache(), MediaWiki\Logger\LogCapturingSpi\createLogger(), MediaWiki\Preferences\DefaultPreferencesFactory\datetimePreferences(), MediaWiki\Logger\LegacyLogger\destination(), MediaWiki\Special\SpecialPageFactory\executePath(), MediaWiki\Logger\Monolog\LogstashFormatter\fixKeyConflicts(), MediaWiki\Logger\LegacyLogger\format(), MediaWiki\Logger\LegacyLogger\formatAsWfDebug(), MediaWiki\Logger\Monolog\LogstashFormatter\formatV0(), MediaWiki\Logger\Monolog\LogstashFormatter\formatV1(), MediaWiki\Preferences\DefaultPreferencesFactory\generateSkinOptions(), MediaWiki\Block\AbstractBlock\getBlockErrorParams(), MediaWiki\Preferences\DefaultPreferencesFactory\getDateOptions(), MediaWiki\Preferences\DefaultPreferencesFactory\getForm(), MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor(), MediaWiki\Block\CompositeBlock\getPermissionsError(), MediaWiki\Preferences\DefaultPreferencesFactory\getTimezoneOptions(), MediaWiki\Logger\LegacyLogger\interpolate(), MediaWiki\Preferences\DefaultPreferencesFactory\loadPreferenceValues(), MediaWiki\Logger\ConsoleLogger\log(), MediaWiki\Logger\LegacyLogger\log(), MediaWiki\Auth\Throttler\logRejection(), Revision\RenderedRevision\outputVariesOnRevisionMetaData(), MediaWiki\Storage\PageEditStash\parseAndCache(), preOutputCommit(), MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences(), run(), MediaWiki\Logger\LegacyLogger\shouldEmit(), MediaWiki\Preferences\DefaultPreferencesFactory\skinPreferences(), MediaWiki\Preferences\DefaultPreferencesFactory\submitForm(), MediaWiki\Logger\Monolog\KafkaHandler\warning(), and MediaWiki\Preferences\DefaultPreferencesFactory\watchlistPreferences().