Update database.php

This commit is contained in:
Namhyeon Go 2019-10-02 20:33:54 +09:00 committed by GitHub
parent b2041e776a
commit bc59c3bad7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -327,12 +327,20 @@ if(!check_function_exists("get_bind_to_sql_insert")) {
} }
} }
// Deprecated: get_bind_to_sql_where($bind, $excludes) - lower than 1.6
// Now: get_bind_to_sql_where($bind, $options) - 1.6 or above
if(!check_function_exists("get_bind_to_sql_where")) { if(!check_function_exists("get_bind_to_sql_where")) {
// warning: variable k is not protected. do not use variable k and external variable without filter // warning: variable k is not protected. do not use variable k and external variable without filter
function get_bind_to_sql_where($bind, $options=array()) { function get_bind_to_sql_where($bind, $options=array()) {
$s3 = ""; $s3 = "";
$excludes = get_value_on_array("excludes", $options, array()); $excludes = get_value_on_array("excludes", $options, array());
// compatible version 1.5
if(!array_key_equals("compatible", $options, "1.5")) {
// todo
}
if(is_array($bind)) { if(is_array($bind)) {
foreach($bind as $k=>$v) { foreach($bind as $k=>$v) {
if(!in_array($k, $excludes)) { if(!in_array($k, $excludes)) {
@ -398,7 +406,7 @@ if(!check_function_exists("get_bind_to_sql_where")) {
if(!array_key_empty("sql_where", $options)) { if(!array_key_empty("sql_where", $options)) {
$s3 .= sprintf(" %s", $options['sql_where']); $s3 .= sprintf(" %s", $options['sql_where']);
} }
return $s3; return $s3;
} }
} }
@ -536,8 +544,8 @@ if(!check_function_exists("get_bind_to_sql_select")) {
} }
} }
// removed: get_bind_to_sql_update($tablename, $bind, $filters, $options) (lower than 1.6) // Deprecated: get_bind_to_sql_update($tablename, $bind, $filters, $options) - lower than 1.6
// current: get_bind_to_sql_update($tablename, $bind, $options, $_options) (1.6 or above) // Now: get_bind_to_sql_update($tablename, $bind, $options, $_options) - 1.6 or above
if(!check_function_exists("get_bind_to_sql_update")) { if(!check_function_exists("get_bind_to_sql_update")) {
function get_bind_to_sql_update($tablename, $bind, $options=array(), $_options=array()) { function get_bind_to_sql_update($tablename, $bind, $options=array(), $_options=array()) {