PHP Class Wicked_Driver, horde

Author: Tyler Colbert ([email protected])
显示文件 Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_params array Hash containing connection parameters.
$_vfs VFS VFS object for storing attachments.

Public Methods

Method Description
__construct ( array $params = [] ) Constructor.
attachFile ( array $file, string $data ) Attaches a file to a page or update an attachment.
getAllPages ( )
getAttachedFiles ( string $pageId, boolean $allversions = false ) : array Retrieves data on files attached to a page.
getAttachmentContents ( string $pageId, string $filename, string $version ) : string Retrieves the contents of an attachment.
getBackLinks ( $pagename )
getCharset ( ) : string Returns the charset used by the backend.
getHistory ( $pagename )
getLikePages ( $pagename )
getPage ( $pagename )
getPageById ( $id )
getPageId ( $pagename )
getPages ( $special = true )
getRecentChanges ( integer $days = 3 ) : array Returns the most recently changed pages.
getSpecialPages ( )
getVFS ( ) Accessor to manage a VFS instance.
leastPopular ( integer $limit = 10 ) : array Returns the least popular pages.
logPageView ( string $pagename ) Logs a hit to $pagename.
mostPopular ( integer $limit = 10 ) : array Returns the most popular pages.
mostRecent ( integer $limit = 10 ) : array Returns the most recently changed pages.
newPage ( string $pagename, string $text ) Creates a new page.
pageExists ( $pagename )
removeAllAttachments ( integer $pageId ) Removes all attachments to $pageId from the VFS backend.
removeAllVersions ( $pagename )
removeAttachment ( integer $pageId, string $attachment, string $version = null ) Remove a single version or all versions of an attachment to $pageId from the VFS backend.
removeVersion ( $pagename, $version )
renamePage ( $pagename, $newname )
retrieveByName ( string $pagename ) Retrieves the page of a particular name from the database.
retrieveHistory ( string $pagename, string $version ) Retrieves a historic version of a page.
searchText ( string $searchtext ) : array Finds pages with matches in text or title.
searchTitles ( $searchtext, $begin = false )
updateText ( $pagename, $text, $changelog )

Protected Methods

Method Description
_attachFile ( array $file ) : boolean Handles the driver-specific portion of attaching a file.

Method Details

__construct() public method

Constructor.
public __construct ( array $params = [] )
$params array A hash containing connection parameters.

_attachFile() abstract protected method

Wicked_Driver::attachFile() calls down to this method for the driver- specific portion, and then uses VFS to store the attachment.
abstract protected _attachFile ( array $file ) : boolean
$file array See Wicked_Driver::attachFile().
return boolean The new version of the file attached

attachFile() public method

Attaches a file to a page or update an attachment.
public attachFile ( array $file, string $data )
$file array 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.
$data string This is the contents of the file to be attached.

getAllPages() abstract public method

abstract public getAllPages ( )

getAttachedFiles() abstract public method

Retrieves data on files attached to a page.
abstract public getAttachedFiles ( string $pageId, boolean $allversions = false ) : array
$pageId string This is the Id of the page for which we'd like to find attached files.
$allversions boolean Whether to include all versions. If false or omitted, only the most recent version of each attachment is returned.
return array An array of key/value arrays describing the attached files.

getAttachmentContents() public method

Retrieves the contents of an attachment.
public getAttachmentContents ( string $pageId, string $filename, string $version ) : string
$pageId string This is the name of the page to which the file is attached.
$filename string This is the name of the attachment.
$version string This is the version of the attachment.
return string The file's contents.

getCharset() public method

Returns the charset used by the backend.
public getCharset ( ) : string
return string The backend's charset

getHistory() abstract public method

abstract public getHistory ( $pagename )

getLikePages() abstract public method

abstract public getLikePages ( $pagename )

getPage() public method

public getPage ( $pagename )

getPageById() public method

public getPageById ( $id )

getPageId() public method

public getPageId ( $pagename )

getPages() public method

public getPages ( $special = true )

getRecentChanges() abstract public method

Returns the most recently changed pages.
abstract public getRecentChanges ( integer $days = 3 ) : array
$days integer The number of days to look back.
return array Pages.

getSpecialPages() public method

public getSpecialPages ( )

getVFS() public method

Accessor to manage a VFS instance.
public getVFS ( )

leastPopular() abstract public method

Returns the least popular pages.
abstract public leastPopular ( integer $limit = 10 ) : array
$limit integer The number of least popular pages to return.
return array Pages.

logPageView() abstract public method

Logs a hit to $pagename.
abstract public logPageView ( string $pagename )
$pagename string The page that was viewed.

mostPopular() abstract public method

Returns the most popular pages.
abstract public mostPopular ( integer $limit = 10 ) : array
$limit integer The number of most popular pages to return.
return array Pages.

mostRecent() abstract public method

Returns the most recently changed pages.
abstract public mostRecent ( integer $limit = 10 ) : array
$limit integer The number of most recent pages to return.
return array Pages.

newPage() abstract public method

Creates a new page.
abstract public newPage ( string $pagename, string $text )
$pagename string The new page's name.
$text string The new page's text.

pageExists() public method

public pageExists ( $pagename )

removeAllAttachments() public method

Removes all attachments to $pageId from the VFS backend.
public removeAllAttachments ( integer $pageId )
$pageId integer The Id of the page to remove attachments from.

removeAllVersions() public method

public removeAllVersions ( $pagename )

removeAttachment() public method

Remove a single version or all versions of an attachment to $pageId from the VFS backend.
public removeAttachment ( integer $pageId, string $attachment, string $version = null )
$pageId integer The Id of the page the file is attached to.
$attachment string The name of the file.
$version string If specified, the version to delete. If null, then all versions of $attachment will be removed.

removeVersion() abstract public method

abstract public removeVersion ( $pagename, $version )

renamePage() abstract public method

abstract public renamePage ( $pagename, $newname )

retrieveByName() abstract public method

Retrieves the page of a particular name from the database.
abstract public retrieveByName ( string $pagename )
$pagename string The name of the page to retrieve

retrieveHistory() abstract public method

Retrieves a historic version of a page.
abstract public retrieveHistory ( string $pagename, string $version )
$pagename string The name of the page to retrieve.
$version string The version to retrieve.

searchText() abstract public method

Finds pages with matches in text or title.
abstract public searchText ( string $searchtext ) : array
$searchtext string The search expression (Google-like).
return array A list of pages

searchTitles() abstract public method

abstract public searchTitles ( $searchtext, $begin = false )

updateText() abstract public method

abstract public updateText ( $pagename, $text, $changelog )

Property Details

$_params protected_oe property

Hash containing connection parameters.
protected array $_params
return array

$_vfs protected_oe property

VFS object for storing attachments.
protected VFS $_vfs
return VFS