From d3e9af255bc199b4dad1981c684c064152aec8d8 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Sun, 13 Oct 2019 00:32:42 +0900 Subject: [PATCH] Update pgkcp.lnk.php --- helper/pgkcp.lnk.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/helper/pgkcp.lnk.php b/helper/pgkcp.lnk.php index ffb9564..fdcf6da 100644 --- a/helper/pgkcp.lnk.php +++ b/helper/pgkcp.lnk.php @@ -2,18 +2,27 @@ /** * @file pgkcp.lnk.php * @date 2018-08-25 + * @updated 2019-10-13 * @author Go Namhyeon * @brief KCP PG(Payment Gateway) Helper */ if(!defined("_DEF_RSF_")) set_error_exit("do not allow access"); +loadHelper("json.format"); + +if(!check_function_exists("get_pgkcp_config")) { + function get_pgkcp_dir() { + return get_current_working_dir() . "/vendor/_dist/pgkcp"; + } +} + if(!check_function_exists("get_pgkcp_config")) { function get_pgkcp_config() { $pgkcp_config = array(); // include configuration file - $inc_file = get_current_working_dir() . "/vendor/pgkcp/cfg/site_conf_inc.php"; + $inc_file = get_pgkcp_dir() . "/cfg/site_conf_inc.php"; if(file_exists($inc_file)) { include($inc_file); @@ -36,7 +45,7 @@ if(!check_function_exists("get_pgkcp_config")) { "storage_type" => "payman" )); if(!empty($fr)) { - $api_config = json_decode($fr, true); + $api_config = json_decode_ex($fr, array("assoc" => true)); $api_config_fields = array("g_conf_gw_url", "g_conf_js_url", "g_conf_site_cd", "g_conf_site_key", "g_conf_site_name"); foreach($api_config_fields as $name) { $pgkcp_config[$name] = get_value_in_array($name, $api_config, $pgkcp_config[$name]); @@ -82,7 +91,7 @@ if(!check_function_exists("get_pgkcp_platform")) { if(!check_function_exists("load_pgkcp_library")) { function load_pgkcp_library() { - $inc_file = get_current_working_dir() . "/vendor/pgkcp/res/pp_cli_hub_lib.php"; + $inc_file = get_pgkcp_dir() . "/res/pp_cli_hub_lib.php"; if(file_exists($inc_file)) { include($inc_file); } else {