From b83382ceeee778afe6f9bb2c133384229af9ef60 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Sun, 13 Oct 2019 01:35:54 +0900 Subject: [PATCH] Update pgkcp.lnk.php --- helper/pgkcp.lnk.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/helper/pgkcp.lnk.php b/helper/pgkcp.lnk.php index 4300ee2..dd2108e 100644 --- a/helper/pgkcp.lnk.php +++ b/helper/pgkcp.lnk.php @@ -12,6 +12,7 @@ if(!defined("_DEF_RSF_")) set_error_exit("do not allow access"); loadHelper("json.format"); loadHelper("webpagetool"); loadHelper("compress.zip"); +loadHelper("exectool"); if(!check_function_exists("get_pgkcp_config")) { function get_pgkcp_dir() { @@ -104,20 +105,29 @@ if(!check_function_exists("load_pgkcp_library")) { } if(!check_function_exists("install_pgkcp")) { - function install_pgkcp($platform="LINUX") { + function install_pgkcp() { $response = get_web_page("https://admin8.kcp.co.kr/assist/download/sampleDownload", "get", array( "type1" => "FM01", "type2" => "FS04" )); + + // step 1 $fw = write_storage_file($response['content'], array( "extension" => "zip" )); @unzip($fw, get_storage_path()); + + // step 2 $fw = write_storage_file("", array( "mode" => "fake", - "filename" => sprintf("NHNKCP_PAYMENT_STANDARD_PHP/NHNKCP_PAYMENT_STANDARD_%s_PHP.zip", $platform), + "filename" => sprintf("NHNKCP_PAYMENT_STANDARD_PHP/NHNKCP_PAYMENT_STANDARD_LINUX_PHP.zip"), )); - @mkdir(get_pgkcp_dir(), 0707); - return @unzip($fw, get_pgkcp_dir()); + @unzip($fw, get_storage_path()); + + // step 3 + exec_command("cp -r %s/NHNKCP_PAYMENT_STANDARD_LINUX_PHP/* %s/", get_storage_path(), get_pgkcp_dir()); + + // if success, directory exists + return is_dir(get_pgkcp_dir()); } }