Class Mnemo_Driver

Description

Mnemo_Driver:: defines an API for implementing storage backends for Mnemo.

$Horde: mnemo/lib/Driver.php,v 1.25.2.14 2009/01/06 15:24:58 jan Exp $

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

See the enclosed file LICENSE for license information (ASL). If you did not receive this file, see http://www.horde.org/licenses/asl.php.

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


	
			
Direct descendents
Class Description
 class Mnemo_Driver_kolab Horde Mnemo driver for the Kolab IMAP server.
 class Mnemo_Driver_sql Mnemo storage implementation for PHP's PEAR database abstraction layer.
Variable Summary
 string $_errormsg
 array $_memos
 string $_notepad
 Horde_Crypt_pgp $_pgp
Method Summary
 Mnemo_Driver Mnemo_Driver ([ $errormsg = null])
 string|PEAR_Error decrypt (string $note, string $passphrase)
 string|PEAR_Error encrypt (string $note, string $passphrase)
 boolean encryptionSupported ()
 mixed &factory ([string $notepad = ''], [string $driver = null], [array $params = null])
 array fromiCalendar ( $vNote, Horde_iCalendar_vnote $vnote)
 string generateUID ()
 void getMemoDescription ( $body, integer $memo_id)
 array listMemos ()
 void loadPGP ()
 PEAR_Error requireSecureConnection ()
 mixed retrieve ()
 mixed &singleton ([string $notepad = ''], [string $driver = null], [array $params = null])
 object Horde_iCalendar_vnote toiCalendar (array $memo, object vcal &$calendar)
Variables
string $_errormsg (line 45)

An error message to throw when something is wrong.

array $_memos = array() (line 24)

Array holding the current memo list. Each array entry is a hash describing a memo. The array is indexed numerically by memo ID.

string $_notepad = '' (line 31)

String containing the current notepad name.

Horde_Crypt_pgp $_pgp (line 38)

Crypting processor.

Methods
Constructor Mnemo_Driver (line 50)

Constructor - All real work is done by initialize().

Mnemo_Driver Mnemo_Driver ([ $errormsg = null])
  • $errormsg
decrypt (line 152)

Decrypts a note.

  • return: The decrypted text or PEAR_Error on failure.
string|PEAR_Error decrypt (string $note, string $passphrase)
  • string $note: The encrypted note text.
  • string $passphrase: The passphrase to decrypt the note with.
encrypt (line 135)

Encrypts a note.

  • return: The encrypted text or PEAR_Error on failure.
string|PEAR_Error encrypt (string $note, string $passphrase)
  • string $note: The note text.
  • string $passphrase: The passphrase to encrypt the note with.
encryptionSupported (line 184)

Returns whether note encryption is supported.

Checks if PGP support could be loaded, if it supports symmetric encryption, and if we have a secure connection.

  • return: Whether encryption is suppoted.
boolean encryptionSupported ()
factory (line 209)

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

  • return: The newly created concrete Mnemo_Driver instance, or dummy instance containing an error message.
mixed &factory ([string $notepad = ''], [string $driver = null], [array $params = null])
  • string $notepad: The name of the current notepad.
  • string $driver: The type of concrete Mnemo_Driver subclass to return. The is based on the storage driver ($driver). The code is dynamically included.
  • array $params: (optional) A hash containing any additional configuration or connection parameters a subclass might need.
fromiCalendar (line 337)

Create a memo (hash array) from a Horde_iCalendar_vnote object.

  • return: Memo (hash array) created from the vNote.
array fromiCalendar ( $vNote, Horde_iCalendar_vnote $vnote)
  • Horde_iCalendar_vnote $vnote: The iCalendar data to update from.
  • $vNote
generateUID (line 77)

Generate a universal / unique identifier for a task. This is NOT something that we expect to be able to parse into a tasklist and a taskId.

  • return: A nice unique string (should be 255 chars or less).
string generateUID ()
getMemoDescription (line 89)

Update the description (short summary) of a memo.

void getMemoDescription ( $body, integer $memo_id)
  • integer $memo_id: The memo to update.
  • $body
listMemos (line 65)

Lists memos based on the given criteria. All memos will be returned by default.

  • return: Returns a list of the requested memos.
array listMemos ()
loadPGP (line 115)

Loads the PGP encryption driver.

void loadPGP ()
requireSecureConnection (line 167)

Returns an error message if we are not using a secure connection.

  • return: Returns a PEAR_Error object if there is no secure connection.
PEAR_Error requireSecureConnection ()
retrieve (line 363)

Retrieves notes from the database.

  • return: True on success, PEAR_Error on failure.
mixed retrieve ()

Redefined in descendants as:
singleton (line 261)

Attempts to return a reference to a concrete Mnemo_Driver instance based on $driver.

It will only create a new instance if no Mnemo_Driver instance with the same parameters currently exists.

This should be used if multiple storage sources are required.

This method must be invoked as: $var = &Mnemo_Driver::singleton()

  • return: The created concrete Mnemo_Driver instance, or false on error.
mixed &singleton ([string $notepad = ''], [string $driver = null], [array $params = null])
  • string $notepad: The name of the current notepad.
  • string $driver: The type of concrete Mnemo_Driver subclass to return. The is based on the storage driver ($driver). The code is dynamically included.
  • array $params: (optional) A hash containing any additional configuration or connection parameters a subclass might need.
toiCalendar (line 289)

Export this memo in iCalendar format.

  • return: object for this event.
object Horde_iCalendar_vnote toiCalendar (array $memo, object vcal &$calendar)
  • array $memo: memo the memo (hash array) to export
  • object vcal &$calendar: a Horde_iCalendar object that acts as container.

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