DBA
[ class tree: DBA ] [ index: DBA ] [ all elements ]

Class: DBA

Source Location: /DBA-1.1.1/DBA.php

Class Overview

PEAR
   |
   --DBA

DBA is a set of classes for handling and extending Berkeley DB style databases. It works around some of the quirks in the built-in dba functions in PHP (e.g. gdbm does not support dba_replace), has a file-based dbm engine for installations where dba support is not included in PHP.


Author(s):

Version:

  • 1.0

Methods


Child classes:

DBA_Driver_Builtin
DBA_Driver_Builtin uses the builtin dba functions of PHP as the underlying driver for a DBA class. Depending on the driver, this can be faster or slower than the DBA_Driver_File class.
DBA_Driver_File
DBA_Driver_File provides a simple, file-based implementation of a

Inherited Variables

Inherited Methods


Class Details

[line 61]
DBA is a set of classes for handling and extending Berkeley DB style databases. It works around some of the quirks in the built-in dba functions in PHP (e.g. gdbm does not support dba_replace), has a file-based dbm engine for installations where dba support is not included in PHP.


[ Top ]


Method Detail

DBA (Constructor)   [line 66]

DBA DBA( )

Default constructor

[ Top ]

create   [line 79]

object DBA &create( [string $driver = 'file'])

Creates a new DBA object
  • Return: storage object, returned by reference

Overridden in child classes as:

DBA_Driver_Builtin::create()
Creates a new database file if one does not exist. If it already exists, updates the last-updated timestamp on the database
DBA_Driver_File::create()
Creates a new database file if one does not exist. If it already exists, updates the last-updated timestamp on the database

Parameters:

string   $driver   —  type of storage object to return

[ Top ]

db_drop   [line 100]

object DBA db_drop( $name, [string $driver = 'file'])

Deletes a DBA database from the filesystem
  • Return: storage object, returned by reference

Overridden in child classes as:

DBA_Driver_Builtin::db_drop()
Removes a database from existence
DBA_Driver_File::db_drop()
Removes a database from existence

Parameters:

string   $driver   —  type of storage object to return
   $name   — 

[ Top ]

db_exists   [line 203]

boolean db_exists( string $name, [string $driver = 'file'])

Returns whether a database exists
  • Return: true if the database exists

Overridden in child classes as:

DBA_Driver_Builtin::db_exists()
Indicates whether a database with given name exists
DBA_Driver_File::db_exists()
Indicates whether a database with given name exists

Parameters:

string   $name   —  name of the database to find
string   $driver   —  @driver driver to test for

[ Top ]

errorMessage   [line 135]

string errorMessage( int $value)

Return a textual error message for a DBA error code
  • Return: error message, or false if the error code was not recognized
  • Access: public

Parameters:

int   $value   —  error code

[ Top ]

getDriverList   [line 222]

array getDriverList( )

Returns an array of the currently supported drivers

[ Top ]

isError   [line 121]

boolean isError( int $value)

Returns whether a result code from a DBA method is an error
  • Return: whether $value is a DBA_Error
  • Access: public

Parameters:

int   $value   —  result code

[ Top ]

raiseError   [line 184]

object a &raiseError( [mixed $code = DBA_ERROR], [int $mode = NULL], [mixed $options = NULL], [string $userinfo = NULL])

This method is used to communicate an error and invoke error callbacks etc. Basically a wrapper for PEAR::raiseError without the message string.
  • Return: PEAR error object
  • See: PEAR_Error
  • Access: public

Parameters:

mixed   $code   —  integer error code, or a PEAR error object (all other parameters are ignored if this parameter is an object
int   $mode   —  error mode, see PEAR_Error docs
mixed   $options   —  If error mode is PEAR_ERROR_TRIGGER, this is the error level (E_USER_NOTICE etc). If error mode is PEAR_ERROR_CALLBACK, this is the callback function, either as a function name, or as an array of an object and method name. For other error modes this parameter is ignored.
string   $userinfo   —  Extra debug information.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:59:54 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.