mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +09:00
Issue 1851: Fix PHP Warnings and notices in DB Classes
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10537 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
23e508e1b8
commit
1bc92129b0
31 changed files with 164 additions and 89 deletions
|
|
@ -214,9 +214,8 @@
|
|||
* @param[in] $db_type type of db to check
|
||||
* @return true: is supported, false: is not supported
|
||||
**/
|
||||
function isSupported($db_type) {
|
||||
$supported_list = DB::getSupportedList();
|
||||
return in_array($db_type, $supported_list);
|
||||
function isSupported() {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -634,7 +633,7 @@
|
|||
}
|
||||
|
||||
function _getConnection($type = 'master', $indx = NULL){
|
||||
if($type == master){
|
||||
if($type == 'master'){
|
||||
if(!$this->master_db['is_connected'])
|
||||
$this->_connect($type);
|
||||
$this->connection = 'Master ' . $this->master_db['db_hostname'];
|
||||
|
|
@ -767,7 +766,7 @@
|
|||
$this->use_prepared_statements = $db_info->use_prepared_statements;
|
||||
}
|
||||
|
||||
function __connect(){
|
||||
function __connect($connection){
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -525,6 +525,10 @@
|
|||
|
||||
$query = sprintf ("alter class \"%s\" add attribute ", $table_name);
|
||||
|
||||
$primary_list = array();
|
||||
$unique_list = array();
|
||||
$index_list = array();
|
||||
|
||||
foreach ($columns as $column) {
|
||||
$name = $column->attrs->name;
|
||||
$type = $column->attrs->type;
|
||||
|
|
@ -723,7 +727,7 @@
|
|||
$count_query .= (__DEBUG_QUERY__&1 && $queryObject->query_id)?sprintf (' '.$this->comment_syntax, $this->query_id):'';
|
||||
$result = $this->_query($count_query, $connection);
|
||||
$count_output = $this->_fetch($result);
|
||||
$total_count = (int)$count_output->count;
|
||||
$total_count = (int)(isset($count_output->output) ? $count_output->count : NULL);
|
||||
|
||||
$list_count = $limit->list_count->getValue();
|
||||
if (!$list_count) $list_count = 20;
|
||||
|
|
@ -773,8 +777,9 @@
|
|||
return $buff;
|
||||
}
|
||||
|
||||
function getParser(){
|
||||
return new DBParser('"', '"', $this->prefix);
|
||||
function &getParser($force = FALSE){
|
||||
$dbParser = new DBParser('"', '"', $this->prefix);
|
||||
return $dbParser;
|
||||
}
|
||||
|
||||
function getSelectPageSql($query, $with_values = true, $start_count = 0, $list_count = 0) {
|
||||
|
|
|
|||
|
|
@ -377,6 +377,10 @@
|
|||
if(!is_array($xml_obj->table->column)) $columns[] = $xml_obj->table->column;
|
||||
else $columns = $xml_obj->table->column;
|
||||
|
||||
$primary_list = array();
|
||||
$unique_list = array();
|
||||
$index_list = array();
|
||||
|
||||
foreach($columns as $column) {
|
||||
$name = $column->attrs->name;
|
||||
$type = $column->attrs->type;
|
||||
|
|
@ -459,7 +463,7 @@
|
|||
$alias_list = '';
|
||||
foreach($tables as $table)
|
||||
$alias_list .= $table->getAlias();
|
||||
join(',', split(' ', $alias_list));
|
||||
implode(',', explode(' ', $alias_list));
|
||||
|
||||
$where = $query->getWhereString($with_values);
|
||||
if($where != '') $where = ' WHERE ' . $where;
|
||||
|
|
@ -478,7 +482,7 @@
|
|||
return $this->_query($query);
|
||||
}
|
||||
|
||||
function getSelectSql($query){
|
||||
function getSelectSql($query, $with_values = TRUE){
|
||||
$with_values = false;
|
||||
|
||||
//$limitOffset = $query->getLimit()->getOffset();
|
||||
|
|
@ -536,8 +540,9 @@
|
|||
else return $this->queryPageLimit($queryObject, $result, $connection);
|
||||
}
|
||||
|
||||
function getParser(){
|
||||
return new DBParser("[", "]", $this->prefix);
|
||||
function &getParser($force = FALSE){
|
||||
$dbParser = new DBParser("[", "]", $this->prefix);
|
||||
return $dbParser;
|
||||
}
|
||||
|
||||
function queryError($queryObject){
|
||||
|
|
@ -597,11 +602,10 @@
|
|||
$buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count);
|
||||
return $buff;
|
||||
}
|
||||
|
||||
$start_count = ($page - 1) * $list_count;
|
||||
|
||||
$query .= (__DEBUG_QUERY__ & 1 && $queryObject->query_id) ? sprintf(' ' . $this->comment_syntax, $this->query_id) : '';
|
||||
$this->param = $queryObject->getArguments();
|
||||
$virtual_no = $total_count - ($page - 1) * $list_count;
|
||||
$virtual_no = $total_count - $start_count;
|
||||
$data = $this->_fetch($result, $virtual_no);
|
||||
|
||||
$buff = new Object ();
|
||||
|
|
|
|||
|
|
@ -317,6 +317,10 @@
|
|||
if(!is_array($xml_obj->table->column)) $columns[] = $xml_obj->table->column;
|
||||
else $columns = $xml_obj->table->column;
|
||||
|
||||
$primary_list = array();
|
||||
$unique_list = array();
|
||||
$index_list = array();
|
||||
|
||||
foreach($columns as $column) {
|
||||
$name = $column->attrs->name;
|
||||
$type = $column->attrs->type;
|
||||
|
|
@ -399,6 +403,7 @@
|
|||
**/
|
||||
function _executeSelectAct($queryObject, $connection = null, $with_values = true) {
|
||||
$limit = $queryObject->getLimit();
|
||||
$result = NULL;
|
||||
if ($limit && $limit->isPageHandler())
|
||||
return $this->queryPageLimit($queryObject, $result, $connection, $with_values);
|
||||
else {
|
||||
|
|
@ -433,8 +438,9 @@
|
|||
return mysql_free_result($result);
|
||||
}
|
||||
|
||||
function getParser(){
|
||||
return new DBParser('`', '`', $this->prefix);
|
||||
function &getParser($force = FALSE){
|
||||
$dbParser = new DBParser('`', '`', $this->prefix);
|
||||
return $dbParser;
|
||||
}
|
||||
|
||||
function queryError($queryObject){
|
||||
|
|
@ -459,6 +465,7 @@
|
|||
|
||||
// Check for distinct query and if found update count query structure
|
||||
$temp_select = $queryObject->getSelectString($with_values);
|
||||
$uses_distinct = false;
|
||||
if(strpos(strtolower($temp_select), "distinct") !== false) {
|
||||
$count_query = sprintf('select %s %s %s', 'FROM ' . $queryObject->getFromString($with_values), $temp_select, ($temp_where === '' ? '' : ' WHERE '. $temp_where));
|
||||
$uses_distinct = true;
|
||||
|
|
@ -472,7 +479,7 @@
|
|||
$count_query .= (__DEBUG_QUERY__&1 && $queryObject->query_id)?sprintf (' '.$this->comment_syntax, $this->query_id):'';
|
||||
$result_count = $this->_query($count_query, $connection);
|
||||
$count_output = $this->_fetch($result_count);
|
||||
$total_count = (int)$count_output->count;
|
||||
$total_count = (int)(isset($count_output->count) ? $count_output->count : NULL);
|
||||
|
||||
$list_count = $limit->list_count->getValue();
|
||||
if (!$list_count) $list_count = 20;
|
||||
|
|
|
|||
|
|
@ -247,46 +247,46 @@
|
|||
return $output;
|
||||
}
|
||||
|
||||
function _executeInsertAct($queryObject){
|
||||
function _executeInsertAct($queryObject, $with_values = false){
|
||||
if($this->use_prepared_statements != 'Y')
|
||||
{
|
||||
return parent::_executeInsertAct($queryObject);
|
||||
}
|
||||
$this->param = $queryObject->getArguments();
|
||||
$result = parent::_executeInsertAct($queryObject, false);
|
||||
$result = parent::_executeInsertAct($queryObject, $with_values);
|
||||
unset($this->param);
|
||||
return $result;
|
||||
}
|
||||
|
||||
function _executeUpdateAct($queryObject) {
|
||||
function _executeUpdateAct($queryObject, $with_values = false) {
|
||||
if($this->use_prepared_statements != 'Y')
|
||||
{
|
||||
return parent::_executeUpdateAct($queryObject);
|
||||
}
|
||||
$this->param = $queryObject->getArguments();
|
||||
$result = parent::_executeUpdateAct($queryObject, false);
|
||||
$result = parent::_executeUpdateAct($queryObject, $with_values);
|
||||
unset($this->param);
|
||||
return $result;
|
||||
}
|
||||
|
||||
function _executeDeleteAct($queryObject) {
|
||||
function _executeDeleteAct($queryObject, $with_values = false) {
|
||||
if($this->use_prepared_statements != 'Y')
|
||||
{
|
||||
return parent::_executeDeleteAct($queryObject);
|
||||
}
|
||||
$this->param = $queryObject->getArguments();
|
||||
$result = parent::_executeDeleteAct($queryObject, false);
|
||||
$result = parent::_executeDeleteAct($queryObject, $with_values);
|
||||
unset($this->param);
|
||||
return $result;
|
||||
}
|
||||
|
||||
function _executeSelectAct($queryObject, $connection = null) {
|
||||
function _executeSelectAct($queryObject, $connection = null, $with_values = false) {
|
||||
if($this->use_prepared_statements != 'Y')
|
||||
{
|
||||
return parent::_executeSelectAct($queryObject, $connection);
|
||||
}
|
||||
$this->param = $queryObject->getArguments();
|
||||
$result = parent::_executeSelectAct($queryObject, $connection, false);
|
||||
$result = parent::_executeSelectAct($queryObject, $connection, $with_values);
|
||||
unset($this->param);
|
||||
return $result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@
|
|||
, $conditions = null
|
||||
, $groups = null
|
||||
, $orderby = null
|
||||
, $limit = null){
|
||||
, $limit = null
|
||||
, $priority = null){
|
||||
$this->queryID = $queryID;
|
||||
$this->action = $action;
|
||||
$this->priority = $priority;
|
||||
|
|
@ -313,8 +314,8 @@
|
|||
if(count($this->columns) > 0){ // The if is for delete statements, all others must have columns
|
||||
foreach($this->columns as $column){
|
||||
if($column->show()){
|
||||
$arg = $column->getArgument();
|
||||
if($arg) $this->arguments[] = $arg;
|
||||
$args = $column->getArguments();
|
||||
if($args) $this->arguments = array_merge($this->arguments, $args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -339,4 +340,4 @@
|
|||
|
||||
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
function toString($with_values = true){
|
||||
$oDB = &DB::getInstance();
|
||||
|
||||
return '(' .$oDB->getSelectSql($this, $with_values) . ')';
|
||||
|
||||
}
|
||||
|
|
@ -38,5 +39,3 @@
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -31,6 +31,14 @@
|
|||
function getArgument(){
|
||||
return $this->argument;
|
||||
}
|
||||
|
||||
function getArguments()
|
||||
{
|
||||
if ($this->argument)
|
||||
return array($this->argument);
|
||||
else
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -33,8 +33,13 @@
|
|||
return null;
|
||||
}
|
||||
|
||||
function getArguments()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
function isSubquery(){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -16,5 +16,10 @@
|
|||
function getArgument(){
|
||||
return null;
|
||||
}
|
||||
|
||||
function getArguments(){
|
||||
// StarExpression has no arguments
|
||||
return array();
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -52,7 +52,15 @@
|
|||
function getArgument(){
|
||||
return $this->argument;
|
||||
}
|
||||
|
||||
function getArguments()
|
||||
{
|
||||
if ($this->argument)
|
||||
return array($this->argument);
|
||||
else
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,18 @@
|
|||
<?php
|
||||
|
||||
/* Element node or attribute node. */
|
||||
class Xml_Node_
|
||||
{
|
||||
/** In PHP5 this will silence E_STRICT warnings
|
||||
* for undeclared properties.
|
||||
* No effect in PHP4
|
||||
*/
|
||||
function __get($name)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @class XmlParser
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
|
|
@ -39,7 +53,7 @@
|
|||
* @param[in] a data buffer containing xml data
|
||||
* @return Returns a resultant data object or NULL in case of error
|
||||
**/
|
||||
function parse($input = '') {
|
||||
function parse($input = '', $arg1 = NULL, $arg2 = NULL) {
|
||||
// Save the compile starting time for debugging
|
||||
if(__DEBUG__==3) $start = getMicroTime();
|
||||
|
||||
|
|
@ -92,8 +106,9 @@
|
|||
* @param[in] $attrs attributes to be set
|
||||
*/
|
||||
function _tagOpen($parser, $node_name, $attrs) {
|
||||
$obj = new Xml_Node_();
|
||||
$obj->node_name = strtolower($node_name);
|
||||
$obj->attrs = $this->_arrToObj($attrs);
|
||||
$obj->attrs = $this->_arrToAttrsObj($attrs);
|
||||
|
||||
array_push($this->output, $obj);
|
||||
}
|
||||
|
|
@ -133,6 +148,9 @@
|
|||
array_push($parent_obj->{$node_name}, $cur_obj);
|
||||
}
|
||||
} else {
|
||||
if (!is_object($parent_obj))
|
||||
$parent_obj = (object)$parent_obj;
|
||||
|
||||
$parent_obj->{$node_name} = $cur_obj;
|
||||
}
|
||||
}
|
||||
|
|
@ -141,8 +159,8 @@
|
|||
* @brief method to transfer values in an array to a data object
|
||||
* @param[in] $arr data array
|
||||
**/
|
||||
function _arrToObj($arr) {
|
||||
if(!count($arr)) return;
|
||||
function _arrToAttrsObj($arr) {
|
||||
$output = new Xml_Node_();
|
||||
foreach($arr as $key => $val) {
|
||||
$key = strtolower($key);
|
||||
$output->{$key} = $val;
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
return $theInstance;
|
||||
}
|
||||
|
||||
function parse($query_id, $xml_file, $cache_file) {
|
||||
function parse($query_id = NULL, $xml_file = NULL, $cache_file = NULL) {
|
||||
|
||||
// Read xml file
|
||||
$xml_obj = $this->getXmlFileContent($xml_file);
|
||||
|
|
@ -67,12 +67,11 @@
|
|||
if(!$action) return;
|
||||
|
||||
$parser = new QueryParser($xml_obj->query);
|
||||
|
||||
FileHandler::writeFile($cache_file, $parser->toString());
|
||||
FileHandler::writeFile($cache_file, $parser->toString());
|
||||
}
|
||||
|
||||
function getXmlFileContent($xml_file){
|
||||
$buff = FileHandler::readFile($xml_file);
|
||||
$buff = FileHandler::readFile($xml_file);
|
||||
$xml_obj = parent::parse($buff);
|
||||
if(!$xml_obj) return;
|
||||
unset($buff);
|
||||
|
|
|
|||
|
|
@ -4,8 +4,9 @@
|
|||
|
||||
var $queryTag;
|
||||
|
||||
function QueryParser($query, $isSubQuery = false) {
|
||||
$this->queryTag = new QueryTag($query, $isSubQuery);
|
||||
function QueryParser($query = NULL, $isSubQuery = false) {
|
||||
if ($query)
|
||||
$this->queryTag = new QueryTag($query, $isSubQuery);
|
||||
}
|
||||
|
||||
function getTableInfo($query_id, $table_name) {
|
||||
|
|
@ -22,7 +23,9 @@
|
|||
return;
|
||||
$module = $id_args[1];
|
||||
$id = $id_args[2];
|
||||
}
|
||||
} else {
|
||||
return $column_type;
|
||||
}
|
||||
|
||||
// get column properties from the table
|
||||
$table_file = sprintf('%s%s/%s/schemas/%s.xml', _XE_PATH_, 'modules', $module, $table_name);
|
||||
|
|
@ -62,4 +65,4 @@
|
|||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
function createConditionValue(){
|
||||
if(!isset($this->value)) return;
|
||||
|
||||
$name = $this->column_name;
|
||||
$operation = $this->operation;
|
||||
$value = $this->value;
|
||||
|
||||
|
|
@ -98,4 +97,4 @@
|
|||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@
|
|||
//if($str_pos===false) return $this->value;
|
||||
|
||||
$func_name = substr($this->value, 0, $str_pos);
|
||||
$args = substr($this->value, $str_pos+1, strlen($value)-1);
|
||||
$args = substr($this->value, $str_pos+1, -1);
|
||||
|
||||
switch($func_name) {
|
||||
case 'ipaddress' :
|
||||
|
|
@ -106,5 +106,3 @@
|
|||
return $this->value;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -90,7 +90,7 @@ class QueryArgument {
|
|||
$arg = sprintf("\n" . '${\'%s_argument\'} = new Argument(\'%s\', %s);' . "\n"
|
||||
, $this->argument_name
|
||||
, $this->variable_name
|
||||
, $this->ignore_value ? 'null' : '$args->' . $this->variable_name);
|
||||
, $this->ignore_value ? 'null' : '$args->{\'' . $this->variable_name . '\'}');
|
||||
|
||||
$arg .= $this->argument_validator->toString();
|
||||
|
||||
|
|
|
|||
|
|
@ -12,15 +12,20 @@
|
|||
var $click_count;
|
||||
|
||||
function SelectColumnTag($column){
|
||||
parent::ColumnTag($column->attrs->name);
|
||||
if(!$this->name) $this->name = "*";
|
||||
if($this->name != "*") {
|
||||
$dbParser = DB::getParser();
|
||||
$this->name = $dbParser->parseExpression($this->name);
|
||||
if ($column == "*" || $column->attrs->name == '*')
|
||||
{
|
||||
parent::ColumnTag(NULL);
|
||||
$this->name = "*";
|
||||
}
|
||||
else
|
||||
{
|
||||
parent::ColumnTag($column->attrs->name);
|
||||
$dbParser = new DB(); $dbParser = &$dbParser->getParser();
|
||||
$this->name = $dbParser->parseExpression($this->name);
|
||||
|
||||
$this->alias = $column->attrs->alias;
|
||||
$this->click_count = $column->attrs->click_count;
|
||||
$this->alias = $column->attrs->alias;
|
||||
$this->click_count = $column->attrs->click_count;
|
||||
}
|
||||
}
|
||||
|
||||
function getExpressionString(){
|
||||
|
|
@ -31,4 +36,3 @@
|
|||
return sprintf('new SelectExpression(\'%s\'%s)', $this->name, $this->alias ? ', \''.$dbParser->escape($this->alias) .'\'': '');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -4,6 +4,9 @@
|
|||
var $columns;
|
||||
|
||||
function SelectColumnsTag($xml_columns_tag){
|
||||
if (!$xml_columns_tag)
|
||||
$xml_columns_tag = new Xml_Node_();
|
||||
|
||||
$xml_columns = $xml_columns_tag->column;
|
||||
$xml_queries = $xml_columns_tag->query;
|
||||
|
||||
|
|
@ -54,4 +57,4 @@
|
|||
return $arguments;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -107,4 +107,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
function ConditionsTag($xml_conditions){
|
||||
$this->condition_groups = array();
|
||||
if (!$xml_conditions)
|
||||
return;
|
||||
|
||||
$xml_condition_list = array();
|
||||
if($xml_conditions->condition)
|
||||
|
|
@ -45,4 +47,4 @@
|
|||
return $arguments;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
if($xml_groups) {
|
||||
if(!is_array($xml_groups)) $xml_groups = array($xml_groups);
|
||||
|
||||
$dbParser = DB::getParser();
|
||||
$dbParser = &DB::getParser();
|
||||
for($i=0;$i<count($xml_groups);$i++) {
|
||||
$group = $xml_groups[$i];
|
||||
$column = trim($group->attrs->column);
|
||||
|
|
@ -32,4 +32,4 @@
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
$this->argument_name = $index->attrs->var;
|
||||
|
||||
// Sort index - column by which to sort
|
||||
//$dbParser = DB::getParser();
|
||||
//$dbParser = new DB(); $dbParser = &$dbParser->getParser();
|
||||
//$index->attrs->default = $dbParser->parseExpression($index->attrs->default);
|
||||
$this->default = $index->attrs->default;
|
||||
$this->argument = new QueryArgument($index);
|
||||
|
|
@ -19,6 +19,8 @@
|
|||
// Sort order - asc / desc
|
||||
$this->sort_order = $index->attrs->order;
|
||||
if(!in_array($this->sort_order, array("asc", "desc"))){
|
||||
$arg = new Xml_Node_();
|
||||
$arg->attrs = new Xml_Node_();
|
||||
$arg->attrs->var = $this->sort_order;
|
||||
$arg->attrs->default = 'asc';
|
||||
$this->sort_order_argument = new SortQueryArgument($arg);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
var $list_count;
|
||||
|
||||
function LimitTag($index){
|
||||
if($index->page->attrs && $index->page_count->attrs){
|
||||
if($index->page && $index->page->attrs && $index->page_count && $index->page_count->attrs){
|
||||
$this->page = new QueryArgument($index->page);
|
||||
$this->page_count = new QueryArgument($index->page_count);
|
||||
$this->arguments[] = $this->page;
|
||||
|
|
|
|||
|
|
@ -15,19 +15,19 @@
|
|||
foreach($order as $order_info) {
|
||||
$this->order[] = new IndexTag($order_info);
|
||||
}
|
||||
}
|
||||
|
||||
if($xml_navigation->page->attrs || $xml_navigation->list_count->attrs)
|
||||
if($xml_navigation->page && $xml_navigation->page->attrs || $xml_navigation->list_count && $xml_navigation->list_count->attrs)
|
||||
$this->limit = new LimitTag($xml_navigation);
|
||||
|
||||
$list_count = $xml_navigation->list_count->attrs;
|
||||
$this->list_count = $list_count;
|
||||
if ($xml_navigation->list_count)
|
||||
$this->list_count = $xml_navigation->list_count->attrs;
|
||||
|
||||
$page_count = $xml_navigation->page_count->attrs;
|
||||
$this->page_count = $page_count;
|
||||
if ($xml_navigation->page_count)
|
||||
$this->page_count = $xml_navigation->page_count->attrs;
|
||||
|
||||
$page = $xml_navigation->page->attrs;
|
||||
$this->page = $page ;
|
||||
if ($xml_navigation->page)
|
||||
$this->page = $xml_navigation->page->attrs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -56,4 +56,4 @@
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -104,7 +104,8 @@ class QueryTag {
|
|||
$table_alias = $argument->getTableName();
|
||||
if(isset($table_alias))
|
||||
{
|
||||
$column_type = $this->column_type[$this->getQueryId()][$table_alias][$argument->getColumnName()];
|
||||
if (isset($this->column_type[$this->getQueryId()][$table_alias][$argument->getColumnName()]))
|
||||
$column_type = $this->column_type[$this->getQueryId()][$table_alias][$argument->getColumnName()];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -112,7 +113,7 @@ class QueryTag {
|
|||
$column_name = $argument->getColumnName();
|
||||
foreach($current_tables as $current_table)
|
||||
{
|
||||
if($current_table[$column_name])
|
||||
if(isset($current_table[$column_name]))
|
||||
$column_type = $current_table[$column_name];
|
||||
}
|
||||
}
|
||||
|
|
@ -169,7 +170,7 @@ class QueryTag {
|
|||
}
|
||||
|
||||
function getTables() {
|
||||
if ($this->query->index_hint->attrs->for == 'ALL' || Context::getDBType() == strtolower($this->query->index_hint->attrs->for))
|
||||
if($this->query->index_hint && ($this->query->index_hint->attrs->for == 'ALL' || Context::getDBType() == strtolower($this->query->index_hint->attrs->for)))
|
||||
return $this->tables = new TablesTag($this->query->tables, $this->query->index_hint);
|
||||
else
|
||||
return $this->tables = new TablesTag($this->query->tables);
|
||||
|
|
@ -180,7 +181,10 @@ class QueryTag {
|
|||
}
|
||||
|
||||
function getGroups() {
|
||||
return $this->groups = new GroupsTag($this->query->groups->group);
|
||||
if ($this->query->groups)
|
||||
return $this->groups = new GroupsTag($this->query->groups->group);
|
||||
else
|
||||
return $this->groups = new GroupsTag(NULL);
|
||||
}
|
||||
|
||||
function getNavigation() {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
$dbType = ucfirst(Context::getDBType());
|
||||
|
||||
$result = sprintf('new %sTableWithHint(\'%s\'%s, array('
|
||||
, $dbType
|
||||
, $dbType == 'Mysqli' ? 'Mysql' : $dbType
|
||||
, $dbParser->escape($this->name)
|
||||
, $this->alias ? ', \'' . $dbParser->escape($this->alias) .'\'' : ', null'
|
||||
//, ', \'' . $dbParser->escape($this->index->name) .'\', \'' . $this->index->type .'\''
|
||||
|
|
@ -45,4 +45,4 @@
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@
|
|||
*/
|
||||
function getTableString(){
|
||||
$dbParser = DB::getParser();
|
||||
|
||||
if($this->isJoinTable()){
|
||||
return sprintf('new JoinTable(\'%s\', \'%s\', "%s", %s)'
|
||||
, $dbParser->escape($this->name)
|
||||
|
|
@ -85,4 +86,4 @@
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -29,8 +29,9 @@
|
|||
$index_nodes = $xml_index_hints_tag->index;
|
||||
if(!is_array($index_nodes)) $index_nodes = array($index_nodes);
|
||||
foreach($index_nodes as $index_node) {
|
||||
if(!$indexes[$index_node->attrs->table]) $indexes[$index_node->attrs->table] = array();
|
||||
if(!isset($indexes[$index_node->attrs->table])) $indexes[$index_node->attrs->table] = array();
|
||||
$count = count($indexes[$index_node->attrs->table]);
|
||||
$indexes[$index_node->attrs->table][$count] = (object) NULL;
|
||||
$indexes[$index_node->attrs->table][$count]->name = $index_node->attrs->name;
|
||||
$indexes[$index_node->attrs->table][$count]->type = $index_node->attrs->type;
|
||||
}
|
||||
|
|
@ -41,7 +42,7 @@
|
|||
$this->tables[] = new QueryTag($tag, true);
|
||||
}
|
||||
else {
|
||||
if($indexes && $indexes[$tag->attrs->name])
|
||||
if(isset($indexes) && $indexes && isset($indexes[$tag->attrs->name]))
|
||||
$this->tables[] = new HintTableTag($tag, $indexes[$tag->attrs->name]);
|
||||
else
|
||||
$this->tables[] = new TableTag($tag);
|
||||
|
|
@ -73,4 +74,4 @@
|
|||
return $arguments;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@
|
|||
foreach($ftp_info as $key => $val) {
|
||||
$buff .= sprintf("\$ftp_info->%s = '%s';\n", $key, str_replace("'","\\'",$val));
|
||||
}
|
||||
$buff .= "?>";
|
||||
$buff .= "?".">";
|
||||
// If safe_mode
|
||||
if(ini_get('safe_mode')) {
|
||||
if(!$ftp_info->ftp_user || !$ftp_info->ftp_password) return new Object(-1,'msg_safe_mode_ftp_needed');
|
||||
|
|
|
|||
0
tools/minify/minify.php
Normal file → Executable file
0
tools/minify/minify.php
Normal file → Executable file
Loading…
Add table
Add a link
Reference in a new issue