Class: MDB2_Driver_Common
Source Location: /MDB2-2.5.0b2/MDB2.php
PEAR
|
--MDB2_Driver_Common
MDB2_Driver_Common: Base class that is extended by each MDB2 driver
Author(s):
|
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
$as_keyword = ' AS '
[line 1244]
column alias keyword
$connected_database_name = ''
[line 1076]
the name of the database currently selected
$connected_dsn = array()
[line 1048]
DSN that was used to create the current connection
$connected_server_info = ''
[line 1083]
server version information
$connection = 0
[line 1055]
connection resource
$database_name = ''
[line 1069]
the name of the database for the next query
$dbsyntax =
[line 1307]
Database used with regards to SQL syntax etc.
$db_index = 0
[line 1034]
index of the MDB2 object within the $GLOBALS['_MDB2_databases'] array
$debug_output = ''
[line 1258]
string with the debugging information
$destructor_registered = true
[line 1335]
determines of the PHP4 destructor emulation has been enabled yet
$dsn = array()
[line 1041]
DSN used for the next query
$fetchmode = MDB2_FETCHMODE_ORDERED
[line 1321]
the default fetchmode used
$has_transaction_error = false
[line 1279]
the first error that occured inside a nested transaction
$identifier_quoting = array('start' => '"', 'end' => '"', 'escape' => '"')
[line 1220]
identifier quoting
$in_transaction = false
[line 1265]
determine if there is an open transaction
$last_query =
[line 1314]
the last query sent to the driver
$limit = 0
[line 1293]
result limit used in the next query
$modules = array()
[line 1328]
array of module instances
$nested_transaction_counter = null
[line 1272]
the smart transaction nesting depth
$offset = 0
[line 1286]
result offset used in the next query
$opened_persistent =
[line 1062]
if the current opened connection is a persistent connection
$options = array(
'ssl' => false,
'field_case' => CASE_LOWER,
'disable_query' => false,
'result_class' => 'MDB2_Result_%s',
'buffered_result_class' => 'MDB2_BufferedResult_%s',
'result_wrap_class' => false,
'result_buffering' => true,
'fetch_class' => 'stdClass',
'persistent' => false,
'debug' => 0,
'debug_handler' => 'MDB2_defaultDebugOutput',
'debug_expanded_output' => false,
'default_text_field_length' => 4096,
'lob_buffer_length' => 8192,
'log_line_break' => "\n",
'idxname_format' => '%s_idx',
'seqname_format' => '%s_seq',
'savepoint_format' => 'MDB2_SAVEPOINT_%s',
'statement_format' => 'MDB2_STATEMENT_%1$s_%2$s',
'seqcol_name' => 'sequence',
'quote_identifier' => false,
'use_transactions' => true,
'decimal_places' => 2,
'portability' => MDB2_PORTABILITY_ALL,
'modules' => array(
'ex' => 'Extended',
'dt' => 'Datatype',
'mg' => 'Manager',
'rv' => 'Reverse',
'na' => 'Native',
'fc' => 'Function',
),'emulate_prepared'=>false,'datatype_map'=>array(),'datatype_map_callback'=>array(),'nativetype_map_callback'=>array(),'lob_allow_url_include'=>false,'bindname_format'=>'(?:\d+)|(?:[a-zA-Z][a-zA-Z0-9_]*)','max_identifiers_length'=>30,'default_fk_action_onupdate'=>'RESTRICT','default_fk_action_ondelete'=>'RESTRICT',)
[line 1164]
Array of supported options that can be passed to the MDB2 instance. The options can be set during object creation, using MDB2::connect(), MDB2::factory() or MDB2::singleton(). The options can also be set after the object is created, using MDB2::setOptions() or MDB2_Driver_Common::setOption(). The list of available option includes: - $options['ssl'] -> boolean: determines if ssl should be used for connections
- $options['field_case'] -> CASE_LOWER|CASE_UPPER: determines what case to force on field/table names
- $options['disable_query'] -> boolean: determines if queries should be executed
- $options['result_class'] -> string: class used for result sets
- $options['buffered_result_class'] -> string: class used for buffered result sets
- $options['result_wrap_class'] -> string: class used to wrap result sets into
- $options['result_buffering'] -> boolean should results be buffered or not?
- $options['fetch_class'] -> string: class to use when fetch mode object is used
- $options['persistent'] -> boolean: persistent connection?
- $options['debug'] -> integer: numeric debug level
- $options['debug_handler'] -> string: function/method that captures debug messages
- $options['debug_expanded_output'] -> bool: BC option to determine if more context information should be send to the debug handler
- $options['default_text_field_length'] -> integer: default text field length to use
- $options['lob_buffer_length'] -> integer: LOB buffer length
- $options['log_line_break'] -> string: line-break format
- $options['idxname_format'] -> string: pattern for index name
- $options['seqname_format'] -> string: pattern for sequence name
- $options['savepoint_format'] -> string: pattern for auto generated savepoint names
- $options['statement_format'] -> string: pattern for prepared statement names
- $options['seqcol_name'] -> string: sequence column name
- $options['quote_identifier'] -> boolean: if identifier quoting should be done when check_option is used
- $options['use_transactions'] -> boolean: if transaction use should be enabled
- $options['decimal_places'] -> integer: number of decimal places to handle
- $options['portability'] -> integer: portability constant
- $options['modules'] -> array: short to long module name mapping for __call()
- $options['emulate_prepared'] -> boolean: force prepared statements to be emulated
- $options['datatype_map'] -> array: map user defined datatypes to other primitive datatypes
- $options['datatype_map_callback'] -> array: callback function/method that should be called
- $options['bindname_format'] -> string: regular expression pattern for named parameters
- $options['multi_query'] -> boolean: determines if queries returning multiple result sets should be executed
- $options['max_identifiers_length'] -> integer: max identifier length
- $options['default_fk_action_onupdate'] -> string: default FOREIGN KEY ON UPDATE action ['RESTRICT'|'NO ACTION'|'SET DEFAULT'|'SET NULL'|'CASCADE']
- $options['default_fk_action_ondelete'] -> string: default FOREIGN KEY ON DELETE action ['RESTRICT'|'NO ACTION'|'SET DEFAULT'|'SET NULL'|'CASCADE']
$phptype =
[line 1300]
Database backend used in PHP (mysql, odbc etc.)
$sql_comments = array(
array('start' => '--', 'end' => "\n", 'escape' => false),array('start'=>'/*','end'=>'*/','escape'=>false),)
[line 1227]
sql comments
$string_quoting = array('start' => "'", 'end' => "'", 'escape' => false, 'escape_pattern' => false)
[line 1213]
string array
$supported = array(
'sequences' => false,
'indexes' => false,
'affected_rows' => false,
'summary_functions' => false,
'order_by_text' => false,
'transactions' => false,
'savepoints' => false,
'current_id' => false,
'limit_queries' => false,
'LOBs' => false,
'replace' => false,
'sub_selects' => false,
'triggers' => false,
'auto_increment' => false,
'primary_key' => false,
'result_introspection' => false,
'prepared_statements' => false,
'identifier_quoting' => false,
'pattern_escaping' => false,
'new_link' => false,
)
[line 1090]
list of all supported features of the given driver
$warnings = array()
[line 1251]
warnings
$wildcards = array('%', '_')
[line 1237]
comparision wildcards
Method Detail
__construct (Constructor) [line 1343]
MDB2_Driver_Common __construct(
)
|
|
Constructor
MDB2_Driver_Common (Constructor) [line 1357]
MDB2_Driver_Common MDB2_Driver_Common(
)
|
|
PHP 4 Constructor
__destruct (Destructor) [line 1369]
beginNestedTransaction [line 2115]
mixed beginNestedTransaction(
)
|
|
Start a nested transaction.
beginTransaction [line 2007]
mixed beginTransaction(
[string
$savepoint = null])
|
|
Start a transaction or set a savepoint.
Parameters:
commit [line 2028]
mixed commit(
[string
$savepoint = null])
|
|
Commit the database changes done during a transaction that is in progress or release a savepoint. This function may only be called when auto-committing is disabled, otherwise it will fail. Therefore, a new transaction is implicitly started after committing the pending changes.
Parameters:
compareDefinition [line 3139]
array compareDefinition(
array
$current, array
$previous)
|
|
Obtain an array of changes that may need to applied
Parameters:
completeNestedTransaction [line 2146]
mixed completeNestedTransaction(
[bool
$force_rollback = false])
|
|
Finish a nested transaction by rolling back if an error occured or committing otherwise.
Parameters:
connect [line 2236]
currID [line 3259]
mixed currID(
string
$seq_name)
|
|
Returns the current id of a sequence
Parameters:
databaseExists [line 2253]
mixed databaseExists(
string
$name)
|
|
check if given database name is exists?
Parameters:
debug [line 1637]
void debug(
string
$message, [string
$scope = ''], [array
$context = array()])
|
|
set a debug message
Parameters:
disconnect [line 2289]
mixed disconnect(
[boolean
$force = true])
|
|
Log out and disconnect from the database.
Parameters:
errorInfo [line 1423]
array errorInfo(
[mixed
$error = null])
|
|
This method is used to collect information about an error
Parameters:
escape [line 1680]
string escape(
string
$text, [bool
$escape_wildcards = false])
|
|
Quotes a string so it can be safely used in a query. It will quote the text so it can safely be used within a query.
Parameters:
escapePattern [line 1702]
string escapePattern(
string
$text)
|
|
Quotes pattern (% and _) characters in a string)
Parameters:
exec [line 2540]
mixed &exec(
string
$query)
|
|
Execute a manipulation query to the database and return the number of affected rows
Parameters:
failNestedTransaction [line 2198]
bool failNestedTransaction(
[mixed
$error = null], [bool
$immediately = false])
|
|
Force setting nested transaction to failed.
Parameters:
free [line 1384]
Free the internal references so that the instance can be destroyed
getAsKeyword [line 1774]
Gets the string to alias column
getConnection [line 1790]
Returns a native connection
getDatabase [line 2333]
getDebugOutput [line 1661]
getDeclaration [line 3117]
string getDeclaration(
string
$type, string
$name, string
$field)
|
|
Obtain DBMS specific SQL code portion needed to declare of the given type
Parameters:
getDSN [line 2375]
mixed getDSN(
[string
$type = 'string'], [string
$hidepw = false])
|
|
return the DSN as a string
Parameters:
getIndexName [line 3202]
string getIndexName(
string
$idx)
|
|
adds index name formatting to a index name
Parameters:
getNestedTransactionError [line 2223]
The first error that occured since the transaction start.
getOption [line 1611]
mixed getOption(
string
$option)
|
|
Returns the value of an option
Parameters:
getSequenceName [line 3184]
string getSequenceName(
string
$sqn)
|
|
adds sequence name formatting to a sequence name
Parameters:
getServerVersion [line 2687]
mixed getServerVersion(
[bool
$native = false])
|
|
return version information about the server
Parameters:
getWarnings [line 1532]
Get all warnings in reverse order. This means that the last warning is the first element in the array
inTransaction [line 2070]
int|bool inTransaction(
[bool
$ignore_nested = false])
|
|
If a transaction is currently open.
Parameters:
lastInsertID [line 3241]
mixed lastInsertID(
[string
$table = null], [string
$field = null])
|
|
Returns the autoincrement ID if supported or $id or fetches the current ID in a sequence called: $table.(empty($field) ? '' : '_'.$field)
Parameters:
loadModule [line 1897]
object on &loadModule(
string
$module, [string
$property = null], [bool
$phptype_specific = null])
|
|
loads a module
Parameters:
nextID [line 3221]
mixed nextID(
string
$seq_name, [bool
$ondemand = true])
|
|
Returns the next free id of a sequence
Parameters:
prepare [line 2933]
mixed &prepare(
string
$query, [mixed
$types = null], [mixed
$result_types = null], [mixed
$lobs = array()])
|
|
Prepares a query for multiple execution with execute(). With some database backends, this is emulated. prepare() requires a generic query as string like 'INSERT INTO numbers VALUES(?,?)' or 'INSERT INTO numbers VALUES(:foo,:bar)'. The ? and :name and are placeholders which can be set using bindParam() and the query can be sent off using the execute() method. The allowed format for :name can be set with the 'bindname_format' option.
Parameters:
query [line 2577]
mixed &query(
string
$query, [mixed
$types = null], [mixed
$result_class = true], [mixed
$result_wrap_class = false])
|
|
Send a query to the database and return any results
Parameters:
queryAll [line 3384]
mixed queryAll(
string
$query, [array
$types = null], [int
$fetchmode = MDB2_FETCHMODE_DEFAULT], [bool
$rekey = false], [bool
$force_array = false], [bool
$group = false])
|
|
Execute the specified query, fetch all the rows of the result set into a two dimensional array and then frees the result set.
Parameters:
queryCol [line 3345]
mixed queryCol(
string
$query, [string
$type = null], [mixed
$colnum = 0])
|
|
Execute the specified query, fetch the value from the first column of each row of the result set into an array and then frees the result set.
Parameters:
queryOne [line 3285]
mixed queryOne(
string
$query, [string
$type = null], [mixed
$colnum = 0])
|
|
Execute the specified query, fetch the value from the first column of the first row of the result set and then frees the result set.
Parameters:
queryRow [line 3316]
mixed queryRow(
string
$query, [array
$types = null], [int
$fetchmode = MDB2_FETCHMODE_DEFAULT])
|
|
Execute the specified query, fetch the values from the first row of the result set into an array and then frees the result set.
Parameters:
quote [line 3091]
string quote(
string
$value, [string
$type = null], [bool
$quote = true], [bool
$escape_wildcards = false])
|
|
Convert a text value into a DBMS specific format that is suitable to compose query statements.
Parameters:
quoteIdentifier [line 1753]
string quoteIdentifier(
string
$str, [bool
$check_option = false])
|
|
Quote a string so it can be safely used as a table or column name Delimiting style depends on which database driver is being used. NOTE: just because you CAN use delimited identifiers doesn't mean you SHOULD use them. In general, they end up causing way more problems than they solve. NOTE: if you have table names containing periods, don't use this method (@see bug #11906) Portability is broken by using the following characters inside delimited identifiers: - backtick (`) -- due to MySQL
- double quote (") -- due to Oracle
- brackets ([ or ]) -- due to Access
Delimited identifiers are known to generally work correctly under the following drivers: - mssql
- mysql
- mysqli
- oci8
- pgsql
- sqlite
InterBase doesn't seem to be able to use delimited identifiers via PHP 4. They work fine under PHP 5.
Parameters:
raiseError [line 1456]
PEAR_Error &raiseError(
[mixed
$code = null], [int
$mode = null], [mixed
$options = null], [string
$userinfo = null], [string
$method = null], [string
$dummy1 = null], [bool
$dummy2 = false])
|
|
This method is used to communicate an error and invoke error callbacks etc. Basically a wrapper for PEAR::raiseError without the message string.
Parameters:
replace [line 2834]
mixed replace(
string
$table, array
$fields)
|
|
Execute a SQL REPLACE query. A REPLACE query is identical to a INSERT query, except that if there is already a row in the table with the same key field values, the old row is deleted before the new row is inserted. The REPLACE type of query does not make part of the SQL standards. Since practically only MySQL and SQLite implement it natively, this type of query isemulated through this method for other DBMS using standard types of queries inside a transaction to assure the atomicity of the operation.
Parameters:
resetWarnings [line 1515]
rollback [line 2049]
mixed rollback(
[string
$savepoint = null])
|
|
Cancel any database changes done during a transaction or since a specific savepoint that is in progress. This function may only be called when auto-committing is disabled, otherwise it will fail. Therefore, a new transaction is implicitly started after canceling the pending changes.
Parameters:
setCharset [line 2270]
true setCharset(
string
$charset, [resource
$connection = null])
|
|
Set the charset on the current connection
Parameters:
setDatabase [line 2313]
string setDatabase(
string
$name)
|
|
Select a different database
Parameters:
setDSN [line 2350]
MDB2_OK setDSN(
mixed
$dsn)
|
|
set the DSN
Parameters:
setFetchMode [line 1559]
mixed setFetchMode(
int
$fetchmode, [string
$object_class = 'stdClass'])
|
|
Sets which fetch mode should be used by default on queries on this connection
Parameters:
setLimit [line 2706]
mixed setLimit(
string
$limit, [string
$offset = null])
|
|
set the range of the next query
Parameters:
setOption [line 1589]
mixed setOption(
string
$option, mixed
$value)
|
|
set the option for the db class
Parameters:
setTransactionIsolation [line 2097]
mixed setTransactionIsolation(
string
$isolation, [array
$options = array()])
|
|
Set the transacton isolation level.
Parameters:
standaloneQuery [line 2435]
mixed &standaloneQuery(
string
$query, [mixed
$types = null], [bool
$is_manip = false])
|
|
execute a query as database administrator
Parameters:
subSelect [line 2744]
string subSelect(
string
$query, [string
$type = false])
|
|
simple subselect emulation: leaves the query untouched for all RDBMS that support subselects
Parameters:
supports [line 3163]
bool|string supports(
string
$feature)
|
|
Tell whether a DB implementation or its backend extension supports a given feature.
Parameters:
_doQuery [line 2494]
result &_doQuery(
string
$query, [bool
$is_manip = false], [resource
$connection = null], [string
$database_name = null])
|
|
Execute a query
Parameters:
_fixResultArrayValues [line 1812]
void _fixResultArrayValues(
array
&$row, array
$mode)
|
|
Do all necessary conversions on result arrays to fix DBMS quirks
Parameters:
_isNewLinkSet [line 2410]
Check if the 'new_link' option is set
_modifyQuery [line 2475]
string _modifyQuery(
string
$query, bool
$is_manip, int
$limit, int
$offset)
|
|
Changes a query string for various DBMS specific reasons
Parameters:
_skipDelimitedStrings [line 3039]
mixed _skipDelimitedStrings(
string
$query, integer
$position, integer
$p_position)
|
|
Utility method, used by prepare() to avoid replacing placeholders within delimited strings. Check if the placeholder is contained within a delimited string. If so, skip it and advance the position, otherwise return the current position, which is valid
Parameters:
_wrapResult [line 2616]
mixed &_wrapResult(
resource
$result, [mixed
$types = array()], [mixed
$result_class = true], [mixed
$result_wrap_class = false], [string
$limit = null], [string
$offset = null])
|
|
wrap a result set into the correct class
Parameters:
__call [line 1966]
mixed __call(
string
$method, array
$params)
|
|
Calls a module method using the __call magic method
Parameters:
__toString [line 1401]
Documentation generated on Wed, 14 Jan 2009 12:30:32 -0500 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.
|
|