|
| getInstance ($db_type=NULL) |
|
| create () |
|
| __construct () |
|
| getSupportedList () |
|
| _getSupportedList () |
|
| _sortDBMS ($a, $b) |
|
| isSupported () |
|
| isConnected ($type= 'master', $indx=0) |
|
| actStart ($query) |
|
| actFinish () |
|
| setQueryLog ($log) |
|
| setError ($errno=0, $errstr= 'success') |
|
| isError () |
|
| getError () |
|
| executeQuery ($query_id, $args=NULL, $arg_columns=NULL, $type=NULL) |
|
| checkQueryCacheFile ($query_id, $xml_file) |
|
| _executeQuery ($cache_file, $source_args, $query_id, $arg_columns, $type) |
|
| getCountCache ($tables, $condition) |
|
| putCountCache ($tables, $condition, $count=0) |
|
| resetCountCache ($tables) |
|
| dropTable ($table_name) |
|
| getSelectSql ($query, $with_values=TRUE) |
|
| getClickCountQuery ($queryObject) |
|
| getDeleteSql ($query, $with_values=TRUE, $with_priority=FALSE) |
|
| getUpdateSql ($query, $with_values=TRUE, $with_priority=FALSE) |
|
| getInsertSql ($query, $with_values=TRUE, $with_priority=FALSE) |
|
| _getSlaveConnectionStringIndex () |
|
| _getConnection ($type= 'master', $indx=NULL) |
|
| _dbInfoExists () |
|
| _close ($connection) |
|
| close ($type= 'master', $indx=0) |
|
| _begin ($transactionLevel=0) |
|
| begin () |
|
| _rollback ($transactionLevel=0) |
|
| rollback () |
|
| _commit () |
|
| commit ($force=FALSE) |
|
| __query ($query, $connection) |
|
| _query ($query, $connection=NULL) |
|
| _setDBInfo () |
|
| __connect ($connection) |
|
| _afterConnect ($connection) |
|
| _connect ($type= 'master', $indx=0) |
|
| actDBClassStart () |
|
| actDBClassFinish () |
|
| getParser ($force=FALSE) |
|
Definition at line 16 of file DB.class.php.
DB::__connect |
( |
|
$connection | ) |
|
DB Connect this method is protected
- Parameters
-
- Returns
- void
Definition at line 1243 of file DB.class.php.
DB::__query |
( |
|
$query, |
|
|
|
$connection |
|
) |
| |
Execute the query this method is protected
- Parameters
-
string | $query | |
resource | $connection | |
- Returns
- void
Definition at line 1181 of file DB.class.php.
DB::_afterConnect |
( |
|
$connection | ) |
|
If have a task after connection, add a taks in this method this method is protected
- Parameters
-
- Returns
- void
Definition at line 1254 of file DB.class.php.
DB::_begin |
( |
|
$transactionLevel = 0 | ) |
|
DB transaction start this method is protected
- Returns
- boolean
Definition at line 1088 of file DB.class.php.
DB::_close |
( |
|
$connection | ) |
|
DB disconnection this method is protected
- Parameters
-
- Returns
- void
Definition at line 1050 of file DB.class.php.
DB transaction commit this method is protected
- Returns
- boolean
Definition at line 1147 of file DB.class.php.
DB::_connect |
( |
|
$type = 'master' , |
|
|
|
$indx = 0 |
|
) |
| |
DB Connect this method is protected
- Parameters
-
string | $type | 'master' or 'slave' |
int | $indx | number in slave dbms server list |
- Returns
- void
Definition at line 1266 of file DB.class.php.
check db information exists
- Returns
- boolean
Definition at line 1031 of file DB.class.php.
DB::_executeQuery |
( |
|
$cache_file, |
|
|
|
$source_args, |
|
|
|
$query_id, |
|
|
|
$arg_columns, |
|
|
|
$type |
|
) |
| |
Execute query and return the result
- Parameters
-
string | $cache_file | cache file of query |
array | object | $source_args | arguments for query |
string | $query_id | query id |
array | $arg_columns | column list. if you want get specific colums from executed result, add column list to $arg_columns |
- Returns
- object result of query
Definition at line 605 of file DB.class.php.
DB::_getConnection |
( |
|
$type = 'master' , |
|
|
|
$indx = NULL |
|
) |
| |
Return connection resource
- Parameters
-
string | $type | use 'master' or 'slave'. default value is 'master' |
int | $indx | if indx value is NULL, return rand number in slave server list |
- Returns
- resource
Definition at line 1001 of file DB.class.php.
DB::_getSlaveConnectionStringIndex |
( |
| ) |
|
Return index from slave server list
- Returns
- int
Definition at line 988 of file DB.class.php.
DB::_getSupportedList |
( |
| ) |
|
returns list of supported dbms list this method is private
- Returns
- array return supported DBMS list
Definition at line 265 of file DB.class.php.
DB::_query |
( |
|
$query, |
|
|
|
$connection = NULL |
|
) |
| |
Execute the query this method is protected
- Parameters
-
string | $query | |
resource | $connection | |
- Returns
- resource
Definition at line 1193 of file DB.class.php.
DB::_rollback |
( |
|
$transactionLevel = 0 | ) |
|
DB transaction rollback this method is protected
- Returns
- boolean
Definition at line 1116 of file DB.class.php.
DB info settings this method is protected
- Returns
- void
Definition at line 1216 of file DB.class.php.
Finish recording DBClass log
- Returns
- void
Definition at line 1323 of file DB.class.php.
Start recording DBClass log
- Returns
- void
Definition at line 1312 of file DB.class.php.
finish recording log
- Returns
- void
Definition at line 389 of file DB.class.php.
start recording log
- Parameters
-
- Returns
- void
Definition at line 377 of file DB.class.php.
DB::checkQueryCacheFile |
( |
|
$query_id, |
|
|
|
$xml_file |
|
) |
| |
Look for query cache file
- Parameters
-
string | $query_id | query id for finding |
string | $xml_file | original xml query file |
- Returns
- string cache file
Definition at line 576 of file DB.class.php.
DB::close |
( |
|
$type = 'master' , |
|
|
|
$indx = 0 |
|
) |
| |
DB disconnection
- Parameters
-
string | $type | 'master' or 'slave' |
int | $indx | number in slave dbms server list |
- Returns
- void
Definition at line 1061 of file DB.class.php.
DB::commit |
( |
|
$force = FALSE | ) |
|
DB transaction commit
- Parameters
-
boolean | $force | regardless transaction start status or connect status, forced to commit |
- Returns
- void
Definition at line 1157 of file DB.class.php.
returns instance of db
- Returns
- DB return DB object instance
Definition at line 179 of file DB.class.php.
DB::dropTable |
( |
|
$table_name | ) |
|
Drop tables
- Parameters
-
- Returns
- void
Definition at line 800 of file DB.class.php.
DB::executeQuery |
( |
|
$query_id, |
|
|
|
$args = NULL , |
|
|
|
$arg_columns = NULL , |
|
|
|
$type = NULL |
|
) |
| |
Execute Query that result of the query xml file This function finds xml file or cache file of $query_id, compiles it and then execute it
- Parameters
-
string | $query_id | query id (module.queryname) |
array | object | $args | arguments for query |
array | $arg_columns | column list. if you want get specific colums from executed result, add column list to $arg_columns |
- Returns
- object result of query
Definition at line 509 of file DB.class.php.
DB::getClickCountQuery |
( |
|
$queryObject | ) |
|
Given a SELECT statement that uses click count returns the corresponding update sql string for databases that don't have click count support built in (aka all besides CUBRID)
Function does not check if click count columns exist! You must call $query->usesClickCount() before using this function
- Parameters
-
Definition at line 885 of file DB.class.php.
DB::getCountCache |
( |
|
$tables, |
|
|
|
$condition |
|
) |
| |
Returns counter cache data
- Parameters
-
array | string | $tables | tables to get data |
string | $condition | condition to get data |
- Returns
- int count of cache data
Definition at line 672 of file DB.class.php.
DB::getDeleteSql |
( |
|
$query, |
|
|
|
$with_values = TRUE , |
|
|
|
$with_priority = FALSE |
|
) |
| |
Return delete query string
- Parameters
-
object | $query | |
boolean | $with_values | |
boolean | $with_priority | |
- Returns
- string
Definition at line 911 of file DB.class.php.
static DB::getDisableList |
( |
| ) |
|
|
static |
returns list of disable in supported dbms list this list return by child class
- Returns
- array return disable DBMS list in supported dbms list
Definition at line 238 of file DB.class.php.
static DB::getEnableList |
( |
| ) |
|
|
static |
returns enable list in supported dbms list this list return by child class
- Returns
- array return enable DBMS list in supported dbms list
Definition at line 211 of file DB.class.php.
Returns object of error info
- Returns
- object object of error
Definition at line 495 of file DB.class.php.
DB::getInsertSql |
( |
|
$query, |
|
|
|
$with_values = TRUE , |
|
|
|
$with_priority = FALSE |
|
) |
| |
Return insert query string
- Parameters
-
object | $query | |
boolean | $with_values | |
boolean | $with_priority | |
- Returns
- string
Definition at line 975 of file DB.class.php.
DB::getInstance |
( |
|
$db_type = NULL | ) |
|
returns instance of certain db type
- Parameters
-
- Returns
- DB return DB object instance
Definition at line 142 of file DB.class.php.
DB::getParser |
( |
|
$force = FALSE | ) |
|
Returns a database specific parser instance used for escaping expressions and table/column identifiers
Requires an implementation of the DB class (won't work if database is not set) this method is singleton
- Parameters
-
boolean | $force | force load DBParser instance |
- Returns
- DBParser
Definition at line 1345 of file DB.class.php.
DB::getSelectSql |
( |
|
$query, |
|
|
|
$with_values = TRUE |
|
) |
| |
Return select query string
- Parameters
-
object | $query | |
boolean | $with_values | |
- Returns
- string
Definition at line 816 of file DB.class.php.
returns list of supported dbms list this list return by directory list check by instance can creatable
- Returns
- array return supported DBMS list
Definition at line 200 of file DB.class.php.
DB::getUpdateSql |
( |
|
$query, |
|
|
|
$with_values = TRUE , |
|
|
|
$with_priority = FALSE |
|
) |
| |
Return update query string
- Parameters
-
object | $query | |
boolean | $with_values | |
boolean | $with_priority | |
- Returns
- string
Definition at line 943 of file DB.class.php.
DB::isConnected |
( |
|
$type = 'master' , |
|
|
|
$indx = 0 |
|
) |
| |
Return connected status
- Parameters
-
string | $type | master or slave |
int | $indx | key of server list |
- Returns
- boolean true: connected, false: not connected
Definition at line 360 of file DB.class.php.
Return error status
- Returns
- boolean true: error, false: no error
Definition at line 486 of file DB.class.php.
Return dbms supportable status The value is set in the child class
- Returns
- boolean true: is supported, false: is not supported
Definition at line 349 of file DB.class.php.
DB::putCountCache |
( |
|
$tables, |
|
|
|
$condition, |
|
|
|
$count = 0 |
|
) |
| |
Save counter cache data
- Parameters
-
array | string | $tables | tables to save data |
string | $condition | condition to save data |
int | $count | count of cache data to save |
- Returns
- void
Definition at line 732 of file DB.class.php.
DB::resetCountCache |
( |
|
$tables | ) |
|
Reset counter cache data
- Parameters
-
array | string | $tables | tables to reset cache data |
- Returns
- boolean true: success, false: failed
Definition at line 770 of file DB.class.php.
DB::setError |
( |
|
$errno = 0 , |
|
|
|
$errstr = 'success' |
|
) |
| |
set error
- Parameters
-
int | $errno | error code |
string | $errstr | error message |
- Returns
- void
Definition at line 476 of file DB.class.php.
set query debug log
- Parameters
-
array | $log | values set query debug |
- Returns
- void
Definition at line 465 of file DB.class.php.
DB::$cache_file = 'files/cache/queries/' |
Initial value:= array(
'equal' => '=',
'more' => '>=',
'excess' => '>',
'less' => '<=',
'below' => '<',
'notequal' => '<>',
'notnull' => 'is not null',
'null' => 'is null',
)
Definition at line 44 of file DB.class.php.
DB::$count_cache_path = 'files/cache/db' |
DB::$elapsed_dbclass_time = 0 |
DB::$is_connected = FALSE |
Initial value:= array(
'mysqli' => 6,
'mysqli_innodb' => 5,
'mysql' => 4,
'mysql_innodb' => 3,
'cubrid' => 2,
'mssql' => 1
)
Definition at line 25 of file DB.class.php.
DB::$supported_list = array() |
|
static |
DB::$transaction_started = FALSE |
DB::$use_prepared_statements |
The documentation for this class was generated from the following file: