MediaWiki  1.23.2
MediaWiki Class Reference

The MediaWiki class is the helper class for the index.php entry point. More...

Collaboration diagram for MediaWiki:

Public Member Functions

 __construct (IContextSource $context=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...
 
 output (OutputPage $x=null)
 
 request (WebRequest $x=null)
 
 restInPeace ()
 Ends this task peacefully. More...
 
 run ()
 Run the current MediaWiki instance index.php just calls this. More...
 

Protected Member Functions

 triggerJobs ()
 Potentially open a socket and sent an HTTP request back to the server to run a specified number of jobs. More...
 

Private Member Functions

 checkMaxLag ()
 Checks if the request should abort due to a lagged server, for given maxlag parameter. More...
 
 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...
 

Private Attributes

IContextSource $context
 TODO: fold $output, etc, into this. More...
 

Detailed Description

The MediaWiki class is the helper class for the index.php entry point.

Definition at line 28 of file Wiki.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki::__construct ( IContextSource  $context = null)
Parameters
IContextSource | null$context

Definition at line 58 of file Wiki.php.

References $context, and RequestContext\getMain().

Member Function Documentation

◆ checkMaxLag()

MediaWiki::checkMaxLag ( )
private

Checks if the request should abort due to a lagged server, for given maxlag parameter.

Returns
bool

Definition at line 462 of file Wiki.php.

References global, list, wfGetLB(), wfProfileIn(), and wfProfileOut().

Referenced by run().

◆ getAction()

MediaWiki::getAction ( )

Returns the name of the action that will be executed.

Returns
string: action

Definition at line 146 of file Wiki.php.

References Action\getActionName().

Referenced by main(), and performAction().

◆ getTitle()

MediaWiki::getTitle ( )

Get the Title object that we'll be acting on, as specified in the WebRequest.

Returns
Title

Definition at line 134 of file Wiki.php.

References parseTitle().

Referenced by main(), outItem(), AtomFeed\outItem(), triggerJobs(), and Preferences\tryUISubmit().

◆ initializeArticle()

MediaWiki::initializeArticle ( )
private

Initialize the main Article object for "standard" actions (view, etc) Create an Article object for the page, following redirects if needed.

Returns
mixed an Article, or a string to redirect to another URL

Definition at line 315 of file Wiki.php.

References $article, $file, $title, array(), global, Article\newFromTitle(), Article\newFromWikiPage(), NS_FILE, NS_MEDIAWIKI, wfProfileIn(), wfProfileOut(), and wfRunHooks().

Referenced by performRequest().

◆ main()

◆ output()

MediaWiki::output ( OutputPage  $x = null)
Parameters
$xnull|OutputPage
Returns
OutputPage

Definition at line 49 of file Wiki.php.

◆ parseTitle()

MediaWiki::parseTitle ( )
private

Parse the request to get the Title object.

Returns
Title object to be $wgTitle

Definition at line 71 of file Wiki.php.

References $ret, $rev, $title, $wgContLang, ContextSource\getRequest(), SpecialPage\getTitleFor(), global, Title\makeTitle(), Revision\newFromId(), Title\newFromID(), Title\newFromURL(), Title\newMainPage(), NS_FILE, and NS_MEDIA.

Referenced by getTitle().

◆ performAction()

MediaWiki::performAction ( Page  $page,
Title  $requestTitle 
)
private

Perform one of the "standard" actions.

Parameters
$pagePage
$requestTitleThe original title, before any redirects were applied

Definition at line 398 of file Wiki.php.

References $output, $title, $user, array(), Action\factory(), getAction(), Title\getSquidURLs(), global, wfProfileIn(), wfProfileOut(), and wfRunHooks().

Referenced by performRequest().

◆ performRequest()

MediaWiki::performRequest ( )
private

Performs the request.

  • bad titles
  • read restriction
  • local interwiki redirects
  • redirect loop
  • special pages
  • normal pages
Exceptions
MWException|PermissionsError|BadTitleError|HttpError
Returns
void

Definition at line 168 of file Wiki.php.

References $article, $name, $output, $query, $title, $user, $wgTitle, array(), SpecialPageFactory\executePath(), SpecialPage\getTitleFor(), global, initializeArticle(), list, NS_SPECIAL, performAction(), PROTO_CURRENT, SpecialPageFactory\resolveAlias(), wfExpandUrl(), wfProfileIn(), wfProfileOut(), and wfRunHooks().

Referenced by main().

◆ request()

MediaWiki::request ( WebRequest  $x = null)
Parameters
$xnull|WebRequest
Returns
WebRequest

Definition at line 39 of file Wiki.php.

◆ restInPeace()

MediaWiki::restInPeace ( )

Ends this task peacefully.

Definition at line 605 of file Wiki.php.

References $factory, DeferredUpdates\doUpdates(), wfDebug(), wfGetLBFactory(), and wfLogProfilingData().

Referenced by run().

◆ run()

MediaWiki::run ( )

Run the current MediaWiki instance index.php just calls this.

Definition at line 443 of file Wiki.php.

References $e, checkMaxLag(), MWExceptionHandler\handle(), main(), restInPeace(), and triggerJobs().

◆ triggerJobs()

MediaWiki::triggerJobs ( )
protected

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 625 of file Wiki.php.

References $n, $query, $section, array(), SpecialRunJobs\executeJobs(), SpecialRunJobs\getQuerySignature(), getTitle(), global, JobQueueGroup\singleton(), JobQueueGroup\TYPE_DEFAULT, wfAppendQuery(), wfDebugLog(), wfParseUrl(), wfReadOnly(), wfRestoreWarnings(), wfScript(), and wfSuppressWarnings().

Referenced by run().

Member Data Documentation

◆ $context

IContextSource MediaWiki::$context
private

TODO: fold $output, etc, into this.

Definition at line 33 of file Wiki.php.

Referenced by __construct().


The documentation for this class was generated from the following file: