mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
Moved call to getDBParser from XmlQueryParser.class.php to DB.class.php - because otherwise the XmlQueryParser would have been included even when it was not needed.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9139 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
b012937719
commit
e1bf4523c7
15 changed files with 17 additions and 18 deletions
|
|
@ -21,7 +21,6 @@
|
|||
require(_XE_PATH_.'classes/xml/xmlquery/argument/Argument.class.php');
|
||||
require(_XE_PATH_.'classes/xml/xmlquery/argument/SortArgument.class.php');
|
||||
require(_XE_PATH_.'classes/xml/xmlquery/argument/ConditionArgument.class.php');
|
||||
require(_XE_PATH_.'classes/xml/XmlQueryParser.class.php');
|
||||
|
||||
require(_XE_PATH_.'classes/db/queryparts/expression/Expression.class.php');
|
||||
require(_XE_PATH_.'classes/db/queryparts/expression/SelectExpression.class.php');
|
||||
|
|
@ -76,7 +75,7 @@
|
|||
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
|
||||
* @param[in] $db_type type of db
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@
|
|||
$this->columnList = $columnList;
|
||||
if(count($this->columnList) > 0) {
|
||||
$selectColumns = array();
|
||||
$dbParser = XmlQueryParser::getDBParser();
|
||||
$dbParser = DB::getParser();
|
||||
|
||||
foreach($this->columnList as $columnName){
|
||||
$columnName = $dbParser->escapeColumn($columnName);
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@
|
|||
|
||||
function escapeValue($value){
|
||||
if($this->getType() == 'column_name'){
|
||||
$dbParser = XmlQueryParser::getDBParser();
|
||||
$dbParser = DB::getParser();
|
||||
return $dbParser->parseExpression($value);
|
||||
}
|
||||
if(!isset($value)) return null;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
var $operation = '';
|
||||
|
||||
function DefaultValue($column_name, $value){
|
||||
$dbParser = &XmlQueryParser::getDBParser();
|
||||
$dbParser = &DB::getParser();
|
||||
$this->column_name = $dbParser->parseColumnName($column_name);
|
||||
$this->value = $value;
|
||||
$this->value = $this->_setValue();
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
function InsertColumnTag($column) {
|
||||
parent::ColumnTag($column->attrs->name);
|
||||
$dbParser = XmlQueryParser::getDBParser();
|
||||
$dbParser = DB::getParser();
|
||||
$this->name = $dbParser->parseColumnName($this->name);
|
||||
$this->argument = new QueryArgument($column);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
parent::ColumnTag($column->attrs->name);
|
||||
if(!$this->name) $this->name = "*";
|
||||
if($this->name != "*") {
|
||||
$dbParser = XmlQueryParser::getDBParser();
|
||||
$dbParser = DB::getParser();
|
||||
$this->name = $dbParser->parseExpression($this->name);
|
||||
}
|
||||
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
if($this->name == '*') return "new StarExpression()";
|
||||
if($this->click_count)
|
||||
return sprintf('new ClickCountExpression(%s, %s, $args->%s)', $this->name, $this->alias,$this->click_count);
|
||||
$dbParser = XmlQueryParser::getDBParser();
|
||||
$dbParser = DB::getParser();
|
||||
return sprintf('new SelectExpression(\'%s\'%s)', $this->name, $this->alias ? ', \''.$dbParser->escape($this->alias) .'\'': '');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
function UpdateColumnTag($column) {
|
||||
parent::ColumnTag($column->attrs->name);
|
||||
$dbParser = XmlQueryParser::getDBParser();
|
||||
$dbParser = DB::getParser();
|
||||
$this->name = $dbParser->parseColumnName($this->name);
|
||||
$this->argument = new QueryArgument($column);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
function ConditionTag($condition){
|
||||
$this->operation = $condition->attrs->operation;
|
||||
$this->pipe = $condition->attrs->pipe;
|
||||
$dbParser = XmlQueryParser::getDBParser();
|
||||
$dbParser = DB::getParser();
|
||||
$this->column_name = $dbParser->parseColumnName($condition->attrs->column);
|
||||
|
||||
$isColumnName = strpos($condition->attrs->default, '.');
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
if($xml_groups) {
|
||||
if(!is_array($xml_groups)) $xml_groups = array($xml_groups);
|
||||
|
||||
$dbParser = XmlQueryParser::getDBParser();
|
||||
$dbParser = DB::getParser();
|
||||
for($i=0;$i<count($xml_groups);$i++) {
|
||||
$group = $xml_groups[$i];
|
||||
$column = trim($group->attrs->column);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
$this->argument_name = $index->attrs->var;
|
||||
|
||||
// Sort index - column by which to sort
|
||||
//$dbParser = XmlQueryParser::getDBParser();
|
||||
//$dbParser = DB::getParser();
|
||||
//$index->attrs->default = $dbParser->parseExpression($index->attrs->default);
|
||||
$this->default = $index->attrs->default;
|
||||
$this->argument = new QueryArgument($index);
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
* @param XML <table> tag $table
|
||||
*/
|
||||
function TableTag($table){
|
||||
$dbParser = XmlQueryParser::getDBParser();
|
||||
$dbParser = DB::getParser();
|
||||
|
||||
$this->unescaped_name = $table->attrs->name;
|
||||
$this->name = $dbParser->parseTableName($table->attrs->name);
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
* @return string
|
||||
*/
|
||||
function getTableString(){
|
||||
$dbParser = XmlQueryParser::getDBParser();
|
||||
$dbParser = DB::getParser();
|
||||
if($this->isJoinTable()){
|
||||
return sprintf('new JoinTable(\'%s\', \'%s\', "%s", %s)'
|
||||
, $dbParser->escape($this->name)
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
// remove cache dir
|
||||
FileHandler::removeDir( _XE_PATH_ . 'files/cache');
|
||||
|
||||
XmlQueryParser::getDBParser(true);
|
||||
DB::getParser(true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
$db_info->slave_db = array(array('db_type' => 'cubrid','db_table_prefix' => 'xe_'));
|
||||
|
||||
$oContext->setDbInfo($db_info);
|
||||
XmlQueryParser::getDBParser(true);
|
||||
DB::getParser(true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
// remove cache dir
|
||||
FileHandler::removeDir( _XE_PATH_ . 'files/cache');
|
||||
|
||||
XmlQueryParser::getDBParser(true);
|
||||
DB::getParser(true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
$oContext->setDbInfo($db_info);
|
||||
|
||||
XmlQueryParser::getDBParser(true);
|
||||
DB::getParser(true);
|
||||
}
|
||||
|
||||
protected function tearDown() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue