JMediawikiPages

Extends \JMediawikiObject

MediaWiki API Pages class for the Joomla Platform.

since

3.1.4

package

Joomla.Platform

Methods

__construct

Constructor.

__construct(\Joomla\Registry\Registry $options = null, \JMediawikiHttp $client = null) 
inherited
since

3.1.4

Arguments

$options

\Joomla\Registry\RegistryMediawiki options object.

$client

\JMediawikiHttpThe HTTP client object.

buildParameter

Method to build request parameters from a string array.

buildParameter(array $params) : string
inherited
since

3.1.4

Arguments

$params

arraystring array that contains the parameters

Response

stringrequest parameter

changeProtection

Method to change the protection level of a page.

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

3.1.4

Arguments

$title

stringTitle of the page you want to (un)protect.

$protections

stringPipe-separated list of protection levels.

$expiry

stringExpiry timestamps.

$reason

stringReason for (un)protecting (optional).

$cascade

stringEnable cascading protection.

$watchlist

stringUnconditionally add or remove the page from your watchlist.

Response

object

deletePageById

Method to delete a page.

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

3.1.4

Arguments

$pageid

stringPage ID of the page you want to delete.

$reason

stringReason for the deletion.

$watchlist

stringUnconditionally add or remove the page from your watchlis.

$oldimage

stringThe name of the old image to delete.

Response

object

deletePageByName

Method to delete a page.

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

3.1.4

Arguments

$title

stringTitle of the page you want to delete.

$reason

stringReason for the deletion.

$watchlist

stringUnconditionally add or remove the page from your watchlis.

$oldimage

stringThe name of the old image to delete.

Response

object

editPage

Method to edit a page.

editPage(string $title, integer $section = null, string $sectiontitle = null, string $text = null, string $summary = null) : object
since

3.1.4

Arguments

$title

stringPage title.

$section

integerSection number.

$sectiontitle

stringThe title for a new section.

$text

stringPage content.

$summary

stringTitle of the page you want to delete.

Response

object

fetchUrl

Method to build and return a full request URL for the request.

fetchUrl(string $path) : string
inherited
since

3.1.4

Arguments

$path

stringURL to inflect

Response

stringThe request URL.

getPageInfo

Method to get basic page information.

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

3.1.4

Arguments

$titles

arrayPage titles to retrieve info.

$inprop

arrayWhich additional properties to get.

$intoken

arrayRequest a token to perform a data-modifying action on a page

$incontinue

booleanWhen more results are available, use this to continue.

Response

object

getPageProperties

Method to get various properties defined in the page content.

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

3.1.4

Arguments

$titles

arrayPage titles to retrieve properties.

$ppcontinue

booleanWhen more results are available, use this to continue.

$ppprop

stringPage prop to look on the page for.

Response

object

getPageTemplates

Method to get all page templates from the given page.

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

3.1.4

Arguments

$titles

arrayPage titles to retrieve templates.

$tlnamespace

arrayShow templates in this namespace(s) only.

$tllimit

integerHow many templates to return.

$tlcontinue

booleanWhen more results are available, use this to continue.

$tltemplates

stringOnly list these templates.

$tldir

stringThe direction in which to list.

Response

object

getRevisions

Method to get a list of revisions.

getRevisions(array $titles, array $rvprop = null, boolean $rvparse = null, integer $rvlimit = null) : object
since

3.1.4

Arguments

$titles

arrayPage titles to retrieve revisions.

$rvprop

arrayWhich properties to get for each revision.

$rvparse

booleanParse revision content.

$rvlimit

integerLimit how many revisions will be returned.

Response

object

getToken

Method to get access token.

getToken(string $user, string $intoken) : object
since

3.0.0

Arguments

$user

stringThe User to get token.

$intoken

stringThe type of token.

Response

object

movePageById

Method to move a page.

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

3.1.4

Arguments

$fromid

integerPage ID of the page you want to move.

$to

stringTitle you want to rename the page to.

$reason

stringReason for the move (optional).

$movetalk

stringMove the talk page, if it exists.

$movesubpages

stringMove subpages, if applicable.

$noredirect

booleanDon't create a redirect.

$watchlist

stringUnconditionally add or remove the page from your watchlist.

$ignorewarnings

booleanIgnore any warnings.

Response

object

movePageByName

Method to move a page.

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

3.1.4

Arguments

$from

stringTitle of the page you want to move.

$to

stringTitle you want to rename the page to.

$reason

stringReason for the move (optional).

$movetalk

stringMove the talk page, if it exists.

$movesubpages

stringMove subpages, if applicable.

$noredirect

booleanDon't create a redirect.

$watchlist

stringUnconditionally add or remove the page from your watchlist.

$ignorewarnings

booleanIgnore any warnings.

Response

object

rollback

Method to undo the last edit to the page.

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

3.1.4

Arguments

$title

stringTitle of the page you want to rollback.

$user

stringName of the user whose edits are to be rolled back.

$summary

stringCustom edit summary. If not set, default summary will be used.

$markbot

stringMark the reverted edits and the revert as bot edits.

$watchlist

stringUnconditionally add or remove the page from your watchlist.

Response

object

undeletePage

Method to restore certain revisions of a deleted page.

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

3.1.4

Arguments

$title

stringTitle of the page you want to restore.

$reason

stringReason for restoring (optional).

$timestamp

stringTimestamps of the revisions to restore.

$watchlist

stringUnconditionally add or remove the page from your watchlist.

Response

object

validateResponse

Method to validate response for errors

validateResponse(\JHttpresponse $response) : Object
inherited
since

3.1.4

throws

\DomainException

Arguments

$response

\JHttpresponsereponse from the mediawiki server

Response

Object

Properties

options

Options for the MediaWiki object.

inherited
since

3.1.4

Type(s)

\Joomla\Registry\Registry

client

The HTTP client object to use in sending HTTP requests.

inherited
since

3.1.4

Type(s)

\JMediawikiHttp