mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1099 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
7e93e910c7
commit
5a2d1a4018
3 changed files with 35 additions and 31 deletions
|
|
@ -285,7 +285,7 @@
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($default && !is_int($default)) $default = "'".$default."'";
|
if($default && !is_numeric($default)) $default = "'".$default."'";
|
||||||
|
|
||||||
$column_schema[] = sprintf('"%s" %s%s %s %s',
|
$column_schema[] = sprintf('"%s" %s%s %s %s',
|
||||||
$name,
|
$name,
|
||||||
|
|
@ -359,8 +359,10 @@
|
||||||
|
|
||||||
foreach($column as $key => $val) {
|
foreach($column as $key => $val) {
|
||||||
$key_list[] = $key;
|
$key_list[] = $key;
|
||||||
if(is_int($val) || in_array($key, $pass_quotes)) $val_list[] = $this->addQuotes($val);
|
if($val) {
|
||||||
else $val_list[] = '\''.$this->addQuotes($val).'\'';
|
if(is_numeric($val) || in_array($key, $pass_quotes)) $val_list[] = $this->addQuotes($val);
|
||||||
|
else $val_list[] = "'".$this->addQuotes($val)."'";
|
||||||
|
} else $val_list[] = "null";
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = sprintf("insert into %s%s (%s) values (%s);", $this->prefix, $table, '"'.implode('","',$key_list).'"', implode(',', $val_list));
|
$query = sprintf("insert into %s%s (%s) values (%s);", $this->prefix, $table, '"'.implode('","',$key_list).'"', implode(',', $val_list));
|
||||||
|
|
@ -374,10 +376,12 @@
|
||||||
$table = array_pop($tables);
|
$table = array_pop($tables);
|
||||||
|
|
||||||
foreach($column as $key => $val) {
|
foreach($column as $key => $val) {
|
||||||
// args에 아예 해당 key가 없으면 패스
|
|
||||||
if(!isset($args->{$key})) continue;
|
if(!isset($args->{$key})) continue;
|
||||||
if(is_int($val) || in_array($key, $pass_quotes)) $update_list[] = sprintf('"%s" = %s', $key, $this->addQuotes($val));
|
|
||||||
else $update_list[] = sprintf('"%s" = \'%s\'', $key, $this->addQuotes($val));
|
if($vla) {
|
||||||
|
if(is_numeric($val) || in_array($key, $pass_quotes)) $update_list[] = sprintf('"%s" = %s', $key, $this->addQuotes($val));
|
||||||
|
else $update_list[] = sprintf('"%s" = \'%s\'', $key, $this->addQuotes($val));
|
||||||
|
} else $update_list[] = "null";
|
||||||
}
|
}
|
||||||
if(!count($update_list)) return;
|
if(!count($update_list)) return;
|
||||||
$update_query = implode(',',$update_list);
|
$update_query = implode(',',$update_list);
|
||||||
|
|
|
||||||
|
|
@ -58,29 +58,29 @@
|
||||||
// 캐쉬 내용 작성
|
// 캐쉬 내용 작성
|
||||||
$buff =
|
$buff =
|
||||||
sprintf(
|
sprintf(
|
||||||
'<?php if(!defined("__ZBXE__")) exit();'."\n".
|
'<?php if(!defined("__ZBXE__")) exit();'."\n".
|
||||||
'$pass_quotes = array();'."\n".
|
'$pass_quotes = array();'."\n".
|
||||||
'$id = \'%s\';'."\n".
|
'$id = \'%s\';'."\n".
|
||||||
'$action = \'%s\';'."\n".
|
'$action = \'%s\';'."\n".
|
||||||
'$tables = array(%s);'."\n".
|
'$tables = array(%s);'."\n".
|
||||||
'%s'."\n".
|
'%s'."\n".
|
||||||
'%s'."\n".
|
'%s'."\n".
|
||||||
'%s'."\n".
|
'%s'."\n".
|
||||||
'%s'."\n".
|
'%s'."\n".
|
||||||
'%s'."\n".
|
'%s'."\n".
|
||||||
'%s'."\n".
|
'%s'."\n".
|
||||||
'$group_script = \'%s\''."\n".
|
'$group_script = \'%s\''."\n".
|
||||||
'?>',
|
'?>',
|
||||||
$query_id,
|
$query_id,
|
||||||
$action,
|
$action,
|
||||||
$tables,
|
$tables,
|
||||||
$default_script,
|
$default_script,
|
||||||
$column_script,
|
$column_script,
|
||||||
$notnull_script,
|
$notnull_script,
|
||||||
$filter_script,
|
$filter_script,
|
||||||
$condition_script,
|
$condition_script,
|
||||||
$navigation_script,
|
$navigation_script,
|
||||||
$group_script
|
$group_script
|
||||||
);
|
);
|
||||||
|
|
||||||
// 저장
|
// 저장
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@
|
||||||
<table name="modules" />
|
<table name="modules" />
|
||||||
</tables>
|
</tables>
|
||||||
<columns>
|
<columns>
|
||||||
<column name="module_srl" default="module_srl" notnull="notnull" />
|
<column name="module_srl" var="module_srl" notnull="notnull" />
|
||||||
<column name="module_category_srl" default="module_category_srl" />
|
<column name="module_category_srl" var="module_category_srl" default="0" />
|
||||||
<column name="mid" var="mid" notnull="notnull" minlength="1" maxlength="40" />
|
<column name="mid" var="mid" notnull="notnull" minlength="1" maxlength="40" />
|
||||||
<column name="skin" var="skin" minlength="1" maxlength="250" />
|
<column name="skin" var="skin" minlength="1" maxlength="250" />
|
||||||
<column name="browser_title" var="browser_title" notnull="notnull" minlength="1" maxlength="250" />
|
<column name="browser_title" var="browser_title" notnull="notnull" minlength="1" maxlength="250" />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue