Wicked_Driver defines an API for implementing storage backends for Wicked.
Copyright 2003-2012 Horde LLC (http://www.horde.org/)
See the enclosed file COPYING for license information (GPL). If you
did not receive this file, see http://www.horde.org/licenses/gpl.
Methods summary
public
|
#
__construct( array $params = array() )
Constructor.
Parameters
- $params
- A hash containing connection parameters.
|
public
|
#
getVFS( )
Accessor to manage a VFS instance.
Accessor to manage a VFS instance.
Throws
|
abstract public
|
#
retrieveByName( string $pagename )
Retrieves the page of a particular name from the database.
Retrieves the page of a particular name from the database.
Parameters
- $pagename
- The name of the page to retrieve
|
abstract public
|
#
retrieveHistory( string $pagename, string $version )
Retrieves a historic version of a page.
Retrieves a historic version of a page.
Parameters
- $pagename
- The name of the page to retrieve.
- $version
- The version to retrieve.
|
abstract public
|
#
logPageView( string $pagename )
Logs a hit to $pagename.
Parameters
- $pagename
- The page that was viewed.
|
abstract public
|
#
newPage( string $pagename, string $text )
Creates a new page.
Parameters
- $pagename
- The new page's name.
- $text
- The new page's text.
|
abstract public
|
#
updateText( mixed $pagename, mixed $text, mixed $changelog )
|
abstract public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
abstract public
|
|
abstract public
|
|
abstract public
array
|
#
getRecentChanges( integer $days = 3 )
Returns the most recently changed pages.
Returns the most recently changed pages.
Parameters
- $days
- The number of days to look back.
Returns
array Pages.
|
abstract public
array
|
#
mostPopular( integer $limit = 10 )
Returns the most popular pages.
Returns the most popular pages.
Parameters
- $limit
- The number of most popular pages to return.
Returns
array Pages.
|
abstract public
array
|
#
leastPopular( integer $limit = 10 )
Returns the least popular pages.
Returns the least popular pages.
Parameters
- $limit
- The number of least popular pages to return.
Returns
array Pages.
|
abstract public
array
|
#
searchText( string $searchtext )
Finds pages with matches in text or title.
Finds pages with matches in text or title.
Parameters
- $searchtext
- The search expression (Google-like).
Returns
array A list of pages
|
abstract public
|
|
abstract public
|
|
abstract public
array
|
#
getAttachedFiles( string $pageId, boolean $allversions = false )
Retrieves data on files attached to a page.
Retrieves data on files attached to a page.
Parameters
- $pageId
- <p>This is the Id of the page for which we'd
like to find attached files.</p>
- $allversions
- <p>Whether to include all versions. If false
or omitted, only the most recent version
of each attachment is returned.</p>
Returns
array An array of key/value arrays describing the attached
files.
|
public
|
#
attachFile( array $file, string $data )
Attaches a file to a page or update an attachment.
Attaches a file to a page or update an attachment.
Parameters
- $file
- <p>This is a key/value array describing the
attachment:</p>
<pre><span class="php-quote">'page_id'</span> => This is the id of the page to which we would
like to attach the <span class="php-keyword2">file</span>.
<span class="php-quote">'attachment_name'</span> => This is the filename of the attachment.
<span class="php-quote">'change_log'</span> => A change <span class="php-keyword2">log</span> entry <span class="php-keyword1">for</span> this attach <span class="php-keyword1">or</span> update
operation. (Optional)
<span class="php-quote">'change_author'</span> => The user uploading this <span class="php-keyword2">file</span>. <span class="php-keyword1">If</span> not present,
the currently logged-in user is assumed.</pre>
- $data
- This is the contents of the file to be attached.
Throws
|
public
|
#
removeAttachment( integer $pageId, string $attachment, string $version = null )
Remove a single version or all versions of an attachment to
$pageId from the VFS backend.
Remove a single version or all versions of an attachment to
$pageId from the VFS backend.
Parameters
- $pageId
- The Id of the page the file is attached to.
- $attachment
- The name of the file.
- $version
- <p>If specified, the version to delete. If null,
then all versions of $attachment will be removed.</p>
Throws
|
public
|
#
removeAllAttachments( integer $pageId )
Removes all attachments to $pageId from the VFS backend.
Removes all attachments to $pageId from the VFS backend.
Parameters
- $pageId
- The Id of the page to remove attachments from.
Throws
|
public
string
|
#
getAttachmentContents( string $pageId, string $filename, string $version )
Retrieves the contents of an attachment.
Retrieves the contents of an attachment.
Parameters
- $pageId
- <p>This is the name of the page to which the file
is attached.</p>
- $filename
- This is the name of the attachment.
- $version
- This is the version of the attachment.
Returns
string The file's contents.
Throws
|
abstract public
|
|
public
|
|
abstract public
|
|
public
string
|
#
getCharset( )
Returns the charset used by the backend.
Returns the charset used by the backend.
Returns
string The backend's charset
|