MediaWiki Class Reference

MediaWiki is the to-be base class for this whole project. More...

List of all members.

Public Member Functions

 __construct ()
 Constructor.
 setVal ($key, &$value)
 Stores key/value pairs to circumvent global variables Note that keys are case-insensitive!
 getVal ($key, $default= '')
 Retrieves key/value pairs to circumvent global variables Note that keys are case-insensitive!
 initialize (&$title, &$article, &$output, &$user, $request)
 Initialization of .
 checkMaxLag ($maxLag)
 Check if the maximum lag of database slaves is higher that $maxLag, and if it's the case, output an error message.
 checkInitialQueries ($title, $action)
 Checks some initial queries Note that $title here is *not* a Title object, but a string!
 preliminaryChecks (&$title, &$output, $request)
 Checks for search query and anon-cannot-read case.
 initializeSpecialCases (&$title, &$output, $request)
 Initialize some special cases:
  • bad titles
  • local interwiki redirects
  • redirect loop
  • special pages.

 initializeArticle (&$title, $request)
 Initialize the object to be known as $wgArticle for "standard" actions Create an Article object for the page, following redirects if needed.
 finalCleanup (&$deferredUpdates, &$output)
 Cleaning up by doing deferred updates, calling LBFactory and doing the output.
 doUpdates (&$updates)
 Deferred updates aren't really deferred anymore.
 doJobs ()
 Do a job from the job queue.
 restInPeace ()
 Ends this task peacefully.
 performAction (&$output, &$article, &$title, &$user, &$request)
 Perform one of the "standard" actions.

Static Public Member Functions

static articleFromTitle (&$title)
 Create an Article object of the appropriate class for the given page.

Public Attributes

 $GET
 $params = array()


Detailed Description

MediaWiki is the to-be base class for this whole project.

Definition at line 5 of file Wiki.php.


Constructor & Destructor Documentation

MediaWiki::__construct (  ) 

Constructor.

It just save the $_GET variable

Definition at line 11 of file Wiki.php.


Member Function Documentation

static MediaWiki::articleFromTitle ( &$  title  )  [static]

Create an Article object of the appropriate class for the given page.

Parameters:
$title Title
Returns:
Article object

Definition at line 246 of file Wiki.php.

References $title, Title::makeTitle(), and wfRunHooks().

Referenced by SearchEngine::getNearMatch(), and initializeArticle().

MediaWiki::checkInitialQueries ( title,
action 
)

Checks some initial queries Note that $title here is *not* a Title object, but a string!

Parameters:
$title String
$action String
Returns:
Title object to be $wgTitle

Definition at line 100 of file Wiki.php.

References $action, $title, $wgContLang, $wgOut, $wgRequest, Revision::newFromId(), Title::newFromID(), Title::newFromURL(), and Title::newMainPage().

MediaWiki::checkMaxLag ( maxLag  ) 

Check if the maximum lag of database slaves is higher that $maxLag, and if it's the case, output an error message.

Parameters:
$maxLag int: maximum lag allowed for the request, as supplied by the client
Returns:
bool true if the request can continue

Definition at line 82 of file Wiki.php.

References $maxLag, wfGetLB(), and wfMaxlagError().

MediaWiki::doJobs (  ) 

Do a job from the job queue.

Definition at line 385 of file Wiki.php.

References $job, $n, $output, $success, $t, getVal(), Job::pop(), wfDebugLog(), wfReadOnly(), and wfTime().

Referenced by finalCleanup().

MediaWiki::doUpdates ( &$  updates  ) 

Deferred updates aren't really deferred anymore.

It's important to report errors to the user, and that means doing this before OutputPage::output(). Note that for page saves, the client will wait until the script exits anyway before following the redirect.

Parameters:
$updates array of objects that hold an update to do

Definition at line 362 of file Wiki.php.

References $dbw, $updates, wfGetDB(), wfProfileIn(), and wfProfileOut().

Referenced by finalCleanup().

MediaWiki::finalCleanup ( &$  deferredUpdates,
&$  output 
)

Cleaning up by doing deferred updates, calling LBFactory and doing the output.

Parameters:
$deferredUpdates array of updates to do
$output OutputPage

Definition at line 339 of file Wiki.php.

References $output, doJobs(), doUpdates(), wfGetLBFactory(), wfProfileIn(), and wfProfileOut().

MediaWiki::getVal ( key,
default = '' 
)

Retrieves key/value pairs to circumvent global variables Note that keys are case-insensitive!

Parameters:
$key String: key to get
$default Mixed: default value if if the key doesn't exist

Definition at line 34 of file Wiki.php.

References $key.

Referenced by doJobs(), initializeArticle(), initializeSpecialCases(), and performAction().

MediaWiki::initialize ( &$  title,
&$  article,
&$  output,
&$  user,
request 
)

Initialization of .

.. everything Performs the request too FIXME: why is this crap called "initialize" when it performs everything?

Parameters:
$title Title ($wgTitle)
$article Article
$output OutputPage
$user User
$request WebRequest

Definition at line 53 of file Wiki.php.

References $output, $title, $user, initializeArticle(), initializeSpecialCases(), performAction(), preliminaryChecks(), wfProfileIn(), and wfProfileOut().

MediaWiki::initializeArticle ( &$  title,
request 
)

Initialize the object to be known as $wgArticle for "standard" actions Create an Article object for the page, following redirects if needed.

Parameters:
$title Title ($wgTitle)
$request WebRequest
Returns:
mixed an Article, or a string to redirect to another URL

Definition at line 276 of file Wiki.php.

References $action, $dbr, $file, $title, articleFromTitle(), getVal(), wfGetDB(), wfProfileIn(), wfProfileOut(), and wfRunHooks().

Referenced by initialize().

MediaWiki::initializeSpecialCases ( &$  title,
&$  output,
request 
)

Initialize some special cases:

  • bad titles
  • local interwiki redirects
  • redirect loop
  • special pages.

FIXME: why is this crap called "initialize" when it performs everything?

Parameters:
$title Title
$output OutputPage
$request WebRequest
Returns:
bool true if the request is already executed

Definition at line 174 of file Wiki.php.

References $action, $output, $title, $url, SpecialPage::executePath(), SpecialPage::getTitleFor(), getVal(), wfHttpError(), wfProfileIn(), and wfProfileOut().

Referenced by initialize().

MediaWiki::performAction ( &$  output,
&$  article,
&$  title,
&$  user,
&$  request 
)

Perform one of the "standard" actions.

Parameters:
$output OutputPage
$article Article
$title Title
$user User
$request WebRequest

Definition at line 433 of file Wiki.php.

References $action, $mode, $output, $section, $title, $user, getVal(), Credits::showPage(), wfHttpError(), wfMsg(), wfProfileIn(), wfProfileOut(), wfRunHooks(), and wfSetupSession().

Referenced by initialize().

MediaWiki::preliminaryChecks ( &$  title,
&$  output,
request 
)

Checks for search query and anon-cannot-read case.

Parameters:
$title Title
$output OutputPage
$request WebRequest

Definition at line 139 of file Wiki.php.

References $output, $title, and SpecialPage::getTitleFor().

Referenced by initialize().

MediaWiki::restInPeace (  ) 

Ends this task peacefully.

Definition at line 419 of file Wiki.php.

References wfDebug(), and wfLogProfilingData().

MediaWiki::setVal ( key,
&$  value 
)

Stores key/value pairs to circumvent global variables Note that keys are case-insensitive!

Parameters:
$key String: key to store
$value Mixed: value to put for the key

Definition at line 22 of file Wiki.php.

References $key.


Member Data Documentation

MediaWiki::$GET

Definition at line 7 of file Wiki.php.

MediaWiki::$params = array()

Definition at line 8 of file Wiki.php.


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

Generated on Sat Sep 5 02:08:42 2009 for MediaWiki by  doxygen 1.5.9