Update pgkcp.lnk.php

This commit is contained in:
Namhyeon Go 2018-09-30 02:58:16 +09:00 committed by GitHub
parent 5707ae8d63
commit 9392b63ef8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,6 +30,18 @@ if(!function_exists("get_pgkcp_config")) {
"g_conf_gw_port" => $g_conf_gw_port,
"module_type" => $module_type,
);
// read configuration file
$fr = read_storage_file("api.config.pgkcp.json", array(
"storage_type" => "payman"
));
if(!empty($fr)) {
$api_config = json_decode($fr, 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]);
}
}
} else {
set_error("PGKCP configuration file does not exists.");
show_errors();
@ -53,8 +65,8 @@ if(!function_exists("get_pgkcp_platform")) {
$platform = false;
$exe_files = array(
"linux" => $pgkcp_config['g_conf_home_dir'] . "/bin/pp_cli",
"windows" => $pgkcp_config['g_conf_home_dir'] . "/bin/pp_cli.exe"
"default" => $pgkcp_config['g_conf_home_dir'] . "/bin/pp_cli",
"win32" => $pgkcp_config['g_conf_home_dir'] . "/bin/pp_cli.exe"
);
foreach($exe_files as $k=>$v) {