MediaWiki
1.28.3
|
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... | |
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') | |
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 | preOutputCommit (IContextSource $context, callable $postCommitWork=null) |
This function commits all DB changes as needed before the user can receive a response (in case commit fails) 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 () | |
tryNormaliseRedirect (Title $title) | |
Handle redirects for uncanonical title requests. More... | |
Static Private Member Functions | |
static | getUrlDomainDistance ($url, IContextSource $context) |
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 29 of file MediaWiki.php.
MediaWiki::__construct | ( | IContextSource | $context = null | ) |
IContextSource | null | $context |
Definition at line 48 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 711 of file MediaWiki.php.
References $e, MWExceptionHandler\handleException(), Profiler\instance(), restInPeace(), and use.
Referenced by run().
MediaWiki::doPreOutputCommit | ( | callable | $postCommitWork = null | ) |
callable | $postCommitWork | [default: null] |
Definition at line 560 of file MediaWiki.php.
MediaWiki::getAction | ( | ) |
Returns the name of the action that will be executed.
Definition at line 149 of file MediaWiki.php.
References $action, and Action\getActionName().
Referenced by main(), and performAction().
MediaWiki::getTitle | ( | ) |
Get the Title object that we'll be acting on, as specified in the WebRequest.
Definition at line 133 of file MediaWiki.php.
References SpecialPage\getTitleFor(), and parseTitle().
Referenced by main(), and triggerJobs().
|
staticprivate |
string | $url | |
IContextSource | $context |
Definition at line 671 of file MediaWiki.php.
References as, IContextSource\getConfig(), true, and wfParseUrl().
|
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 377 of file MediaWiki.php.
References $article, $page, $request, $title, WikiPage\factory(), ContentHandler\getForTitle(), ContextSource\getRequest(), Article\newFromWikiPage(), Hooks\run(), and wfWarn().
Referenced by performRequest().
|
private |
Definition at line 743 of file MediaWiki.php.
References $buffer, $cache, $output, $request, $timestamp, $title, $wgTitle, doPreOutputCommit(), getAction(), ContextSource\getRequest(), getTitle(), global, Profiler\instance(), Title\makeTitle(), Title\newFromText(), NS_MAIN, NS_SPECIAL, performRequest(), print, PROTO_HTTPS, Hooks\run(), use, 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 63 of file MediaWiki.php.
References $request, $ret, $rev, $title, $wgContLang, ContextSource\getRequest(), SpecialPage\getTitleFor(), global, 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 460 of file MediaWiki.php.
References $output, $page, $request, $title, $user, Action\factory(), getAction(), Title\getCdnUrls(), ContextSource\getRequest(), Profiler\instance(), PROTO_INTERNAL, Hooks\run(), and wfExpandUrl().
Referenced by performRequest().
|
private |
Performs the request.
MWException|PermissionsError|BadTitleError|HttpError |
Definition at line 169 of file MediaWiki.php.
References $article, $output, $query, $request, $title, $user, $wgTitle, ParserOutput\addJsConfigVars(), ParserOutput\addModules(), SpecialPageFactory\executePath(), ContextSource\getOutput(), SpecialPageFactory\getPage(), ContextSource\getRequest(), SpecialPage\getTitleFor(), global, initializeArticle(), list, NS_SPECIAL, parseTitle(), performAction(), SpecialPageFactory\resolveAlias(), Hooks\run(), and tryNormaliseRedirect().
Referenced by main().
|
static |
This function commits all DB changes as needed before the user can receive a response (in case commit fails)
IContextSource | $context | |
callable | $postCommitWork | [default: null] |
Definition at line 572 of file MediaWiki.php.
References $context, $flags, $lbFactory, $options, $output, $request, DeferredUpdates\doUpdates(), Config\get(), IContextSource\getConfig(), MediaWiki\MediaWikiServices\getInstance(), IContextSource\getOutput(), IContextSource\getRequest(), DeferredUpdates\PRESEND, MessageCache\singleton(), wfDebug(), and wfDebugLog().
Referenced by ApiMain\executeActionWithErrorHandling().
MediaWiki::restInPeace | ( | $mode = 'fast' | ) |
Ends this task peacefully.
string | $mode | Use 'fast' to always skip job running |
Definition at line 877 of file MediaWiki.php.
References $lbFactory, DeferredUpdates\addCallableUpdate(), class, DeferredUpdates\doUpdates(), MediaWiki\MediaWikiServices\getInstance(), Profiler\instance(), ILBFactory\SHUTDOWN_NO_CHRONPROT, triggerJobs(), wfDebug(), and wfLogProfilingData().
Referenced by doPostOutputShutdown().
MediaWiki::run | ( | ) |
Run the current MediaWiki instance; index.php just calls this.
Definition at line 508 of file MediaWiki.php.
References $cache, $context, $e, doPostOutputShutdown(), doPreOutputCommit(), MWExceptionRenderer\getHTML(), IContextSource\getRequest(), IContextSource\getTitle(), MWExceptionHandler\handleException(), main(), HTMLFileCache\MODE_OUTAGE, print, ErrorPageError\report(), setDBProfilingAgent(), and HTMLFileCache\useFileCache().
|
private |
Definition at line 546 of file MediaWiki.php.
References $name, $services, and MediaWiki\MediaWikiServices\getInstance().
Referenced by run().
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 917 of file MediaWiki.php.
References $e, $query, $req, $special, $status, SpecialPageFactory\getPage(), SpecialRunJobs\getQuerySignature(), getTitle(), MWExceptionHandler\logException(), JobQueueGroup\singleton(), JobQueueGroup\TYPE_DEFAULT, wfParseUrl(), and wfReadOnly().
Referenced by restInPeace().
|
private |
Handle redirects for uncanonical title requests.
Handles:
Behaviour:
Title | $title |
HttpError |
Definition at line 322 of file MediaWiki.php.
References $name, $output, $request, Title\getDBkey(), Title\getFullURL(), Title\getPrefixedDBkey(), ContextSource\getRequest(), SpecialPage\getTitleFor(), Title\isSpecialPage(), list, PROTO_CURRENT, SpecialPageFactory\resolveAlias(), Hooks\run(), and wfExpandUrl().
Referenced by performRequest().
|
private |
Cache what action this request is.
Definition at line 43 of file MediaWiki.php.
Referenced by MediaWiki\Auth\AuthManager\fillRequests(), getAction(), MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider\getAuthenticationRequests(), MediaWiki\Auth\AbstractPasswordPrimaryAuthenticationProvider\getAuthenticationRequests(), MediaWiki\Auth\AuthPluginPrimaryAuthenticationProvider\getAuthenticationRequests(), MediaWiki\Auth\AuthManager\getAuthenticationRequests(), MediaWiki\Auth\ResetPasswordSecondaryAuthenticationProviderTest\testGetAuthenticationRequests(), MediaWiki\Auth\ConfirmLinkSecondaryAuthenticationProviderTest\testGetAuthenticationRequests(), MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProviderTest\testGetAuthenticationRequests(), MediaWiki\Auth\CheckBlocksSecondaryAuthenticationProviderTest\testGetAuthenticationRequests(), MediaWiki\Auth\AuthPluginPrimaryAuthenticationProviderTest\testGetAuthenticationRequests(), MediaWiki\Auth\AbstractPasswordPrimaryAuthenticationProviderTest\testGetAuthenticationRequests(), MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProviderTest\testGetAuthenticationRequests(), MediaWiki\Auth\AuthManagerTest\testGetAuthenticationRequests(), MediaWiki\Auth\AuthManagerTest\testGetAuthenticationRequestsRequired(), MediaWiki\Auth\PasswordDomainAuthenticationRequestTest\testGetFieldInfo2(), and MediaWiki\Auth\PasswordAuthenticationRequestTest\testGetFieldInfo2().
|
private |
Definition at line 38 of file MediaWiki.php.
Referenced by MediaWiki\Widget\UserInputWidget\__construct(), MediaWiki\Widget\NamespaceInputWidget\__construct(), MediaWiki\Widget\ComplexTitleInputWidget\__construct(), MediaWiki\Widget\DateTimeInputWidget\__construct(), MediaWiki\Widget\SearchInputWidget\__construct(), MediaWiki\Widget\TitleInputWidget\__construct(), MediaWiki\Auth\Throttler\__construct(), MediaWiki\Widget\DateTimeInputWidget\getConfig(), MediaWiki\Widget\NamespaceInputWidget\getConfig(), MediaWiki\Widget\ComplexTitleInputWidget\getConfig(), MediaWiki\Widget\SearchInputWidget\getConfig(), MediaWiki\Widget\TitleInputWidget\getConfig(), MediaWiki\Auth\UserDataAuthenticationRequest\getFieldInfo(), MediaWiki\Session\ImmutableSessionProviderWithCookieTest\getProvider(), MediaWiki\Auth\TemporaryPasswordAuthenticationRequest\newRandom(), MediaWiki\Session\SessionProviderTest\testBasics(), MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProviderTest\testConstructor(), MediaWiki\Auth\CheckBlocksSecondaryAuthenticationProviderTest\testConstructor(), MediaWiki\Auth\ThrottlePreAuthenticationProviderTest\testConstructor(), MediaWiki\Session\CookieSessionProviderTest\testConstructor(), MediaWiki\Auth\ConfirmLinkSecondaryAuthenticationProviderTest\testContinueLinkAttempt(), MediaWiki\Session\CookieSessionProviderTest\testCookieData(), MediaWiki\Session\CookieSessionProviderTest\testGetLoginCookieExpiration(), MediaWiki\Auth\AbstractPasswordPrimaryAuthenticationProviderTest\testGetNewPasswordExpiry(), MediaWiki\Session\CookieSessionProviderTest\testGetRememberUserDuration(), MediaWiki\Session\SessionProviderTest\testHashToSessionId(), MediaWiki\Session\CookieSessionProviderTest\testPersistSession(), MediaWiki\Auth\AbstractPasswordPrimaryAuthenticationProviderTest\testSetPasswordResetFlag(), MediaWiki\Logger\LegacyLoggerTest\testShouldEmit(), and MediaWiki\Auth\ResetPasswordSecondaryAuthenticationProviderTest\testTryReset().
|
private |
Definition at line 33 of file MediaWiki.php.
Referenced by __construct(), MediaWiki\Logger\LegacyLogger\destination(), MediaWiki\Logger\LegacyLogger\format(), MediaWiki\Logger\LegacyLogger\formatAsWfDebug(), MediaWiki\Logger\LegacyLogger\log(), preOutputCommit(), run(), MediaWiki\Logger\LegacyLogger\shouldEmit(), MediaWiki\Session\SessionManagerTest\testGetGlobalSession(), MediaWiki\Logger\LegacyLoggerTest\testInterpolate(), MediaWiki\Auth\AuthManagerTest\testSetDefaultUserOptions(), and MediaWiki\Logger\Monolog\KafkaHandler\warning().