Class Mnemo_Driver_sql

Description

Mnemo storage implementation for PHP's PEAR database abstraction layer.

Required parameters:

      'phptype'       The database type (e.g. 'pgsql', 'mysql', etc.).
      'charset'       The database's internal charset.

Optional values:

      'table'         The name of the memos table in 'database'. Defaults
                      to 'mnemo_memos'

Required by some database implementations:

      'hostspec'      The hostname of the database server.
      'protocol'      The communication protocol ('tcp', 'unix', etc.).
      'database'      The name of the database.
      'username'      The username with which to connect to the database.
      'password'      The password associated with 'username'.
      'options'       Additional options to pass to the database.
      'tty'           The TTY on which to connect to the database.
      'port'          The port on which to connect to the database.

The table structure is defined in scripts/drivers/mnemo_memos.sql.

$Horde: mnemo/lib/Driver/sql.php,v 1.28.2.20 2009/02/17 18:42:26 chuck 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/sql.php (line 37)

Mnemo_Driver
   |
   --Mnemo_Driver_sql
Variable Summary
 DB $_db
 array $_params
Method Summary
 Mnemo_Driver_sql Mnemo_Driver_sql (string $notepad, [array $params = array()])
 string add (string $desc, string $body, [string $category = ''], [string $uid = null], [string $passphrase = null])
 void delete ( $noteId)
 void deleteAll ()
 array get (string $noteId, [string $passphrase = null])
 array getByUID (string $uid, [string $passphrase = null])
 boolean initialize ()
 void modify (string $noteId, string $desc, string $body, [string $category = null], [string $passphrase = null])
 void move (string $noteId, string $newNotepad)
 mixed retrieve ()
 void _buildNote ( $row, [ $passphrase = null])
Variables
DB $_db (line 51)

The database connection object.

array $_params = array() (line 44)

Hash containing connection parameters.

DB $_write_db (line 59)

Handle for the current database connection, used for writing. Defaults to the same handle as $_db if a separate write database is not required.

Inherited Variables

Inherited from Mnemo_Driver

Mnemo_Driver::$_errormsg
Mnemo_Driver::$_memos
Mnemo_Driver::$_notepad
Mnemo_Driver::$_pgp
Methods
Constructor Mnemo_Driver_sql (line 67)

Construct a new SQL storage object.

Mnemo_Driver_sql Mnemo_Driver_sql (string $notepad, [array $params = array()])
  • string $notepad: The name of the notepad to load/save notes from.
  • array $params: A hash containing connection parameters.
add (line 217)

Add a note to the backend storage.

  • return: The unique ID of the new note.
string add (string $desc, string $body, [string $category = ''], [string $uid = null], [string $passphrase = null])
  • string $desc: The first line of the note.
  • string $body: The whole note body.
  • string $category: The category of the note.
  • string $uid: A Unique Identifier for the note.
  • string $passphrase: The passphrase to encrypt the note with.
delete (line 354)
void delete ( $noteId)
  • $noteId
deleteAll (line 384)
void deleteAll ()
get (line 151)

Retrieve one note from the database.

  • return: The array of note attributes.
array get (string $noteId, [string $passphrase = null])
  • string $noteId: The ID of the note to retrieve.
  • string $passphrase: A passphrase with which this note was supposed to be encrypted.
getByUID (line 181)

Retrieve one note from the database by UID.

  • return: The array of note attributes.
array getByUID (string $uid, [string $passphrase = null])
  • string $uid: The UID of the note to retrieve.
  • string $passphrase: A passphrase with which this note was supposed to be encrypted.
initialize (line 78)

Attempts to open a connection to the SQL server.

  • return: True on success, PEAR_Error on failure.
boolean initialize ()
modify (line 272)

Modify an existing note.

void modify (string $noteId, string $desc, string $body, [string $category = null], [string $passphrase = null])
  • string $noteId: The note to modify.
  • string $desc: The description (long) of the note.
  • string $body: The description (long) of the note.
  • string $category: The category of the note.
  • string $passphrase: The passphrase to encrypt the note with.
move (line 323)

Move a note to a new notepad.

void move (string $noteId, string $newNotepad)
  • string $noteId: The note to move.
  • string $newNotepad: The new notepad.
retrieve (line 406)

Retrieves all of the notes from $this->_notepad from the database.

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

Redefinition of:
Mnemo_Driver::retrieve()
Retrieves notes from the database.
_buildNote (line 435)
void _buildNote ( $row, [ $passphrase = null])
  • $row
  • $passphrase

Inherited Methods

Inherited From Mnemo_Driver

 Mnemo_Driver::Mnemo_Driver()
 Mnemo_Driver::decrypt()
 Mnemo_Driver::encrypt()
 Mnemo_Driver::encryptionSupported()
 Mnemo_Driver::factory()
 Mnemo_Driver::fromiCalendar()
 Mnemo_Driver::generateUID()
 Mnemo_Driver::getMemoDescription()
 Mnemo_Driver::listMemos()
 Mnemo_Driver::loadPGP()
 Mnemo_Driver::requireSecureConnection()
 Mnemo_Driver::retrieve()
 Mnemo_Driver::singleton()
 Mnemo_Driver::toiCalendar()

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