mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-20 19:59:54 +09:00
Included some missing classes.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8383 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
9a2c0a8ff9
commit
0f61e5d499
8 changed files with 55 additions and 48 deletions
|
|
@ -319,13 +319,16 @@
|
|||
require_once(_XE_PATH_.'classes/db/queryparts/expression/Expression.class.php');
|
||||
require_once(_XE_PATH_.'classes/db/queryparts/expression/SelectExpression.class.php');
|
||||
require_once(_XE_PATH_.'classes/db/queryparts/expression/InsertExpression.class.php');
|
||||
require_once(_XE_PATH_.'classes/db/queryparts/expression/UpdateExpression.class.php');
|
||||
require_once(_XE_PATH_.'classes/db/queryparts/table/Table.class.php');
|
||||
require_once(_XE_PATH_.'classes/db/queryparts/table/JoinTable.class.php');
|
||||
require_once(_XE_PATH_.'classes/db/queryparts/condition/ConditionGroup.class.php');
|
||||
require_once(_XE_PATH_.'classes/db/queryparts/condition/Condition.class.php');
|
||||
require_once(_XE_PATH_.'classes/db/queryparts/expression/StarExpression.class.php');
|
||||
require_once(_XE_PATH_.'classes/db/queryparts/order/OrderByColumn.class.php');
|
||||
|
||||
$output = @include($cache_file);
|
||||
|
||||
$output = include($cache_file);
|
||||
|
||||
if( (is_a($output, 'Object') || is_subclass_of($output, 'Object')) && !$output->toBool()) return $output;
|
||||
$output->_tables = ($output->_tables && is_array($output->_tables)) ? $output->_tables : array();
|
||||
|
|
|
|||
|
|
@ -669,20 +669,20 @@
|
|||
$columnsList = substr($columnsList, 0, -2);
|
||||
$valuesList = substr($valuesList, 0, -2);
|
||||
|
||||
// TODO Make sure column values are escaped. Preferably directly from the cache file and not in here
|
||||
$query = "INSERT INTO $tableName ($columnsList) VALUES ($valuesList)";
|
||||
|
||||
return $query;
|
||||
/*$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf (' '.$this->comment_syntax, $this->query_id):'';
|
||||
$query = "INSERT INTO $tableName \n ($columnsList) \n VALUES ($valuesList)";
|
||||
|
||||
$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf (' '.$this->comment_syntax, $this->query_id):'';
|
||||
$result = $this->_query ($query);
|
||||
if ($result && !$this->transaction_started) {
|
||||
@cubrid_commit ($this->fd);
|
||||
}
|
||||
|
||||
return $result;
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief handles updateAct
|
||||
**/
|
||||
function _executeUpdateAct ($output)
|
||||
{
|
||||
$query = '';
|
||||
|
|
@ -690,34 +690,35 @@
|
|||
$tableName = $output->tables[0]->getName();
|
||||
|
||||
$columnsList = '';
|
||||
$valuesList = '';
|
||||
foreach($output->columns as $column){
|
||||
if($column->show()){
|
||||
$columnsList .= $column->getColumnName() . ', ';
|
||||
$valuesList .= $column->getValue() . ', ';
|
||||
$columnsList .= $column->getExpression() . ', ';
|
||||
}
|
||||
}
|
||||
$columnsList = substr($columnsList, 0, -2);
|
||||
$valuesList = substr($valuesList, 0, -2);
|
||||
|
||||
$where = '';
|
||||
if(count($output->conditions) > 0){
|
||||
$where = 'WHERE ';
|
||||
foreach($output->conditions as $conditionGroup){
|
||||
$where .= $conditionGroup->toString();
|
||||
}
|
||||
}
|
||||
|
||||
// TODO Make sure column values are escaped. Preferably directly from the cache file and not in here
|
||||
$query = "UPDATE INTO $tableName ($columnsList) VALUES ($valuesList)";
|
||||
|
||||
return $query;
|
||||
/*$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf (' '.$this->comment_syntax, $this->query_id):'';
|
||||
$query = "UPDATE $tableName SET $columnsList ".$where;
|
||||
|
||||
|
||||
$result = $this->_query ($query);
|
||||
if ($result && !$this->transaction_started) {
|
||||
@cubrid_commit ($this->fd);
|
||||
}
|
||||
if ($result && !$this->transaction_started) @cubrid_commit ($this->fd);
|
||||
|
||||
return $result;
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief handles deleteAct
|
||||
**/
|
||||
function _executeDeleteAct($output){
|
||||
function _executeDeleteAct ($output)
|
||||
{
|
||||
$query = '';
|
||||
|
||||
$select = 'DELETE ';
|
||||
|
|
@ -737,23 +738,12 @@
|
|||
$where .= $conditionGroup->toString();
|
||||
}
|
||||
}
|
||||
/*
|
||||
$groupBy = '';
|
||||
if($output->groups) if($output->groups[0] !== "")
|
||||
$groupBy = 'GROUP BY ' . implode(', ', $output->groups);
|
||||
|
||||
$orderBy = '';
|
||||
if(count($output->orderby) > 0){
|
||||
$orderBy = 'ORDER BY ';
|
||||
foreach($output->orderby as $order){
|
||||
$orderBy .= $order->toString() .', ';
|
||||
}
|
||||
$orderBy = substr($orderBy, 0, -2);
|
||||
}
|
||||
*/
|
||||
|
||||
$query = $select . ' ' . $from . ' ' . $where . ' ' . $groupBy . ' ' . $orderBy;
|
||||
return $query;
|
||||
$result = $this->_query ($query);
|
||||
if ($result && !$this->transaction_started) @cubrid_commit ($this->fd);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -775,9 +765,14 @@
|
|||
$from = 'FROM ';
|
||||
$simple_table_count = 0;
|
||||
foreach($output->tables as $table){
|
||||
if($simple_table_count > 0) $from .= ', ';
|
||||
/*if($simple_table_count > 0) $from .= ', ';
|
||||
|
||||
$from .= $table->toString() . ' ';
|
||||
if(!$table->isJoinTable()) $simple_table_count++;
|
||||
*/
|
||||
if($table->isJoinTable() || !$simple_table_count) $from .= $table->toString() . ' ';
|
||||
else $from .= ', '.$table->toString() . ' ';
|
||||
$simple_table_count++;
|
||||
}
|
||||
|
||||
$where = '';
|
||||
|
|
@ -803,8 +798,18 @@
|
|||
|
||||
|
||||
$query = $select . ' ' . $from . ' ' . $where . ' ' . $groupBy . ' ' . $orderBy;
|
||||
return $query;
|
||||
}
|
||||
|
||||
//$query = sprintf ("select %s from %s %s %s %s", $columns, implode (',',$table_list), implode (' ',$left_join), $condition, //$groupby_query.$orderby_query);
|
||||
//$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf (' '.$this->comment_syntax, $this->query_id):'';
|
||||
$result = $this->_query ($query);
|
||||
if ($this->isError ()) return;
|
||||
$data = $this->_fetch ($result);
|
||||
|
||||
$buff = new Object ();
|
||||
$buff->data = $data;
|
||||
|
||||
return $buff;
|
||||
}
|
||||
/*function _executeSelectAct ($output)
|
||||
{
|
||||
// tables
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
if(!$this->dbParser){
|
||||
//$oDB = &DB::getParser();
|
||||
//$dbParser = $oDB->getParser();
|
||||
$this->dbParser = new DBParser('`');
|
||||
$this->dbParser = new DBParser('"');
|
||||
}
|
||||
return $this->dbParser;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
if(!isset($this->value)) return;
|
||||
|
||||
$str_pos = strpos($this->value, '(');
|
||||
// TODO Replace this with parseExpression
|
||||
if($str_pos===false) return '"'.$this->value.'"';
|
||||
|
||||
$func_name = substr($this->value, 0, $str_pos);
|
||||
|
|
|
|||
|
|
@ -25,8 +25,6 @@
|
|||
$validator = '';
|
||||
if(isset($this->default_value)){
|
||||
$this->default_value = new DefaultValue($this->argument_name, $this->default_value);
|
||||
//$v = new DefaultCheck($this->argument_name, $this->default_value);
|
||||
//$validator .= $v->toString();
|
||||
$validator .= sprintf("$%s_argument->ensureDefaultValue(%s);\n"
|
||||
, $this->argument_name
|
||||
, $this->default_value->toString()
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
function IndexTag($index, $dbParser){
|
||||
$this->dbParser = $dbParser;
|
||||
$this->argument_name = $index->attrs->var;
|
||||
$index->attrs->default = $this->dbParser->parseExpression($index->attrs->default);
|
||||
//$index->attrs->default = $this->dbParser->parseExpression($index->attrs->default);
|
||||
$this->default = $index->attrs->default;
|
||||
require_once(_XE_PATH_.'classes/xml/xmlquery/queryargument/QueryArgument.class.php');
|
||||
$this->argument = new QueryArgument($index);
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
$this->sort_order_argument = new QueryArgument($arg);
|
||||
$this->sort_order = "\$args->".$this->sort_order;
|
||||
}
|
||||
//else $this->sort_order = '"'.$this->sort_order.'"';
|
||||
else $this->sort_order = '"'.$this->sort_order.'"';
|
||||
}
|
||||
|
||||
function toString(){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue