Class Wicked_Driver

Description

Wicked_Driver:: defines an API for implementing storage backends for Wicked.

$Horde: wicked/lib/Driver.php,v 1.64.2.2 2009/11/13 13:15:22 jan Exp $

Copyright 2003-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.fsf.org/copyleft/gpl.html.

Located in /lib/Driver.php (line 30)


	
			
Direct descendents
Class Description
 class Wicked_Driver_sql Wicked storage implementation for PHP's PEAR database abstraction layer.
Variable Summary
 array $_params
 VFS $_vfs
Method Summary
 Wicked_Driver Wicked_Driver ([array $params = array()])
 boolean attachFile (array $file, string $data)
 mixed factory ([string $driver = null], [array $params = null])
 void getAllPages ()
 mixed getAttachedFiles (string $pageId, [boolean $allversions = false])
 string getAttachmentContents (string $pageId, string $filename, string $version)
 void getBackLinks ( $pagename)
 string getCharset ()
 void getHistory ( $pagename)
 void getLikePages ( $pagename)
 void getPage ( $pagename)
 void getPageById ( $id)
 void getPageId ( $pagename)
 void getPages ([ $special = true])
 mixed getRecentChanges ([integer $days = 3])
 void getSpecialPages ()
 void &getVFS ()
 mixed leastPopular ([integer $limit = 10])
 boolean logPageView (string $pagename)
 mixed mostPopular ([integer $limit = 10])
 mixed newPage (string $pagename, string $text)
 void pageExists ( $pagename)
 boolean|PEAR_Error removeAllAttachments (integer $pageId)
 void removeAllVersions ( $pagename)
 boolean|PEAR_Error removeAttachment (integer $pageId, string $attachment, [string $version = null])
 void removeVersion ( $pagename,  $version)
 void renamePage ( $pagename,  $newname)
 boolean retrieveByName (string $pagename)
 array retrieveHistory (string $pagename, string $version)
 array searchText (string $searchtext)
 void searchTitles ( $searchtext)
 void updateText ( $pagename,  $text,  $changelog,  $minorchange)
 boolean _attachFile (array $file)
Variables
array $_params = array() (line 37)

Hash containing connection parameters.

VFS $_vfs (line 44)

VFS object for storing attachments.

Methods
Constructor Wicked_Driver (line 51)

Constructs a new Wicked driver object.

Wicked_Driver Wicked_Driver ([array $params = array()])
  • array $params: A hash containing connection parameters.
attachFile (line 295)

Attaches a file to a page or update an attachment.

  • return: True or PEAR_Error:: instance on failure.
boolean attachFile (array $file, string $data)
  • 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.
       'minor' =>            This is a boolean which indicates whether this
                             is a minor version update.
       '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.
factory (line 460)

Attempts to return a concrete Wicked_Driver instance based on $driver.

  • return: The newly created concrete Wicked_Driver instance, or false on an error.
mixed factory ([string $driver = null], [array $params = null])
  • string $driver: The type of the concrete Wicked_Driver subclass to return.
  • array $params: A hash containing any additional configuration or connection parameters a subclass might need.
getAllPages (line 185)
void getAllPages ()

Redefined in descendants as:
getAttachedFiles (line 272)

Retrieves data on files attached to a page.

  • return: An array of key/value arrays describing the attached files or a PEAR_Error:: instance on failure.
  • abstract:
mixed getAttachedFiles (string $pageId, [boolean $allversions = false])
  • 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.

Redefined in descendants as:
getAttachmentContents (line 407)

Retrieves the contents of an attachment.

  • return: The file's contents or a PEAR_Error on error.
string getAttachmentContents (string $pageId, string $filename, string $version)
  • 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.
getBackLinks (line 249)
void getBackLinks ( $pagename)
  • $pagename

Redefined in descendants as:
getCharset (line 444)

Returns the charset used by the backend.

  • return: The backend's charset
string getCharset ()

Redefined in descendants as:
getHistory (line 190)
void getHistory ( $pagename)
  • $pagename

Redefined in descendants as:
getLikePages (line 254)
void getLikePages ( $pagename)
  • $pagename

Redefined in descendants as:
getPage (line 142)
void getPage ( $pagename)
  • $pagename

Redefined in descendants as:
getPageById (line 147)
void getPageById ( $id)
  • $id

Redefined in descendants as:
getPageId (line 132)
void getPageId ( $pagename)
  • $pagename
getPages (line 175)
void getPages ([ $special = true])
  • $special

Redefined in descendants as:
getRecentChanges (line 202)

Returns the most recently changed pages.

  • return: An array of pages, or PEAR_Error on failure.
mixed getRecentChanges ([integer $days = 3])
  • integer $days: The number of days to look back.

Redefined in descendants as:
getSpecialPages (line 152)
void getSpecialPages ()
getVFS (line 59)

Accessor to manage a VFS instance.

void &getVFS ()
leastPopular (line 230)

Returns the least popular pages.

  • return: An array of pages, or PEAR_Error on failure.
  • abstract:
mixed leastPopular ([integer $limit = 10])
  • integer $limit: The number of least popular pages to return.

Redefined in descendants as:
logPageView (line 102)

Logs a hit to $pagename.

  • return: True or PEAR_Error on failure.
boolean logPageView (string $pagename)
  • string $pagename: The page that was viewed.

Redefined in descendants as:
mostPopular (line 216)

Returns the most popular pages.

  • return: An array of pages, or PEAR_Error on failure.
  • abstract:
mixed mostPopular ([integer $limit = 10])
  • integer $limit: The number of most popular pages to return.

Redefined in descendants as:
newPage (line 117)

Creates a new page.

  • return: True, or PEAR_Error on failure.
  • abstract:
mixed newPage (string $pagename, string $text)
  • string $pagename: The new page's name.
  • string $text: The new page's text.

Redefined in descendants as:
pageExists (line 180)
void pageExists ( $pagename)
  • $pagename
removeAllAttachments (line 364)

Removes all attachments to $pageId from the VFS backend.

  • return: Either true or a PEAR_Error describing failure.
boolean|PEAR_Error removeAllAttachments (integer $pageId)
  • integer $pageId: The Id of the page to remove attachments from.

Redefined in descendants as:
removeAllVersions (line 423)
void removeAllVersions ( $pagename)
  • $pagename

Redefined in descendants as:
removeAttachment (line 328)

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

  • return: Either true or a PEAR_Error describing failure.
boolean|PEAR_Error removeAttachment (integer $pageId, string $attachment, [string $version = null])
  • 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.

Redefined in descendants as:
removeVersion (line 418)
void removeVersion ( $pagename,  $version)
  • $pagename
  • $version

Redefined in descendants as:
renamePage (line 127)
void renamePage ( $pagename,  $newname)
  • $pagename
  • $newname

Redefined in descendants as:
retrieveByName (line 76)

Retrieves the page of a particular name from the database.

  • return: True on success, PEAR_Error on failure.
boolean retrieveByName (string $pagename)
  • string $pagename: The name of the page to retrieve

Redefined in descendants as:
retrieveHistory (line 90)

Retrieves a historic version of a page.

  • return: The page hash, or PEAR_Error on failure.
  • abstract:
array retrieveHistory (string $pagename, string $version)
  • string $pagename: The name of the page to retrieve.
  • string $version: The version to retrieve.

Redefined in descendants as:
searchText (line 244)

Finds pages with matches in text or title.

  • return: A list of pages, or PEAR_Error on failure.
  • abstract:
array searchText (string $searchtext)
  • string $searchtext: The search expression (Google-like).

Redefined in descendants as:
searchTitles (line 434)
void searchTitles ( $searchtext)
  • $searchtext

Redefined in descendants as:
updateText (line 122)
void updateText ( $pagename,  $text,  $changelog,  $minorchange)
  • $pagename
  • $text
  • $changelog
  • $minorchange

Redefined in descendants as:
_attachFile (line 392)

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.

  • return: The new version of the file attached, or a PEAR_Error:: instance on failure.
  • abstract:
  • access: protected
boolean _attachFile (array $file)
  • array $file: See Wicked_Driver::attachFile().

Redefined in descendants as:

Documentation generated on Sun, 30 Jan 2011 05:42:55 +0000 by phpDocumentor 1.4.3