"TYPO3 4.0.1: ux_t3lib_DB Class Reference", "datetime" => "Sat Dec 2 19:27:30 2006", "date" => "2 Dec 2006", "doxygenversion" => "1.4.6", "projectname" => "TYPO3 4.0.1", "projectnumber" => "4.0.1" ); get_header($doxygen_vars); ?>
Public Member Functions | |
ux_t3lib_DB () | |
initInternalVariables () | |
clearCachedFieldInfo () | |
cacheFieldInfo () | |
analyzeFields ($parsedExtSQL) | |
mapCachedFieldInfo ($fieldInfo) | |
exec_INSERTquery ($table, $fields_values, $no_quote_fields='') | |
exec_UPDATEquery ($table, $where, $fields_values, $no_quote_fields='') | |
exec_DELETEquery ($table, $where) | |
exec_SELECTquery ($select_fields, $from_table, $where_clause, $groupBy='', $orderBy='', $limit='') | |
INSERTquery ($table, $fields_values, $no_quote_fields='') | |
UPDATEquery ($table, $where, $fields_values, $no_quote_fields='') | |
DELETEquery ($table, $where) | |
SELECTquery ($select_fields, $from_table, $where_clause, $groupBy='', $orderBy='', $limit='') | |
quoteSelectFields ($select_fields) | |
quoteFieldNames ($select_fields) | |
quoteFromTables ($from_table) | |
quoteWhereClause ($where_clause) | |
_quoteWhereClause ($where_clause) | |
quoteGroupBy ($groupBy) | |
quoteOrderBy ($orderBy) | |
fullQuoteStr ($str, $table) | |
quoteStr ($str, $table) | |
MetaType ($type, $table, $max_length=-1) | |
MySQLMetaType ($t) | |
MySQLActualType ($meta) | |
sql_error () | |
sql_num_rows (&$res) | |
sql_fetch_assoc (&$res) | |
sql_fetch_row (&$res) | |
sql_free_result (&$res) | |
sql_insert_id () | |
sql_affected_rows () | |
sql_data_seek (&$res, $seek) | |
sql_field_metatype ($table, $field) | |
sql_field_type (&$res, $pointer) | |
sql ($db, $query) | |
sql_query ($query) | |
sql_pconnect ($TYPO3_db_host, $TYPO3_db_username, $TYPO3_db_password) | |
sql_select_db ($TYPO3_db) | |
admin_get_dbs () | |
admin_get_tables () | |
admin_get_fields ($tableName) | |
admin_get_keys ($tableName) | |
admin_query ($query) | |
handler_getFromTableList ($tableList) | |
handler_init ($handlerKey) | |
runningNative () | |
runningADOdbDriver ($driver) | |
map_needMapping ($tableList, $fieldMappingOnly=FALSE) | |
map_assocArray ($input, $tables, $rev=FALSE) | |
map_remapSELECTQueryParts (&$select_fields, &$from_table, &$where_clause, &$groupBy, &$orderBy) | |
map_sqlParts (&$sqlPartArray, $defaultTable) | |
map_genericQueryParsed (&$parsedQuery) | |
map_fieldNamesInArray ($table, &$fieldArray) | |
debugHandler ($function, $execTime, $inData) | |
debug_WHERE ($table, $where, $script='') | |
debug_log ($query, $ms, $data, $join, $errorFlag, $script='') | |
debug_explain ($query) | |
Public Attributes | |
$printErrors = false | |
$debug = false | |
$conf = array() | |
$mapping = array() | |
$table2handlerKeys = array() | |
$handlerCfg | |
$handlerInstance = array() | |
$lastHandlerKey = '' | |
$lastQuery = '' | |
$lastParsedAndMappedQueryArray = array() | |
$resourceIdToTableNameMap = array() | |
$cache_handlerKeyFromTableList = array() | |
$cache_mappingFromTableList = array() | |
$cache_autoIncFields = array() | |
$cache_fieldType = array() | |
$cache_primaryKeys = array() |
Definition at line 126 of file class.ux_t3lib_db.php.
|
Constructor. Creates SQL parser object and imports configuration from $TYPO3_CONF_VARS['EXTCONF']['dbal']
Definition at line 173 of file class.ux_t3lib_db.php. References initInternalVariables(), and t3lib_div::makeInstance(). |
|
[Describe function...]
Definition at line 967 of file class.ux_t3lib_db.php. References t3lib_div::inList(), and quoteFieldNames(). Referenced by quoteWhereClause(). |
|
Listing databases from current MySQL connection. NOTICE: It WILL try to select those databases and thus break selection of current database. Use in Install Tool only! Usage count/core: 1
Reimplemented from t3lib_DB. Definition at line 1605 of file class.ux_t3lib_db.php. References sql_select_db(). |
|
Returns information about each field in the $table (quering the DBMS) In a DBAL this should look up the right handler for the table and return compatible information This function is important not only for the Install Tool but probably for DBALs as well since they might need to look up table specific information in order to construct correct queries. In such cases this information should probably be cached for quick delivery
Reimplemented from t3lib_DB. Definition at line 1707 of file class.ux_t3lib_db.php. References handler_getFromTableList(), map_needMapping(), MetaType(), and MySQLActualType(). |
|
Returns information about each index key in the $table (quering the DBMS) In a DBAL this should look up the right handler for the table and return compatible information
Reimplemented from t3lib_DB. Definition at line 1774 of file class.ux_t3lib_db.php. References handler_getFromTableList(), and map_needMapping(). |
|
Returns the list of tables from the system (quering the DBMSs) It looks up all tables from the DBMS of the _DEFAULT handler and then add all tables *configured* to be managed by other handlers When fetching the tables, it skips tables whose names begin with BIN$, as this is taken as a table coming from the "Recycle Bin" on Oracle.
Reimplemented from t3lib_DB. Definition at line 1645 of file class.ux_t3lib_db.php. References sql_error(), and sql_fetch_assoc(). |
|
mysql() wrapper function, used by the Install Tool and EM for all queries regarding management of the database!
Reimplemented from t3lib_DB. Definition at line 1880 of file class.ux_t3lib_db.php. References exec_INSERTquery(), handler_getFromTableList(), and map_genericQueryParsed(). |
|
Analyzes fields and adds the extracted information to the field type, auto increment and primary key info caches.
Definition at line 256 of file class.ux_t3lib_db.php. References MySQLMetaType(). Referenced by cacheFieldInfo(). |
|
Perform EXPLAIN query on DEFAULT handler!
Definition at line 2534 of file class.ux_t3lib_db.php. References sql_fetch_assoc(), and sql_query(). Referenced by debugHandler(). |
|
Insert row in the log table
Definition at line 2512 of file class.ux_t3lib_db.php. References exec_INSERTquery(). Referenced by debugHandler(). |
|
Log the where clause for debugging purposes.
Definition at line 2489 of file class.ux_t3lib_db.php. References exec_INSERTquery(). Referenced by debugHandler(). |
|
Debug handler for query execution
Definition at line 2413 of file class.ux_t3lib_db.php. References debug_explain(), debug_log(), debug_WHERE(), exec_DELETEquery(), exec_INSERTquery(), exec_SELECTquery(), exec_UPDATEquery(), t3lib_div::inList(), and sql_error(). Referenced by exec_DELETEquery(), exec_INSERTquery(), exec_SELECTquery(), and exec_UPDATEquery(). |
|
Creates a DELETE SQL-statement for $table where $where-clause Usage count/core: 3
Reimplemented from t3lib_DB. Definition at line 819 of file class.ux_t3lib_db.php. References quoteFromTables(), and quoteWhereClause(). Referenced by exec_DELETEquery(). |
|
Deletes records from table
Reimplemented from t3lib_DB. Definition at line 530 of file class.ux_t3lib_db.php. References t3lib_DB::debug(), debugHandler(), DELETEquery(), handler_getFromTableList(), map_needMapping(), map_sqlParts(), t3lib_div::milliseconds(), and sql_error(). Referenced by debugHandler(). |
|
Inserts a record for $table from the array with field/value pairs $fields_values.
Reimplemented from t3lib_DB. Definition at line 337 of file class.ux_t3lib_db.php. References t3lib_DB::debug(), debugHandler(), fullQuoteStr(), handler_getFromTableList(), INSERTquery(), map_assocArray(), map_needMapping(), t3lib_div::milliseconds(), quoteFromTables(), quoteWhereClause(), and sql_error(). Referenced by admin_query(), debug_log(), debug_WHERE(), and debugHandler(). |
|
Selects records from Data Source
Reimplemented from t3lib_DB. Definition at line 596 of file class.ux_t3lib_db.php. References t3lib_DB::debug(), debugHandler(), handler_getFromTableList(), t3lib_div::intExplode(), map_needMapping(), map_remapSELECTQueryParts(), t3lib_div::milliseconds(), SELECTquery(), and sql_error(). Referenced by debugHandler(). |
|
Updates a record from $table
Reimplemented from t3lib_DB. Definition at line 447 of file class.ux_t3lib_db.php. References t3lib_DB::debug(), debugHandler(), fullQuoteStr(), handler_getFromTableList(), map_assocArray(), map_needMapping(), map_sqlParts(), t3lib_div::milliseconds(), quoteFromTables(), quoteWhereClause(), sql_error(), and UPDATEquery(). Referenced by debugHandler(). |
|
Escaping and quoting values for SQL statements.
Reimplemented from t3lib_DB. Definition at line 1047 of file class.ux_t3lib_db.php. Referenced by exec_INSERTquery(), exec_UPDATEquery(), INSERTquery(), and UPDATEquery(). |
|
Return the handler key pointing to an appropriate database handler as found in $this->handlerCfg array Notice: TWO or more tables in the table list MUST use the SAME handler key - otherwise a fatal error is thrown! (Logically, no database can possibly join two tables from separate sources!)
Definition at line 1960 of file class.ux_t3lib_db.php. References handler_init(). Referenced by admin_get_fields(), admin_get_keys(), admin_query(), exec_DELETEquery(), exec_INSERTquery(), exec_SELECTquery(), exec_UPDATEquery(), MetaType(), and quoteStr(). |
|
Initialize handler (connecting to database)
Definition at line 2007 of file class.ux_t3lib_db.php. References t3lib_DB::$link, t3lib_extMgm::extPath(), t3lib_div::getFileAbsFileName(), t3lib_div::makeInstance(), t3lib_div::sysLog(), and t3lib_div::trimExplode(). Referenced by handler_getFromTableList(), and sql_pconnect(). |
|
Setting internal variables from $this->conf
Definition at line 189 of file class.ux_t3lib_db.php. References cacheFieldInfo(), and t3lib_DB::debug(). Referenced by ux_t3lib_DB(). |
|
Creates an INSERT SQL-statement for $table from the array with field/value pairs $fields_values. Usage count/core: 4
Reimplemented from t3lib_DB. Definition at line 682 of file class.ux_t3lib_db.php. References fullQuoteStr(), quoteFieldNames(), runningNative(), and sql_field_metatype(). Referenced by exec_INSERTquery(). |
|
Takes an associated array with field => value pairs and remaps the field names if configured for this table in $this->mapping array. Be careful not to map a field name to another existing fields name (although you can use this to swap fieldnames of course...:-) Observe mapping problems with join-results (more than one table): Joined queries should always prefix the table name to avoid problems with this. Observe that alias fields are not mapped of course (should not be a problem though)
Definition at line 2181 of file class.ux_t3lib_db.php. Referenced by exec_INSERTquery(), exec_UPDATEquery(), and sql_fetch_assoc(). |
|
Re-mapping field names in array
Definition at line 2372 of file class.ux_t3lib_db.php. Referenced by map_genericQueryParsed(). |
|
Will do table/field mapping on a general t3lib_sqlengine-compliant SQL query (May still not support all query types...)
Definition at line 2307 of file class.ux_t3lib_db.php. References map_fieldNamesInArray(), and map_needMapping(). Referenced by admin_query(). |
|
Checks if mapping is needed for a table(list)
Definition at line 2145 of file class.ux_t3lib_db.php. Referenced by admin_get_fields(), admin_get_keys(), exec_DELETEquery(), exec_INSERTquery(), exec_SELECTquery(), exec_UPDATEquery(), map_genericQueryParsed(), and sql_fetch_assoc(). |
|
Remaps table/field names in a SELECT query's parts Notice: All arguments are passed by reference!
Definition at line 2230 of file class.ux_t3lib_db.php. References map_sqlParts(). Referenced by exec_SELECTquery(). |
|
Generic mapping of table/field names arrays (as parsed by t3lib_sqlengine)
Definition at line 2272 of file class.ux_t3lib_db.php. Referenced by exec_DELETEquery(), exec_UPDATEquery(), and map_remapSELECTQueryParts(). |
|
This function builds all definitions for mapped tables and fields
Definition at line 279 of file class.ux_t3lib_db.php. Referenced by cacheFieldInfo(). |
|
Return MetaType for native field type (ADOdb only!)
Definition at line 1088 of file class.ux_t3lib_db.php. References handler_getFromTableList(), and quoteFromTables(). Referenced by admin_get_fields(). |
|
Return actual MySQL type for meta field type
Definition at line 1163 of file class.ux_t3lib_db.php. Referenced by admin_get_fields(). |
|
Return MetaType for native MySQL field type
Definition at line 1116 of file class.ux_t3lib_db.php. Referenced by analyzeFields(). |
|
Quotes field (and table) names with the quote character suitable for the DB being used
Definition at line 887 of file class.ux_t3lib_db.php. References runningNative(). Referenced by _quoteWhereClause(), INSERTquery(), quoteSelectFields(), SELECTquery(), and UPDATEquery(). |
|
Quotes table names with the quote character suitable for the DB being used
Definition at line 923 of file class.ux_t3lib_db.php. References runningNative(). Referenced by DELETEquery(), exec_INSERTquery(), exec_UPDATEquery(), MetaType(), and SELECTquery(). |
|
[Describe function...]
Definition at line 997 of file class.ux_t3lib_db.php. References runningNative(). Referenced by SELECTquery(). |
|
[Describe function...]
Definition at line 1017 of file class.ux_t3lib_db.php. References runningNative(). Referenced by SELECTquery(). |
|
Quotes field (and table) names with the quote character suitable for the DB being used Use quoteFieldNames instead!
Definition at line 877 of file class.ux_t3lib_db.php. References quoteFieldNames(). |
|
Substitution for PHP function "addslashes()" NOTICE: You must wrap the output of this function in SINGLE QUOTES to be DBAL compatible. Unless you have to apply the single quotes yourself you should rather use ->fullQuoteStr()!
Reimplemented from t3lib_DB. Definition at line 1060 of file class.ux_t3lib_db.php. References handler_getFromTableList(). |
|
Quotes the field (and table) names within a where clause with the quote character suitable for the DB being used
Definition at line 950 of file class.ux_t3lib_db.php. References _quoteWhereClause(), and runningNative(). Referenced by DELETEquery(), exec_INSERTquery(), exec_UPDATEquery(), and SELECTquery(). |
|
Checks whether the ADOdb handler is running with a driver that contains the argument
Definition at line 2119 of file class.ux_t3lib_db.php. Referenced by sql_fetch_assoc(), and sql_fetch_row(). |
|
Checks whether the DBAL is currently inside an operation running on the "native" DB handler (i.e. MySQL)
Definition at line 2108 of file class.ux_t3lib_db.php. Referenced by INSERTquery(), quoteFieldNames(), quoteFromTables(), quoteGroupBy(), quoteOrderBy(), quoteWhereClause(), and UPDATEquery(). |
|
Creates a SELECT SQL-statement Usage count/core: 11
Reimplemented from t3lib_DB. Definition at line 846 of file class.ux_t3lib_db.php. References quoteFieldNames(), quoteFromTables(), quoteGroupBy(), quoteOrderBy(), and quoteWhereClause(). Referenced by exec_SELECTquery(). |
|
Executes query (on DEFAULT handler!) DEPRECIATED - use exec_* functions from this class instead!
Reimplemented from t3lib_DB. Definition at line 1505 of file class.ux_t3lib_db.php. References sql_query(). |
|
Returns the number of rows affected by the last INSERT, UPDATE or DELETE query
Reimplemented from t3lib_DB. Definition at line 1389 of file class.ux_t3lib_db.php. |
|
Move internal result pointer
Definition at line 1412 of file class.ux_t3lib_db.php. |
|
Returns the error status on the most recent sql() execution (based on $this->lastHandlerKey)
Reimplemented from t3lib_DB. Definition at line 1206 of file class.ux_t3lib_db.php. Referenced by admin_get_tables(), debugHandler(), exec_DELETEquery(), exec_INSERTquery(), exec_SELECTquery(), exec_UPDATEquery(), and sql_query(). |
|
Returns an associative array that corresponds to the fetched row, or FALSE if there are no more rows.
Definition at line 1252 of file class.ux_t3lib_db.php. References map_assocArray(), map_needMapping(), and runningADOdbDriver(). Referenced by admin_get_tables(), and debug_explain(). |
|
Returns an array that corresponds to the fetched row, or FALSE if there are no more rows. The array contains the values in numerical indices.
Definition at line 1303 of file class.ux_t3lib_db.php. References runningADOdbDriver(). |
|
Get the type of the specified field in a result If the first parameter is a string, it is used as table name for the lookup.
Definition at line 1438 of file class.ux_t3lib_db.php. Referenced by INSERTquery(), and UPDATEquery(). |
|
Get the type of the specified field in a result If the first parameter is a string, it is used as table name for the lookup.
Definition at line 1451 of file class.ux_t3lib_db.php. References t3lib_DB::debug(). |
|
Free result memory / unset result object
Definition at line 1339 of file class.ux_t3lib_db.php. |
|
Get the ID generated from the previous INSERT operation
Reimplemented from t3lib_DB. Definition at line 1368 of file class.ux_t3lib_db.php. |
|
Returns the number of selected rows.
Definition at line 1228 of file class.ux_t3lib_db.php. |
|
Opening the _DEFAULT connection handler to the database. This is typically done by the scripts "init.php" in the backend or "index_ts.php" in the frontend (tslib_fe->connectToMySQL()) You wouldn't need to use this at any time - let TYPO3 core handle this.
Reimplemented from t3lib_DB. Definition at line 1554 of file class.ux_t3lib_db.php. References handler_init(). |
|
Executes query (on DEFAULT handler!) DEPRECIATED - use exec_* functions from this class instead! If you don't, anything that uses not the _DEFAULT handler will break!
Reimplemented from t3lib_DB. Definition at line 1519 of file class.ux_t3lib_db.php. References t3lib_DB::debug(), and sql_error(). Referenced by debug_explain(), and sql(). |
|
Select database for _DEFAULT handler.
Reimplemented from t3lib_DB. Definition at line 1573 of file class.ux_t3lib_db.php. Referenced by admin_get_dbs(). |
|
Creates an UPDATE SQL-statement for $table where $where-clause (typ. 'uid=...') from the array with field/value pairs $fields_values. Usage count/core: 6
Reimplemented from t3lib_DB. Definition at line 750 of file class.ux_t3lib_db.php. References fullQuoteStr(), quoteFieldNames(), runningNative(), and sql_field_metatype(). Referenced by exec_UPDATEquery(). |
|
Initial value: array ( // See manual. '_DEFAULT' => array ( 'type' => 'native', 'config' => array( 'username' => '', // Set by default (overridden) 'password' => '', // Set by default (overridden) 'host' => '', // Set by default (overridden) 'database' => '', // Set by default (overridden) 'driver' => '', // ONLY "adodb" type; eg. "mysql" 'sequenceStart' => 1 // ONLY "adodb", first number in sequences/serials/... ) ), ) Definition at line 135 of file class.ux_t3lib_db.php. |