antragsbot 0.5.1
http://antragsbot.sf.net
|
Public Member Functions | |
__construct ($title, $wikimate) | |
__destruct () | |
__invoke () | |
__toString () | |
destroy () | |
exists () | |
getAllSections ($includeHeading=false, $keyNames=self::SECTIONLIST_BY_INDEX) | |
getError () | |
getNumSections () | |
getSection ($section, $includeHeading=false) | |
getSectionOffsets () | |
getText ($refresh=false) | |
getTitle () | |
newSection ($name, $text) | |
setSection ($text, $section=0, $summary=null, $minor=false) | |
setText ($text, $section=null, $minor=false, $summary=null) | |
Public Attributes | |
const | SECTIONLIST_BY_INDEX = 1 |
const | SECTIONLIST_BY_NAME = 2 |
const | SECTIONLIST_BY_NUMBER = 3 |
Models a wiki article page that can have its text altered and retrieved.
WikiPage::__construct | ( | $ | title, |
$ | wikimate | ||
) |
Constructs a WikiPage object from the title given and adds a wikibot object
string | $title | name of the wiki article |
WikiBot | $wikibot | WikiBot object |
WikiPage::__destruct | ( | ) |
WikiPage::__invoke | ( | ) |
Returns an array sections with the section name as the key and the text as the element e.g.
array( 'intro' => 'this text is the introduction', 'History' => 'this is text under the history section' )
WikiPage::__toString | ( | ) |
Returns the wikicode of the page
WikiPage::destroy | ( | ) |
Alias of self::__destruct()
WikiPage::exists | ( | ) |
Returns the page existance status
WikiPage::getAllSections | ( | $ | includeHeading = false , |
$ | keyNames = self::SECTIONLIST_BY_INDEX |
||
) |
Return all the sections of the page in an array - the key names can be set to name or index by using the following for the second param
boolean | $includeHeading | false to get section text only |
integer | $keyNames | modifier for the array key names |
WikiPage::getError | ( | ) |
Returns an error if there is one, null shows no error
WikiPage::getNumSections | ( | ) |
Returns the number of sections in this page
WikiPage::getSection | ( | $ | section, |
$ | includeHeading = false |
||
) |
Returns the section requested, section can be the following:
mixed | $section | the section to get |
boolan | $includeHeading | false to get section text only |
WikiPage::getSectionOffsets | ( | ) |
Returns the sections offsets and lengths
WikiPage::getText | ( | $ | refresh = false | ) |
Gets the text of the page. If refesh is true then this method will query the wiki api again for the page details
boolean | $refresh | true to query the wiki api again |
WikiPage::getTitle | ( | ) |
Returns the title of this page
WikiPage::newSection | ( | $ | name, |
$ | text | ||
) |
Alias of WikiPage::setSection() specifically for creating new sections
string | $name | the heading name for the new section |
string | $text | The text of the new section |
WikiPage::setSection | ( | $ | text, |
$ | section = 0 , |
||
$ | summary = null , |
||
$ | minor = false |
||
) |
Sets the text of the given section. Essentially an alias of WikiPage:setText() with the summary and minor parameters switched.
string | $text | The text of the section |
mixed | $section | section index, new by default |
string | $summary | summary text |
boolean | $minor | true for minor edit |
WikiPage::setText | ( | $ | text, |
$ | section = null , |
||
$ | minor = false , |
||
$ | summary = null |
||
) |
Sets the text in the page. Updates the starttimestamp to the timestamp after the page edit (if the edit is successful)
string | $text | the article text |
string | $section | the section to edit (null for whole page) |
const WikiPage::SECTIONLIST_BY_INDEX = 1 |
const WikiPage::SECTIONLIST_BY_NAME = 2 |
const WikiPage::SECTIONLIST_BY_NUMBER = 3 |