EC-CUBE
Public メソッド | Static Public メソッド
クラス MDB2

Public メソッド

 setOptions (&$db, $options)
 loadClass ($class_name, $debug)
factory ($dsn, $options=false)
connect ($dsn, $options=false)
singleton ($dsn=null, $options=false)
 areEquals ($arr1, $arr2)
 loadFile ($file)
 apiVersion ()
raiseError ($code=null, $mode=null, $options=null, $userinfo=null, $dummy1=null, $dummy2=null, $dummy3=false)
 isError ($data, $code=null)
 isConnection ($value)
 isResult ($value)
 isResultCommon ($value)
 isStatement ($value)
 errorMessage ($value=null)
 parseDSN ($dsn)
 fileExists ($file)

Static Public メソッド

 classExists ($classname)

関数

Return the MDB2 API version

戻り値:
string the MDB2 API version number

public

areEquals ( arr1,
arr2 
)

It looks like there's a memory leak in array_diff() in PHP 5.1.x, so use this method instead.

参照:
http://pear.php.net/bugs/bug.php?id=11790
引数:
array$arr1
array$arr2
戻り値:
boolean
classExists ( classname) [static]

Checks if a class exists without triggering __autoload

引数:
stringclassname
戻り値:
bool true success and false on error

public

& connect ( dsn,
options = false 
)

Create a new MDB2_Driver_* 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$dsn'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$optionsAn associative array of option names and their values.
戻り値:
mixed a newly created MDB2 connection object, or a MDB2 error object on error

public

参照:
MDB2::parseDSN
errorMessage ( value = null)

Return a textual error message for a MDB2 error code

引数:
int|arrayinteger error code, null to get the current error code-message map, or an array with a new error code-message map
戻り値:
string error message, or false if the error code was not recognized

public

& 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.
arrayAn associative array of option names and their values.
戻り値:
mixed a newly created MDB2 object, or false on error

public

fileExists ( file)

Checks if a file exists in the include path

引数:
stringfilename
戻り値:
bool true success and false on error

public

isConnection ( value)

Tell whether a value is a MDB2 connection

引数:
mixedvalue to test
戻り値:
bool whether $value is a MDB2 connection

public

isError ( data,
code = null 
)

Tell whether a value is a MDB2 error.

引数:
mixedthe value to test
intif 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
戻り値:
bool true if parameter is an error

public

isResult ( value)

Tell whether a value is a MDB2 result

引数:
mixedvalue to test
戻り値:
bool whether $value is a MDB2 result

public

isResultCommon ( value)

Tell whether a value is a MDB2 result implementing the common interface

引数:
mixedvalue to test
戻り値:
bool whether $value is a MDB2 result implementing the common interface

public

isStatement ( value)

Tell whether a value is a MDB2 statement interface

引数:
mixedvalue to test
戻り値:
bool whether $value is a MDB2 statement interface

public

loadClass ( class_name,
debug 
)

Loads a PEAR class.

引数:
stringclassname to load
boolif errors should be suppressed
戻り値:
mixed true success or PEAR_Error on failure

public

loadFile ( file)

load a file (like 'Date')

引数:
stringname of the file in the MDB2 directory (without '.php')
戻り値:
string name of the file that was included

public

& raiseError ( code = null,
mode = null,
options = null,
userinfo = null,
dummy1 = null,
dummy2 = null,
dummy3 = false 
)

This method is used to communicate an error and invoke error callbacks etc. Basically a wrapper for PEAR::raiseError without the message string.

引数:
mixedint error code
interror mode, see PEAR_Error docs
mixedIf 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.
stringExtra debug information. Defaults to the last query and native error code.
戻り値:
PEAR_Error instance of a PEAR Error object

private

参照:
PEAR_Error
setOptions ( &$  db,
options 
)

set option array in an exiting database object

引数:
MDB2_Driver_CommonMDB2 object
arrayAn associative array of option names and their values.
戻り値:
mixed MDB2_OK or a PEAR Error object

public

& 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.
arrayAn associative array of option names and their values.
戻り値:
mixed a newly created MDB2 connection object, or a MDB2 error object on error

public

参照:
MDB2::parseDSN

このクラスの説明は次のファイルから生成されました:
 全て データ構造 ネームスペース 関数 変数