Properties

$_params

$_params : array

Hash containing connection parameters.

Type

array

$_vfs

$_vfs : \VFS

VFS object for storing attachments.

Type

\VFS

Methods

__construct()

__construct(array  $params = array()) 

Constructor.

Parameters

array $params

A hash containing connection parameters.

getVFS()

getVFS() 

Accessor to manage a VFS instance.

Throws

\Wicked_Exception

retrieveByName()

retrieveByName(string  $pagename) 

Retrieves the page of a particular name from the database.

Parameters

string $pagename

The name of the page to retrieve

retrieveHistory()

retrieveHistory(string  $pagename, string  $version) 

Retrieves a historic version of a page.

Parameters

string $pagename

The name of the page to retrieve.

string $version

The version to retrieve.

logPageView()

logPageView(string  $pagename) 

Logs a hit to $pagename.

Parameters

string $pagename

The page that was viewed.

newPage()

newPage(string  $pagename, string  $text) 

Creates a new page.

Parameters

string $pagename

The new page's name.

string $text

The new page's text.

updateText()

updateText(  $pagename,   $text,   $changelog) 

Parameters

$pagename
$text
$changelog

renamePage()

renamePage(  $pagename,   $newname) 

Parameters

$pagename
$newname

getPageId()

getPageId(  $pagename) 

Parameters

$pagename

getPage()

getPage(  $pagename) 

Parameters

$pagename

getPageById()

getPageById(  $id) 

Parameters

$id

getSpecialPages()

getSpecialPages() 

getPages()

getPages(  $special = true) 

Parameters

$special

pageExists()

pageExists(  $pagename) 

Parameters

$pagename

getAllPages()

getAllPages() 

getHistory()

getHistory(  $pagename) 

Parameters

$pagename

getRecentChanges()

getRecentChanges(integer  $days = 3) : array

Returns the most recently changed pages.

Parameters

integer $days

The number of days to look back.

Returns

array —

Pages.

mostRecent()

mostRecent(integer  $limit = 10) : array

Returns the most recently changed pages.

Parameters

integer $limit

The number of most recent pages to return.

Returns

array —

Pages.

mostPopular()

mostPopular(integer  $limit = 10) : array

Returns the most popular pages.

Parameters

integer $limit

The number of most popular pages to return.

Returns

array —

Pages.

leastPopular()

leastPopular(integer  $limit = 10) : array

Returns the least popular pages.

Parameters

integer $limit

The number of least popular pages to return.

Returns

array —

Pages.

searchText()

searchText(string  $searchtext) : array

Finds pages with matches in text or title.

Parameters

string $searchtext

The search expression (Google-like).

Returns

array —

A list of pages

getBackLinks()

getBackLinks(  $pagename) 

Parameters

$pagename

getLikePages()

getLikePages(  $pagename) 

Parameters

$pagename

getAttachedFiles()

getAttachedFiles(string  $pageId, boolean  $allversions = false) : array

Retrieves data on files attached to a page.

Parameters

string $pageId

This is the Id of the page for which we'd like to find attached files.

boolean $allversions

Whether to include all versions. If false or omitted, only the most recent version of each attachment is returned.

Returns

array —

An array of key/value arrays describing the attached files.

attachFile()

attachFile(array  $file, string  $data) 

Attaches a file to a page or update an attachment.

Parameters

array $file

This is a key/value array describing the attachment:

'page_id' =>          This is the id of the page to which we would
like to attach the file.
'attachment_name' =>  This is the filename of the attachment.
'change_log' =>       A change log entry for this attach or update
operation.  (Optional)
'change_author' =>    The user uploading this file.  If not present,
the currently logged-in user is assumed.

string $data

This is the contents of the file to be attached.

Throws

\Wicked_Exception

removeAttachment()

removeAttachment(integer  $pageId, string  $attachment, string  $version = null) 

Remove a single version or all versions of an attachment to $pageId from the VFS backend.

Parameters

integer $pageId

The Id of the page the file is attached to.

string $attachment

The name of the file.

string $version

If specified, the version to delete. If null, then all versions of $attachment will be removed.

Throws

\Wicked_Exception

removeAllAttachments()

removeAllAttachments(integer  $pageId) 

Removes all attachments to $pageId from the VFS backend.

Parameters

integer $pageId

The Id of the page to remove attachments from.

Throws

\Wicked_Exception

getAttachmentContents()

getAttachmentContents(string  $pageId, string  $filename, string  $version) : string

Retrieves the contents of an attachment.

Parameters

string $pageId

This is the name of the page to which the file is attached.

string $filename

This is the name of the attachment.

string $version

This is the version of the attachment.

Throws

\Wicked_Exception

Returns

string —

The file's contents.

removeVersion()

removeVersion(  $pagename,   $version) 

Parameters

$pagename
$version

removeAllVersions()

removeAllVersions(  $pagename) 

Parameters

$pagename

searchTitles()

searchTitles(  $searchtext,   $begin = false) 

Parameters

$searchtext
$begin

getCharset()

getCharset() : string

Returns the charset used by the backend.

Returns

string —

The backend's charset

_attachFile()

_attachFile(array  $file) : boolean

Handles the driver-specific portion of attaching a file.

Wicked_Driver::attachFile() calls down to this method for the driver- specific portion, and then uses VFS to store the attachment.

Parameters

array $file

See Wicked_Driver::attachFile().

Throws

\Wicked_Exception

Returns

boolean —

The new version of the file attached