mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-03 01:03:28 +09:00
issue 2109 Fixed a problem in_array function
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10832 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
e1ae5aab97
commit
1a7a68efea
18 changed files with 52 additions and 30 deletions
|
|
@ -422,7 +422,8 @@
|
|||
$id = $id_args[1];
|
||||
} elseif(count($id_args) == 3) {
|
||||
$target = $id_args[0];
|
||||
if(!in_array($target, array('addons','widgets'))){
|
||||
$typeList = array('addons'=>1, 'widgets'=>1);
|
||||
if(!isset($typeList[$target])){
|
||||
$this->actDBClassFinish();
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -440,6 +440,7 @@
|
|||
$unique_list = array();
|
||||
$index_list = array();
|
||||
|
||||
$typeList = array('number'=>1, 'text'=>1);
|
||||
foreach($columns as $column) {
|
||||
$name = $column->attrs->name;
|
||||
$type = $column->attrs->type;
|
||||
|
|
@ -454,7 +455,7 @@
|
|||
$column_schema[] = sprintf('[%s] %s%s %s %s %s',
|
||||
$name,
|
||||
$this->column_type[$type],
|
||||
!in_array($type,array('number','text'))&&$size?'('.$size.')':'',
|
||||
!isset($typeList[$type])&&$size?'('.$size.')':'',
|
||||
isset($default)?"default '".$default."'":'',
|
||||
$notnull?'not null':'null',
|
||||
$auto_increment?'identity(1,1)':''
|
||||
|
|
|
|||
|
|
@ -125,7 +125,11 @@
|
|||
// if variable is not set or is not string or number, return
|
||||
if(!isset($this->_value)) { $this->_show = false; break;}
|
||||
if($this->_value === '') { $this->_show = false; break; }
|
||||
if(!in_array(gettype($this->_value), array('string', 'integer'))) {$this->_show = false; break; }
|
||||
$tmpArray = array('string'=>1, 'integer'=>1);
|
||||
if(!isset($tmpArray[gettype($this->_value)]))
|
||||
{
|
||||
$this->_show = false; break;
|
||||
}
|
||||
break;
|
||||
case 'between' :
|
||||
if(!is_array($this->_value)) { $this->_show = false; break;}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@
|
|||
*/
|
||||
function ConditionWithoutArgument($column_name, $argument, $operation, $pipe = ""){
|
||||
parent::Condition($column_name, $argument, $operation, $pipe);
|
||||
if(in_array($operation, array('in', 'notin', 'not_in'))){
|
||||
$tmpArray = array('in'=>1, 'notin'=>1, 'not_in'=>1);
|
||||
if(isset($tmpArray[$operation])){
|
||||
if(is_array($argument)) $argument = implode($argument, ',');
|
||||
$this->_value = '('. $argument .')';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,9 +37,10 @@
|
|||
$result = parent::toString();
|
||||
|
||||
$index_hint_string = '';
|
||||
$indexTypeList = array('USE'=>1, 'FORCE'=>1);
|
||||
foreach($this->index_hints_list as $index_hint){
|
||||
$index_hint_type = $index_hint->getIndexHintType();
|
||||
if(in_array($index_hint_type, array('USE', 'FORCE')))
|
||||
if(isset($indexTypeList[$index_hint_type]))
|
||||
$index_hint_string .= 'INDEX(' . $index_hint->getIndexName() . '), ';
|
||||
}
|
||||
if($index_hint_string != ''){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue