\Wicked_Api

Wicked external API interface.

This file defines Wicked's external API interface. Other applications can interact with Wicked through this API.

Summary

Methods
Properties
Constants
listPages()
getPageInfo()
getMultiplePageInfo()
getPageHistory()
pageExists()
display()
renderPage()
edit()
listTemplates()
getTemplate()
getPageSource()
saveTemplate()
getRecentChanges()
No public properties found
No constants found
No protected methods found
$_links
N/A
No private methods found
No private properties found
N/A

Properties

$_links

$_links : array

Links.

Type

array

Methods

listPages()

listPages(boolean  $special = true, boolean  $no_cache = false) : array

Returns a list of available pages.

Parameters

boolean $special

Include special pages

boolean $no_cache

Always retreive pages from backed

Returns

array —

An array of all available pages.

getPageInfo()

getPageInfo(string  $pagename) : array

Return basic page information.

Parameters

string $pagename

Page name

Throws

\Wicked_Exception

Returns

array —

An array of page parameters.

getMultiplePageInfo()

getMultiplePageInfo(array  $pagenames = array()) : array

Return basic information for multiple pages.

Parameters

array $pagenames

Page names

Throws

\Wicked_Exception

Returns

array —

An array of arrays of page parameters.

getPageHistory()

getPageHistory(string  $pagename) : array

Return page history.

Parameters

string $pagename

Page name

Throws

\Wicked_Exception

Returns

array —

An array of page parameters.

pageExists()

pageExists(string  $pagename) : boolean

Chech if a page exists

Parameters

string $pagename

Page name

Returns

boolean

display()

display(string  $pagename) : array

Returns a rendered wiki page.

Parameters

string $pagename

Page to display

Throws

\Wicked_Exception

Returns

array —

Page without CSS link

renderPage()

renderPage(string  $pagename, string  $format = 'Plain') : array

Returns a rendered wiki page.

Parameters

string $pagename

Page to display

string $format

Format to render page to (Plain, XHtml)

Throws

\Wicked_Exception

Returns

array —

Rendered page

edit()

edit(string  $pagename, string  $text, string  $changelog = '') 

Updates content of a wiki page. If the page does not exist it is created.

Parameters

string $pagename

Page to edit

string $text

Page content

string $changelog

Description of the change

Throws

\Wicked_Exception

listTemplates()

listTemplates() : \arrary

Get a list of templates provided by Wicked. A template is any page whose name begins with "Template"

Throws

\Wicked_Exception

Returns

\arrary —

Array on success.

getTemplate()

getTemplate(string  $name) : string

Get a template specified by its name. This is effectively an alias for getPageSource() since Wicked templates are also normal pages.

Wicked templates are pages that include "Template" at the beginning of the name.

Parameters

string $name

The name of the template to fetch

Throws

\Wicked_Exception

Returns

string —

Template data.

getPageSource()

getPageSource(  $pagename, string  $version = null) : string

Get the wiki source of a page specified by its name.

Parameters

$pagename
string $version

Page version

Throws

\Wicked_Exception

Returns

string —

Page data.

saveTemplate()

saveTemplate(string  $name, string  $data) 

Process a completed template to update the named Wiki page. This method is basically a passthrough to edit().

Parameters

string $name

Name of the new or modified page

string $data

Text content of the populated template

Throws

\Wicked_Exception

getRecentChanges()

getRecentChanges(integer  $days = 3) : array

Returns the most recently changed pages.

Parameters

integer $days

The number of days to look back.

Throws

\Wicked_Exception

Returns

array —

Pages.