ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
|
Public Member Functions | |
setOptions (&$db, $options) | |
set option array in an exiting database object More... | |
loadClass ($class_name, $debug) | |
Loads a PEAR class. More... | |
& | factory ($dsn, $options=false) |
Create a new MDB2 object for the specified database type. More... | |
& | connect ($dsn, $options=false) |
Create a new MDB2 connection object and connect to the specified database. More... | |
& | singleton ($dsn=null, $options=false) |
Returns a MDB2 connection with the requested DSN. More... | |
loadFile ($file) | |
load a file (like 'Date') More... | |
apiVersion () | |
Return the MDB2 API version. More... | |
& | raiseError ($code=null, $mode=null, $options=null, $userinfo=null) |
This method is used to communicate an error and invoke error callbacks etc. More... | |
isError ($data, $code=null) | |
Tell whether a value is a MDB2 error. More... | |
isConnection ($value) | |
Tell whether a value is a MDB2 connection. More... | |
isResult ($value) | |
Tell whether a value is a MDB2 result. More... | |
isResultCommon ($value) | |
Tell whether a value is a MDB2 result implementing the common interface. More... | |
isStatement ($value) | |
Tell whether a value is a MDB2 statement interface. More... | |
errorMessage ($value=null) | |
Return a textual error message for a MDB2 error code. More... | |
parseDSN ($dsn) | |
fileExists ($file) | |
Checks if a file exists in the include path. More... | |
Static Public Member Functions | |
classExists ($classname) | |
Checks if a class exists without triggering __autoload. More... | |
MDB2::apiVersion | ( | ) |
|
static |
Checks if a class exists without triggering __autoload.
string | classname |
Definition at line 309 of file MDB2.php.
Referenced by MDB2_Driver_Common\_wrapResult(), loadClass(), and MDB2_Driver_Common\loadModule().
& MDB2::connect | ( | $dsn, | |
$options = false |
|||
) |
Create a new MDB2 connection object and connect to the specified database.
IMPORTANT: In order for MDB2 to work properly it is necessary that you make sure that you work with a reference of the original object instead of a copy (this is a PHP4 quirk).
For example: $db =& MDB2::connect($dsn); ^^ And not: $db = MDB2::connect($dsn); ^^
mixed | 'data source name', see the MDB2::parseDSN method for a description of the dsn format. Can also be specified as an array of the format returned by MDB2::parseDSN. |
array | An associative array of option names and their values. |
public
Definition at line 436 of file MDB2.php.
References $options, factory(), and PEAR\isError().
Referenced by ilDB\connectHost(), ilDBOracle\doConnect(), ilDB\doConnect(), ilDBMySQL\doConnect(), and MDB2_Driver_Common\getConnection().
MDB2::errorMessage | ( | $value = null | ) |
Return a textual error message for a MDB2 error code.
int|array | integer error code, null to get the current error code-message map, or an array with a new error code-message map |
public
Definition at line 697 of file MDB2.php.
References array, PEAR\isError(), MDB2_ERROR, MDB2_ERROR_ACCESS_VIOLATION, MDB2_ERROR_ALREADY_EXISTS, MDB2_ERROR_CANNOT_ALTER, MDB2_ERROR_CANNOT_CREATE, MDB2_ERROR_CANNOT_DELETE, MDB2_ERROR_CANNOT_DROP, MDB2_ERROR_CANNOT_REPLACE, MDB2_ERROR_CONNECT_FAILED, MDB2_ERROR_CONSTRAINT, MDB2_ERROR_CONSTRAINT_NOT_NULL, MDB2_ERROR_DEADLOCK, MDB2_ERROR_DIVZERO, MDB2_ERROR_EXTENSION_NOT_FOUND, MDB2_ERROR_INVALID, MDB2_ERROR_INVALID_DATE, MDB2_ERROR_INVALID_DSN, MDB2_ERROR_INVALID_NUMBER, MDB2_ERROR_LOADMODULE, MDB2_ERROR_MISMATCH, MDB2_ERROR_NEED_MORE_DATA, MDB2_ERROR_NODBSELECTED, MDB2_ERROR_NOSUCHDB, MDB2_ERROR_NOSUCHFIELD, MDB2_ERROR_NOSUCHTABLE, MDB2_ERROR_NOT_CAPABLE, MDB2_ERROR_NOT_FOUND, MDB2_ERROR_NOT_LOCKED, MDB2_ERROR_SYNTAX, MDB2_ERROR_TRUNCATED, MDB2_ERROR_UNSUPPORTED, MDB2_ERROR_VALUE_COUNT_ON_ROW, and MDB2_OK.
Referenced by MDB2_Error\__construct().
& MDB2::factory | ( | $dsn, | |
$options = false |
|||
) |
Create a new MDB2 object for the specified database type.
IMPORTANT: In order for MDB2 to work properly it is necessary that you make sure that you work with a reference of the original object instead of a copy (this is a PHP4 quirk).
For example: $db =& MDB2::factory($dsn); ^^ And not: $db = MDB2::factory($dsn);
mixed | 'data source name', see the MDB2::parseDSN method for a description of the dsn format. Can also be specified as an array of the format returned by MDB2::parseDSN. |
array | An associative array of option names and their values. |
public
Definition at line 379 of file MDB2.php.
References $options, PEAR\isError(), loadClass(), MDB2_ERROR_NOT_FOUND, parseDSN(), raiseError(), and setOptions().
Referenced by connect(), and singleton().
MDB2::fileExists | ( | $file | ) |
Checks if a file exists in the include path.
string | filename |
public
Definition at line 926 of file MDB2.php.
References $file.
Referenced by loadClass(), loadFile(), and MDB2_Driver_Common\loadModule().
MDB2::isConnection | ( | $value | ) |
MDB2::isError | ( | $data, | |
$code = null |
|||
) |
Tell whether a value is a MDB2 error.
mixed | the value to test |
int | if is an error object, return true only if $code is a string and $db->getMessage() == $code or $code is an integer and $db->getCode() == $code |
public
Definition at line 599 of file MDB2.php.
References $code, $data, and array.
Referenced by ilClient\checkDatabaseExists(), ilDB\connect(), ilDB\connectHost(), MDB2_Result_Common\execute(), ilDBOracle\getDBVersion(), ilDB\getLastInsertId(), ilDB\getOne(), ilDB\handleError(), ilDB\isDbError(), ilDB\listSequences(), ilDB\listTables(), and ilDB\tableColumnExists().
MDB2::isResult | ( | $value | ) |
MDB2::isResultCommon | ( | $value | ) |
Tell whether a value is a MDB2 result implementing the common interface.
mixed | value to test |
public
Definition at line 660 of file MDB2.php.
Referenced by MDB2_Driver_Common\_wrapResult(), MDB2_Extended\getAll(), MDB2_Extended\getAssoc(), MDB2_Extended\getCol(), MDB2_Extended\getOne(), MDB2_Extended\getRow(), MDB2_Driver_Manager_pgsql\listDatabases(), MDB2_Driver_Manager_pgsql\listUsers(), MDB2_Driver_Common\queryAll(), MDB2_Driver_Common\queryCol(), MDB2_Driver_Common\queryOne(), MDB2_Driver_Common\queryRow(), ilDBPdoReversePostgres\tableInfo(), MDB2_Driver_Reverse_mysql\tableInfo(), MDB2_Driver_Reverse_pgsql\tableInfo(), MDB2_Driver_Reverse_mysqli\tableInfo(), and MDB2_Driver_Reverse_oci8\tableInfo().
MDB2::isStatement | ( | $value | ) |
MDB2::loadClass | ( | $class_name, | |
$debug | |||
) |
Loads a PEAR class.
string | classname to load |
bool | if errors should be suppressed |
public
Definition at line 330 of file MDB2.php.
References classExists(), fileExists(), MDB2_ERROR_NOT_FOUND, MDB2_OK, and raiseError().
Referenced by factory(), and MDB2_Driver_Common\loadModule().
MDB2::loadFile | ( | $file | ) |
load a file (like 'Date')
string | name of the file in the MDB2 directory (without '.php') |
public
Definition at line 521 of file MDB2.php.
References fileExists(), MDB2_ERROR_NOT_FOUND, and raiseError().
MDB2::parseDSN | ( | $dsn | ) |
Definition at line 796 of file MDB2.php.
References $GLOBALS, and array.
Referenced by factory(), MDB2_Driver_Common\setDSN(), and singleton().
& MDB2::raiseError | ( | $code = null , |
|
$mode = null , |
|||
$options = null , |
|||
$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.
mixed | int error code |
int | error mode, see PEAR_Error docs |
mixed | 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 | Extra debug information. Defaults to the last query and native error code. |
private
Definition at line 577 of file MDB2.php.
References $code, $options, and PEAR\raiseError().
Referenced by MDB2_Driver_Common\_affectedRows(), MDB2_Driver_Common\_doQuery(), MDB2_Driver_Common\_skipDelimitedStrings(), MDB2_Driver_Common\_wrapResult(), MDB2_Driver_Common\beginTransaction(), MDB2_Driver_Common\commit(), MDB2_Driver_Common\connect(), factory(), MDB2_Module_Common\getDBInstance(), MDB2_Driver_Common\getOption(), MDB2_Driver_Common\getServerVersion(), MDB2_Driver_Common\lastInsertID(), loadClass(), loadFile(), MDB2_Driver_Common\loadModule(), MDB2_Driver_Common\nextID(), MDB2_Driver_Common\prepare(), MDB2_Driver_Common\replace(), MDB2_Driver_Common\rollback(), MDB2_Driver_Common\setCharset(), MDB2_Driver_Common\setFetchMode(), MDB2_Driver_Common\setLimit(), MDB2_Driver_Common\setOption(), MDB2_Driver_Common\setTransactionIsolation(), MDB2_LOB\stream_close(), MDB2_Driver_Common\subSelect(), and MDB2_Driver_Common\supports().
MDB2::setOptions | ( | & | $db, |
$options | |||
) |
set option array in an exiting database object
MDB2_Driver_Common | MDB2 object |
array | An associative array of option names and their values. |
public
Definition at line 284 of file MDB2.php.
References $options, $test, PEAR\isError(), and MDB2_OK.
Referenced by factory(), and singleton().
& MDB2::singleton | ( | $dsn = null , |
|
$options = false |
|||
) |
Returns a MDB2 connection with the requested DSN.
A new MDB2 connection object is only created if no object with the requested DSN exists yet.
IMPORTANT: In order for MDB2 to work properly it is necessary that you make sure that you work with a reference of the original object instead of a copy (this is a PHP4 quirk).
For example: $db =& MDB2::singleton($dsn); ^^ And not: $db = MDB2::singleton($dsn); ^^
mixed | 'data source name', see the MDB2::parseDSN method for a description of the dsn format. Can also be specified as an array of the format returned by MDB2::parseDSN. |
array | An associative array of option names and their values. |
public
Definition at line 486 of file MDB2.php.
References $GLOBALS, $options, factory(), parseDSN(), and setOptions().