Пример #1
0
<?php

//初始化
require_once '../lib/client.php';
$url = 'http://127.0.0.1:8080/api';
$key = 'xkg3ydnm';
$secret = '56dygmyhrfuhuwrdst3c';
$c = new prism_client($url, $key, $secret);
//实时打印log
$c->set_logger(function ($message) {
    echo $message;
    flush();
});
Пример #2
0
 $data['shopexid'] = $_CFG['ent_id'];
 $data['passwd'] = $_CFG['ent_ac'];
 $extend_no = $_POST['extend_no'];
 $content_t = $content_y = $sms_sign[$_CFG['ent_id']][$extend_no];
 $new_content_t = $new_content_y = $_POST['new_sms_sign'];
 if (!isset($sms_sign[$_CFG[ent_id]][$extend_no]) || empty($extend_no)) {
     sys_msg($_LANG['error_smg'], 1, array(), false);
 }
 if (EC_CHARSET != 'utf-8') {
     $content_t = iconv('gb2312', 'utf-8', $content_y);
     $new_content_t = iconv('gb2312', 'utf-8', $new_content_y);
 }
 $url = 'https://openapi.shopex.cn';
 $key = 'qufoxtpr';
 $secret = 't66moqjixb2nntiy2io2';
 $c = new prism_client($url, $key, $secret);
 $params = array('shopexid' => $_CFG['ent_id'], 'passwd' => $_CFG['ent_ac'], 'old_content' => $content_t, 'new_content' => $new_content_t, 'content-type' => 'application/x-www-form-urlencoded');
 $result = $c->post('api/addcontent/update', $params);
 $result = json_decode($result, true);
 if ($result['res'] == 'succ' && !empty($result['data']['new_extend_no'])) {
     $new_extend_no = $result['data']['new_extend_no'];
     unset($sms_sign[$_CFG['ent_id']][$extend_no]);
     $sms_sign[$_CFG['ent_id']][$new_extend_no] = $new_content_y;
     $sms_sign = serialize($sms_sign);
     if (empty($_CFG['default_sms_sign'])) {
         shop_config_update('default_sms_sign', $new_content_y);
     }
     shop_config_update('sms_sign', $sms_sign);
     /* 清除缓存 */
     clear_all_files();
     sys_msg($_LANG['edit_succ'], 1, array(), false);