class JMediawikiPages extends JMediawikiObject

MediaWiki API Pages class for the Joomla Platform.

Methods

__construct( Registry $options = null, JMediawikiHttp $client = null)

Constructor.

string
buildParameter( array $params)

Method to build request parameters from a string array.

Object
validateResponse( JHttpresponse $response)

Method to validate response for errors

object
editPage( string $title, int $section = null, string $sectiontitle = null, string $text = null, string $summary = null)

Method to edit a page.

object
deletePageByName( string $title, string $reason = null, string $watchlist = null, string $oldimage = null)

Method to delete a page.

object
deletePageById( string $pageid, string $reason = null, string $watchlist = null, string $oldimage = null)

Method to delete a page.

object
undeletePage( string $title, string $reason = null, string $timestamp = null, string $watchlist = null)

Method to restore certain revisions of a deleted page.

object
movePageByName( string $from, string $to, string $reason = null, string $movetalk = null, string $movesubpages = null, boolean $noredirect = null, string $watchlist = null, boolean $ignorewarnings = null)

Method to move a page.

object
movePageById( int $fromid, string $to, string $reason = null, string $movetalk = null, string $movesubpages = null, boolean $noredirect = null, string $watchlist = null, boolean $ignorewarnings = null)

Method to move a page.

object
rollback( string $title, string $user, string $summary = null, string $markbot = null, string $watchlist = null)

Method to undo the last edit to the page.

object
changeProtection( string $title, string $protections, string $expiry = null, string $reason = null, string $cascade = null, string $watchlist = null)

Method to change the protection level of a page.

object
getPageInfo( array $titles, array $inprop = null, array $intoken = null, boolean $incontinue = null)

Method to get basic page information.

object
getPageProperties( array $titles, boolean $ppcontinue = null, string $ppprop = null)

Method to get various properties defined in the page content.

object
getRevisions( array $titles, array $rvprop = null, boolean $rvparse = null, int $rvlimit = null)

Method to get a list of revisions.

object
getPageTemplates( array $titles, array $tlnamespace = null, integer $tllimit = null, boolean $tlcontinue = null, string $tltemplates = null, string $tldir = null)

Method to get all page templates from the given page.

object
getBackLinks( string $bltitle, integer $blpageid = null, boolean $blcontinue = null, array $blnamespace = null, string $blfilterredirect = null, integer $bllimit = null, boolean $blredirect = null)

Method to get all pages that link to the given page.

object
getIWBackLinks( string $iwbltitle, string $iwblprefix = null, boolean $iwblcontinue = null, integer $iwbllimit = null, array $iwblprop = null)

Method to get all pages that link to the given interwiki link.

object
getToken( string $user, string $intoken)

Method to get access token.

Details

__construct( Registry $options = null, JMediawikiHttp $client = null)

Constructor.

Parameters

Registry $options Mediawiki options object.
JMediawikiHttp $client The HTTP client object.

string buildParameter( array $params)

Method to build request parameters from a string array.

Parameters

array $params string array that contains the parameters

Return Value

string request parameter

Object validateResponse( JHttpresponse $response)

Method to validate response for errors

Parameters

JHttpresponse $response reponse from the mediawiki server

Return Value

Object

Exceptions

DomainException

object editPage( string $title, int $section = null, string $sectiontitle = null, string $text = null, string $summary = null)

Method to edit a page.

Parameters

string $title Page title.
int $section Section number.
string $sectiontitle The title for a new section.
string $text Page content.
string $summary Title of the page you want to delete.

Return Value

object

object deletePageByName( string $title, string $reason = null, string $watchlist = null, string $oldimage = null)

Method to delete a page.

Parameters

string $title Title of the page you want to delete.
string $reason Reason for the deletion.
string $watchlist Unconditionally add or remove the page from your watchlis.
string $oldimage The name of the old image to delete.

Return Value

object

object deletePageById( string $pageid, string $reason = null, string $watchlist = null, string $oldimage = null)

Method to delete a page.

Parameters

string $pageid Page ID of the page you want to delete.
string $reason Reason for the deletion.
string $watchlist Unconditionally add or remove the page from your watchlis.
string $oldimage The name of the old image to delete.

Return Value

object

object undeletePage( string $title, string $reason = null, string $timestamp = null, string $watchlist = null)

Method to restore certain revisions of a deleted page.

Parameters

string $title Title of the page you want to restore.
string $reason Reason for restoring (optional).
string $timestamp Timestamps of the revisions to restore.
string $watchlist Unconditionally add or remove the page from your watchlist.

Return Value

object

object movePageByName( string $from, string $to, string $reason = null, string $movetalk = null, string $movesubpages = null, boolean $noredirect = null, string $watchlist = null, boolean $ignorewarnings = null)

Method to move a page.

Parameters

string $from Title of the page you want to move.
string $to Title you want to rename the page to.
string $reason Reason for the move (optional).
string $movetalk Move the talk page, if it exists.
string $movesubpages Move subpages, if applicable.
boolean $noredirect Don't create a redirect.
string $watchlist Unconditionally add or remove the page from your watchlist.
boolean $ignorewarnings Ignore any warnings.

Return Value

object

object movePageById( int $fromid, string $to, string $reason = null, string $movetalk = null, string $movesubpages = null, boolean $noredirect = null, string $watchlist = null, boolean $ignorewarnings = null)

Method to move a page.

Parameters

int $fromid Page ID of the page you want to move.
string $to Title you want to rename the page to.
string $reason Reason for the move (optional).
string $movetalk Move the talk page, if it exists.
string $movesubpages Move subpages, if applicable.
boolean $noredirect Don't create a redirect.
string $watchlist Unconditionally add or remove the page from your watchlist.
boolean $ignorewarnings Ignore any warnings.

Return Value

object

object rollback( string $title, string $user, string $summary = null, string $markbot = null, string $watchlist = null)

Method to undo the last edit to the page.

Parameters

string $title Title of the page you want to rollback.
string $user Name of the user whose edits are to be rolled back.
string $summary Custom edit summary. If not set, default summary will be used.
string $markbot Mark the reverted edits and the revert as bot edits.
string $watchlist Unconditionally add or remove the page from your watchlist.

Return Value

object

object changeProtection( string $title, string $protections, string $expiry = null, string $reason = null, string $cascade = null, string $watchlist = null)

Method to change the protection level of a page.

Parameters

string $title Title of the page you want to (un)protect.
string $protections Pipe-separated list of protection levels.
string $expiry Expiry timestamps.
string $reason Reason for (un)protecting (optional).
string $cascade Enable cascading protection.
string $watchlist Unconditionally add or remove the page from your watchlist.

Return Value

object

object getPageInfo( array $titles, array $inprop = null, array $intoken = null, boolean $incontinue = null)

Method to get basic page information.

Parameters

array $titles Page titles to retrieve info.
array $inprop Which additional properties to get.
array $intoken Request a token to perform a data-modifying action on a page
boolean $incontinue When more results are available, use this to continue.

Return Value

object

object getPageProperties( array $titles, boolean $ppcontinue = null, string $ppprop = null)

Method to get various properties defined in the page content.

Parameters

array $titles Page titles to retrieve properties.
boolean $ppcontinue When more results are available, use this to continue.
string $ppprop Page prop to look on the page for.

Return Value

object

object getRevisions( array $titles, array $rvprop = null, boolean $rvparse = null, int $rvlimit = null)

Method to get a list of revisions.

Parameters

array $titles Page titles to retrieve revisions.
array $rvprop Which properties to get for each revision.
boolean $rvparse Parse revision content.
int $rvlimit Limit how many revisions will be returned.

Return Value

object

object getPageTemplates( array $titles, array $tlnamespace = null, integer $tllimit = null, boolean $tlcontinue = null, string $tltemplates = null, string $tldir = null)

Method to get all page templates from the given page.

Parameters

array $titles Page titles to retrieve templates.
array $tlnamespace Show templates in this namespace(s) only.
integer $tllimit How many templates to return.
boolean $tlcontinue When more results are available, use this to continue.
string $tltemplates Only list these templates.
string $tldir The direction in which to list.

Return Value

object

Method to get all pages that link to the given page.

Parameters

string $bltitle Title to search.
integer $blpageid Pageid to search.
boolean $blcontinue When more results are available, use this to continue.
array $blnamespace The namespace to enumerate.
string $blfilterredirect How to filter for redirects..
integer $bllimit How many total pages to return.
boolean $blredirect If linking page is a redirect, find all pages that link to that redirect as well.

Return Value

object

Method to get all pages that link to the given interwiki link.

Parameters

string $iwbltitle Interwiki link to search for. Must be used with iwblprefix.
string $iwblprefix Prefix for the interwiki.
boolean $iwblcontinue When more results are available, use this to continue.
integer $iwbllimit How many total pages to return.
array $iwblprop Which properties to get.

Return Value

object

object getToken( string $user, string $intoken)

Method to get access token.

Parameters

string $user The User to get token.
string $intoken The type of token.

Return Value

object