PHP Класс Wicked_Driver, horde

Автор: Tyler Colbert ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_params array Hash containing connection parameters.
$_vfs VFS VFS object for storing attachments.

Открытые методы

Метод Описание
__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 )

Защищенные методы

Метод Описание
_attachFile ( array $file ) : boolean Handles the driver-specific portion of attaching a file.

Описание методов

__construct() публичный Метод

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

_attachFile() абстрактный защищенный Метод

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().
Результат boolean The new version of the file attached

attachFile() публичный Метод

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 getAllPages ( )

getAttachedFiles() абстрактный публичный Метод

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.
Результат array An array of key/value arrays describing the attached files.

getAttachmentContents() публичный Метод

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.
Результат string The file's contents.

getCharset() публичный Метод

Returns the charset used by the backend.
public getCharset ( ) : string
Результат string The backend's charset

getHistory() абстрактный публичный Метод

abstract public getHistory ( $pagename )

getLikePages() абстрактный публичный Метод

abstract public getLikePages ( $pagename )

getPage() публичный Метод

public getPage ( $pagename )

getPageById() публичный Метод

public getPageById ( $id )

getPageId() публичный Метод

public getPageId ( $pagename )

getPages() публичный Метод

public getPages ( $special = true )

getRecentChanges() абстрактный публичный Метод

Returns the most recently changed pages.
abstract public getRecentChanges ( integer $days = 3 ) : array
$days integer The number of days to look back.
Результат array Pages.

getSpecialPages() публичный Метод

public getSpecialPages ( )

getVFS() публичный Метод

Accessor to manage a VFS instance.
public getVFS ( )

leastPopular() абстрактный публичный Метод

Returns the least popular pages.
abstract public leastPopular ( integer $limit = 10 ) : array
$limit integer The number of least popular pages to return.
Результат array Pages.

logPageView() абстрактный публичный Метод

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

mostPopular() абстрактный публичный Метод

Returns the most popular pages.
abstract public mostPopular ( integer $limit = 10 ) : array
$limit integer The number of most popular pages to return.
Результат array Pages.

mostRecent() абстрактный публичный Метод

Returns the most recently changed pages.
abstract public mostRecent ( integer $limit = 10 ) : array
$limit integer The number of most recent pages to return.
Результат array Pages.

newPage() абстрактный публичный Метод

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 pageExists ( $pagename )

removeAllAttachments() публичный Метод

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 removeAllVersions ( $pagename )

removeAttachment() публичный Метод

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 removeVersion ( $pagename, $version )

renamePage() абстрактный публичный Метод

abstract public renamePage ( $pagename, $newname )

retrieveByName() абстрактный публичный Метод

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() абстрактный публичный Метод

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() абстрактный публичный Метод

Finds pages with matches in text or title.
abstract public searchText ( string $searchtext ) : array
$searchtext string The search expression (Google-like).
Результат array A list of pages

searchTitles() абстрактный публичный Метод

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

updateText() абстрактный публичный Метод

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

Описание свойств

$_params защищенное свойство

Hash containing connection parameters.
protected array $_params
Результат array

$_vfs защищенное свойство

VFS object for storing attachments.
protected VFS $_vfs
Результат VFS