mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-22 05:15:29 +09:00
issue 157 - Updated code so that no queries will execute when DB is not set and removed default escape char hack.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9129 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
662b3f0915
commit
02c7587226
2 changed files with 4 additions and 8 deletions
|
|
@ -75,6 +75,8 @@
|
||||||
|
|
||||||
var $cache_file = 'files/cache/queries/'; ///< location of query cache
|
var $cache_file = 'files/cache/queries/'; ///< location of query cache
|
||||||
|
|
||||||
|
var $db_type; ///< stores database type: 'mysql','cubrid','mssql' etc. or 'db' when database is not yet set
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief returns instance of certain db type
|
* @brief returns instance of certain db type
|
||||||
* @param[in] $db_type type of db
|
* @param[in] $db_type type of db
|
||||||
|
|
@ -93,6 +95,7 @@
|
||||||
// get a singletone instance of the database driver class
|
// get a singletone instance of the database driver class
|
||||||
require_once($class_file);
|
require_once($class_file);
|
||||||
$GLOBALS['__DB__'][$db_type] = call_user_func(array($class_name, 'create'));
|
$GLOBALS['__DB__'][$db_type] = call_user_func(array($class_name, 'create'));
|
||||||
|
$GLOBALS['__DB__'][$db_type]->db_type = $db_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $GLOBALS['__DB__'][$db_type];
|
return $GLOBALS['__DB__'][$db_type];
|
||||||
|
|
@ -323,6 +326,7 @@
|
||||||
**/
|
**/
|
||||||
function executeQuery($query_id, $args = NULL, $arg_columns = NULL, $database_type = 'master') {
|
function executeQuery($query_id, $args = NULL, $arg_columns = NULL, $database_type = 'master') {
|
||||||
if(!$query_id) return new Object(-1, 'msg_invalid_queryid');
|
if(!$query_id) return new Object(-1, 'msg_invalid_queryid');
|
||||||
|
if(!$this->db_type) return;
|
||||||
|
|
||||||
$this->actDBClassStart();
|
$this->actDBClassStart();
|
||||||
|
|
||||||
|
|
@ -601,12 +605,6 @@
|
||||||
return "INSERT INTO $tableName \n $values";
|
return "INSERT INTO $tableName \n $values";
|
||||||
}
|
}
|
||||||
|
|
||||||
// HACK This is needed because on installation, the XmlQueryParer is used without any configured database
|
|
||||||
// TODO Change this or make sure the query cache files created before db.config exists are deleted
|
|
||||||
function getParser(){
|
|
||||||
return new DBParser('`');
|
|
||||||
}
|
|
||||||
|
|
||||||
function _getSlaveConnectionStringIndex() {
|
function _getSlaveConnectionStringIndex() {
|
||||||
$max = count($this->slave_db);
|
$max = count($this->slave_db);
|
||||||
$indx = rand(0, $max - 1);
|
$indx = rand(0, $max - 1);
|
||||||
|
|
|
||||||
|
|
@ -166,8 +166,6 @@
|
||||||
Context::setDBInfo($db_info);
|
Context::setDBInfo($db_info);
|
||||||
// Create DB Instance
|
// Create DB Instance
|
||||||
$oDB = &DB::getInstance();
|
$oDB = &DB::getInstance();
|
||||||
// Force update dbParser
|
|
||||||
XmlQueryParser::getDBParser(true);
|
|
||||||
// Check if available to connect to the DB
|
// Check if available to connect to the DB
|
||||||
if(!$oDB->isConnected()) return $oDB->getError();
|
if(!$oDB->isConnected()) return $oDB->getError();
|
||||||
// When installing firebire DB, transaction will not be used
|
// When installing firebire DB, transaction will not be used
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue