Update database.php
This commit is contained in:
parent
997131e327
commit
60726530f3
|
|
@ -671,26 +671,6 @@ if(!check_function_exists("get_timediff_on_query")) {
|
|||
}
|
||||
}
|
||||
|
||||
// get assoc from json raw data
|
||||
if(!check_function_exists("json_decode_to_assoc")) {
|
||||
function json_decode_to_assoc($data) {
|
||||
$result = array();
|
||||
|
||||
$invalid_fn = array(
|
||||
"NO_FUNCTION_JSON_DECODE" => "json_decode",
|
||||
"NO_FUNCTION_JSON_LAST_ERROR" => "json_last_error",
|
||||
);
|
||||
|
||||
$error = check_invaild_function($invalid_fn);
|
||||
if($error < 0) {
|
||||
$obj = @json_decode($data, true);
|
||||
$result = (@json_last_error() === 0) ? $obj : $result;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
// temporary table
|
||||
if(!check_function_exists("exec_db_temp_start")) {
|
||||
function exec_db_temp_start($sql, $bind=array(), $options=array()) {
|
||||
|
|
@ -717,5 +697,14 @@ if(!check_function_exists("close_db_connect")) {
|
|||
}
|
||||
}
|
||||
|
||||
// get assoc from json raw data
|
||||
if(!check_function_exists("json_decode_to_assoc")) {
|
||||
function json_decode_to_assoc($data) {
|
||||
if(loadHelper("json.format")) {
|
||||
return json_decode_ex($data, array("assoc" => true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// set scope dbc
|
||||
set_scope("dbc", get_db_connect());
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user