本文整理汇总了PHP中transport类的典型用法代码示例。如果您正苦于以下问题:PHP transport类的具体用法?PHP transport怎么用?PHP transport使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了transport类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: exchange_shop_license
/**
* 功能:与 ECShop 交换数据
*
* @param array $certi 登录参数
* @param array $license 网店license信息
* @param bool $use_lib 使用哪一个json库,0为ec,1为shopex
* @return array
*/
function exchange_shop_license($certi, $license, $use_lib = 0)
{
if (!is_array($certi)) {
return array();
}
include_once ROOT_PATH . 'includes/cls_transport.php';
include_once ROOT_PATH . 'includes/cls_json.php';
$params = '';
foreach ($certi as $key => $value) {
$params .= '&' . $key . '=' . $value;
}
$params = trim($params, '&');
$transport = new transport();
//$transport->connect_timeout = 1;
$request = $transport->request($license['certi'], $params, 'POST');
$request_str = json_str_iconv($request['body']);
if (empty($use_lib)) {
$json = new JSON();
$request_arr = $json->decode($request_str, 1);
} else {
include_once ROOT_PATH . 'includes/shopex_json.php';
$request_arr = json_decode($request_str, 1);
}
return $request_arr;
}
开发者ID:dlpc,项目名称:ecshop,代码行数:33,代码来源:lib_license.php
示例2: check_fee
public function check_fee()
{
es_session::start();
$last_visit = intval(es_session::get("last_visit_smsbao"));
if (get_gmtime() - $last_visit > 10) {
$sms = new transport();
$params = array("u" => $this->sms['user_name'], "p" => md5($this->sms['password']));
$url = "http://www.smsbao.com/query";
$result = $sms->request($url, $params);
$match = explode(',', $result['body']);
if ($match[0] != '') {
$remain = (int) $match[1];
$str = sprintf('短信宝增值平台 剩余:%d 条', $remain);
} else {
$str = "短信宝增值平台 (<a href='http://www.smsbao.com/reg?r=5001' target='_blank'><font color='red'>还没账号?点击这免费注册</font></a>)";
}
es_session::set("smsbao_info", $str);
es_session::set("last_visit_smsbao", get_gmtime());
return $str;
} else {
$qxt_info = es_session::get("smsbao_info");
if ($smsbao_info) {
return $smsbao_info;
} else {
return "短信宝增值平台 (<a href='http://www.smsbao.com/reg?r=5001' target='_blank'><font color='red'>还没账号?点击这免费注册</font></a>)";
}
}
}
开发者ID:myjavawork,项目名称:sanxin-fangwei,代码行数:28,代码来源:smsbao_sms.php
示例3: exchange_shop_license
/**
* 功能:与 ECShop 交换数据
*
* @param array $certi 登录参数
* @param array $license 网店license信息
* @param bool $use_lib 使用哪一个json库,0为ec,1为shopex
* @return array
*/
function exchange_shop_license($certi, $license, $use_lib = 0)
{
$touch =& get_instance();
if (!is_array($certi)) {
return array();
}
$touch->load->library('transport');
// include_once(ROOT_PATH . 'includes/cls_transport.php');
// include_once(ROOT_PATH . 'includes/cls_json.php');
$params = '';
foreach ($certi as $key => $value) {
$params .= '&' . $key . '=' . $value;
}
$params = trim($params, '&');
$transport = new transport();
//$transport->connect_timeout = 1;
$request = $transport->request($license['certi'], $params, 'POST');
$request_str = json_str_iconv($request['body']);
// if (empty($use_lib))
// {
//$json = new JSON();
$request_arr = json_decode($request_str, 1);
// }
// else
// {
// //include_once(ROOT_PATH . 'includes/shopex_json.php');
// $request_arr = json_decode($request_str, 1);
// }
return $request_arr;
}
开发者ID:connwap135,项目名称:ectouch,代码行数:38,代码来源:license_helper.php
示例4: check_fee
public function check_fee()
{
$sms = new transport();
$params = array("OperID" => $this->sms['user_name'], "OperPass" => $this->sms['password']);
$url = "http://221.179.180.158:9000/QxtSms/surplus";
$result = $sms->request($url, $params);
$result = toArray($result['body'], "resRoot");
$str = "企信通短信平台,剩余:" . $result['rcode'][0] . "条";
return $str;
}
开发者ID:xcdxcd,项目名称:zhongchou,代码行数:10,代码来源:QXT_sms.php
示例5: check_fee
public function check_fee()
{
$sms = new transport();
$url = $this->sms['server_url'] . "get";
$params = json_encode($this->sms);
$result = $sms->request($url, $params);
$result = json_decode($result['body'], 1);
$str = $result['info'];
return $str;
}
开发者ID:workplayteam,项目名称:P2P,代码行数:10,代码来源:FW_sms.php
示例6: _doRegister
/**
* Register the new install with the LC API
*
* @access private
* @return string
*/
private function _doRegister($data)
{
global $lC_Database, $lC_Cache;
if (isset($data['activation_email']) && $data['activation_email'] != NULL) {
$storeEmail = $data['activation_email'];
} else {
$storeEmail = STORE_OWNER_EMAIL_ADDRESS;
}
if (isset($data['activation_serial']) && $data['activation_serial'] != NULL) {
$storeSerial = $data['activation_serial'];
} else {
$storeSerial = '';
}
// register the install with LC API
$registerArr = array('serial' => $storeSerial, 'storeName' => STORE_NAME, 'storeEmail' => $storeEmail, 'storeWWW' => HTTP_SERVER . DIR_WS_HTTP_CATALOG, 'storeSSL' => HTTPS_SERVER . DIR_WS_HTTPS_CATALOG, 'systemMetaData' => base64_encode(json_encode(lc_get_system_information())), 'serverMetaData' => isset($_SERVER) && is_array($_SERVER) ? base64_encode(json_encode($_SERVER)) : NULL, 'envMetaData' => isset($_ENV) && is_array($_ENV) ? base64_encode(json_encode($_ENV)) : NULL);
$checksum = hash('sha256', json_encode($registerArr));
$registerArr['checksum'] = $checksum;
$api_version = defined('API_VERSION') && API_VERSION != NULL ? API_VERSION : '1_0';
$registerArr['ver'] = utility::getVersion();
$request_type = getRequestType();
$resultXML = transport::getResponse(array('url' => $request_type . '://api.loadedcommerce.com/' . $api_version . '/register/install/', 'method' => 'post', 'parameters' => $registerArr, 'timeout' => 10));
$newInstallationID = preg_match("'<installationID[^>]*?>(.*?)</installationID>'i", $resultXML, $regs) == 1 ? $regs[1] : NULL;
$products = preg_match("'<products[^>]*?>(.*?)</products>'i", $resultXML, $regs) == 1 ? $regs[1] : NULL;
if (lC_Server_info_Admin::updateInstallID($newInstallationID)) {
return utility::arr2xml(array('error' => FALSE, 'installationID' => $newInstallationID, 'products' => $products));
} else {
return utility::arr2xml(array('error' => TRUE, 'message' => 'error processing the request'));
}
}
开发者ID:rajeshb001,项目名称:itpl_loaded7,代码行数:35,代码来源:api.php
示例7: initialize
public function initialize()
{
global $lC_Product;
if (defined('MODULE_CONTENT_PRODUCT_ON_HOMEPAGE')) {
$lC_Product = new lC_Product(MODULE_CONTENT_PRODUCT_ON_HOMEPAGE);
$product_url = HTTP_SERVER . DIR_WS_HTTP_CATALOG . 'products.php?' . $lC_Product->getKeyword();
$resultHTML = transport::getResponse(array('url' => $product_url, 'method' => 'get'));
$content = substr($resultHTML, strpos($resultHTML, '<!--content/products/info.php start'));
$this->_content = substr($content, strpos($content, '<!--content/products/info.php start'), strpos($content, 'content/products/info.php end-->') + 32);
}
}
开发者ID:abhiesa-tolexo,项目名称:loaded7,代码行数:11,代码来源:product_on_homepage.php
示例8: call
public function call($operation, $params = '')
{
$this->log .= time() . ": call() called.\n";
if (!stristr($this->url, 'http://')) {
throw new Exception("URL self::{$url} is not correct.");
}
if (!empty($params)) {
$call['method'] = $operation;
$call['params'] = $params;
$postdata = $this->rc4(json_encode($call));
$postdata = 'call=' . str_replace('=', '', base64_encode($postdata));
$http = new transport();
$content = $http->request($this->url, $postdata);
//$a = file_put_contents('debug.txt',base64_decode($content['body']));
$cbody = $this->rc4(base64_decode($content['body']));
return json_decode($cbody, true);
} else {
throw new Exception("params is empty.");
}
}
开发者ID:haseok86,项目名称:millkencode,代码行数:20,代码来源:webremote.php
示例9: locate_geo
/**
* 定位经续度
* @param unknown_type $x 经度
* @param unknown_type $y 纬度
*/
public static function locate_geo($xpoint = 0, $ypoint = 0)
{
$xpoint = floatval($xpoint);
$ypoint = floatval($ypoint);
$current_geo = es_session::get("current_geo");
if ($xpoint != 0) {
$current_geo['xpoint'] = $xpoint;
$current_geo['address'] = "";
} elseif (empty($current_geo['xpoint'])) {
$current_geo['xpoint'] = 0;
}
if ($ypoint != 0) {
$current_geo['ypoint'] = $ypoint;
$current_geo['address'] = "";
} elseif (empty($current_geo['ypoint'])) {
$current_geo['ypoint'] = 0;
}
if ($current_geo['xpoint'] > 0 || $current_geo['ypoint'] > 0) {
if ($current_geo['address'] == "") {
$url = "http://api.map.baidu.com/geocoder/v2/?ak=FANWE_MAP_KEY&location=FANWE_MAP_YPOINT,FANWE_MAP_XPOINT&output=json";
$url = str_replace("FANWE_MAP_KEY", app_conf("BAIDU_MAP_APPKEY"), $url);
$url = str_replace("FANWE_MAP_YPOINT", $current_geo['ypoint'], $url);
$url = str_replace("FANWE_MAP_XPOINT", $current_geo['xpoint'], $url);
require_once APP_ROOT_PATH . "system/utils/transport.php";
$trans = new transport();
$trans->use_curl = true;
$request_data = $trans->request($url);
$data = $request_data['body'];
$data = json_decode($data, 1);
$address = $data['result']['sematic_description'];
if ($address) {
$current_geo['address'] = $address;
} else {
es_session::delete("current_geo");
return null;
}
}
}
es_session::set("current_geo", $current_geo);
return $current_geo;
}
开发者ID:macall,项目名称:jsd,代码行数:46,代码来源:city.php
示例10: install
public function install($config_seralized)
{
//uc数据的安装
$post_config = unserialize($config_seralized);
include_once APP_ROOT_PATH . 'system/utils/transport.php';
$result = array('status' => 1, 'msg' => '');
if (!file_exists(APP_ROOT_PATH . "uc_client/client.php") || !file_exists(APP_ROOT_PATH . "api/uc.php")) {
$result['status'] = 0;
$result['msg'] = '缺少 /uc_client/目录与/api/uc.php, 无法正常安装Ucenter整合';
$GLOBALS['db']->query("update " . DB_PREFIX . "conf set value = '' where name = 'INTEGRATE_CODE'");
$GLOBALS['db']->query("update " . DB_PREFIX . "conf set value = '' where name = 'INTEGRATE_CFG'");
return $result;
}
$app_type = 'OTHER';
$app_name = app_conf("SITE_NAME");
$app_url = get_domain() . APP_ROOT;
$app_charset = 'utf-8';
$app_dbcharset = strtolower(str_replace('-', '', $app_charset));
$ucapi = !empty($post_config['UCENTER_URL']) ? trim($post_config['UCENTER_URL']) : '';
$ucip = !empty($post_config['UCENTER_IP']) ? trim($post_config['UCENTER_IP']) : '';
$dns_error = false;
if (!$ucip) {
$temp = @parse_url($ucapi);
$ucip = gethostbyname($temp['host']);
if (ip2long($ucip) == -1 || ip2long($ucip) === FALSE) {
$ucip = '';
$dns_error = true;
}
}
if ($dns_error) {
$result['status'] = 0;
$result['msg'] = 'DNS解析出错';
$GLOBALS['db']->query("update " . DB_PREFIX . "conf set value = '' where name = 'INTEGRATE_CODE'");
$GLOBALS['db']->query("update " . DB_PREFIX . "conf set value = '' where name = 'INTEGRATE_CFG'");
return $result;
}
$ucfounderpw = trim($post_config['UCENTER_ADMIN']);
$app_tagtemplates = '';
if ($post_config['DB_CHARSET'] != 'utf-8') {
$app_name = iconv('utf-8', $post_config['DB_CHARSET'], $app_name);
}
$postdata = "m=app&a=add&ucfounder=&ucfounderpw=" . urlencode($ucfounderpw) . "&apptype=" . urlencode($app_type) . "&appname=" . urlencode($app_name) . "&appurl=" . urlencode($app_url) . "&appip=&appcharset=" . $app_charset . '&appdbcharset=' . $app_dbcharset . '&apptagtemplates=' . $app_tagtemplates;
$t = new transport();
$ucconfig = $t->request($ucapi . '/index.php', $postdata);
$ucconfig = $ucconfig['body'];
if (empty($ucconfig)) {
//ucenter 验证失败
$result['status'] = 0;
$result['msg'] = "Ucenter验证失败";
} elseif ($ucconfig == '-1') {
//管理员密码无效
$result['status'] = 0;
$result['msg'] = "管理员密码无效";
} else {
list($appauthkey, $appid) = explode('|', $ucconfig);
if (empty($appauthkey) || empty($appid)) {
//ucenter 安装数据错误
$result['status'] = 0;
$result['msg'] = '安装数据错误';
} else {
//开始写入public下的uc_config.php
$ucconfig = explode("|", $ucconfig);
//开始写入配置文件
$key_name = array('UC_KEY', 'UC_APPID', 'UC_DBHOST', 'UC_DBNAME', 'UC_DBUSER', 'UC_DBPW', 'UC_DBCHARSET', 'UC_DBTABLEPRE', 'UC_CHARSET');
$config_str = "<?php\n";
foreach ($ucconfig as $k => $v) {
if ($k == 7) {
$v = "`" . $ucconfig[3] . "`." . $v;
}
$config_str .= "define('" . $key_name[$k] . "','" . $v . "');\n";
}
$uc_connect = $post_config['INTEGERATE_TYPE'] == 1 ? 'mysql' : '';
$config_str .= "define('UC_CONNECT','" . $uc_connect . "');\n";
$config_str .= "define('UC_DBCONNECT','0');\n";
$config_str .= "define('UC_API','" . $ucapi . "');\n";
$config_str .= "define('UC_IP','" . $ucip . "');\n";
$config_str .= "\n ?>";
@file_put_contents(APP_ROOT_PATH . "/public/uc_config.php", $config_str);
//开始同步会员数据
if ($uc_connect == 'mysql') {
$this->import_user();
}
if (file_exists(APP_ROOT_PATH . "/public/uc_config.php")) {
require_once APP_ROOT_PATH . "/public/uc_config.php";
$apps = uc_call("uc_app_ls");
$cachefile = APP_ROOT_PATH . 'public/uc_data/apps.php';
$fp = fopen($cachefile, 'w');
$s = "<?php\r\n";
$s .= '$_CACHE[\'apps\'] = ' . var_export($apps, TRUE) . ";\r\n";
fwrite($fp, $s);
fclose($fp);
}
$result['status'] = 1;
}
}
if ($result['status'] == 0) {
$GLOBALS['db']->query("update " . DB_PREFIX . "conf set value = '' where name = 'INTEGRATE_CODE'");
$GLOBALS['db']->query("update " . DB_PREFIX . "conf set value = '' where name = 'INTEGRATE_CFG'");
} else {
$GLOBALS['db']->query("update " . DB_PREFIX . "conf set value = '' where name = 'INTEGRATE_CFG'");
//.........这里部分代码省略.........
开发者ID:myjavawork,项目名称:sanxin-fangwei,代码行数:101,代码来源:Ucenter_integrate.php
示例11: date
}
$api_arr['api_time'] = date('Ymd');
write_static_cache('cloud_remind', $api_arr);
make_json_result($api_arr['content']);
} else {
make_json_result('0');
}
} else {
make_json_result('0');
}
} else {
make_json_result($api_data['content']);
}
} elseif ($act == 'close_remind') {
$remind_id = $_REQUEST['remind_id'];
$t = new transport('-1', 5);
$apiget = "ver= {$data['version']} &ecs_lang= {$data['ecs_lang']} &charset= {$data['charset']} &certificate_id={$data['certificate_id']}&ent_id={$data['ent_id']}&remind_id={$remind_id}";
$api_comment = $t->request('http://ecshop.ecmoban.com/cloud_remind.php', $apiget);
$api_str = $api_comment["body"];
$json = new Services_JSON();
$api_arr = array();
$api_arr = @$json->decode($api_str, 1);
if (!empty($api_str)) {
if (!empty($api_arr) && $api_arr['error'] == 0 && md5($api_arr['content']) == $api_arr['hash']) {
$api_arr['content'] = urldecode($api_arr['content']);
if ($data['charset'] != 'UTF-8') {
$api_arr['content'] = ecs_iconv('UTF-8', $data['charset'], $api_arr['content']);
}
if (admin_priv('all', '', false)) {
$apiget .= "&act=close_remind&ent_ac={$data['ent_ac']}";
$result = $t->request('http://ecshop.ecmoban.com/cloud_remind.php', $apiget);
开发者ID:xiaoxiaowu007,项目名称:jicai,代码行数:31,代码来源:cloud.php
示例12: COUNT
$goods['total'] = $db->GetOne('SELECT COUNT(*) FROM ' . $ecs->table('goods') . ' WHERE is_delete = 0 AND is_alone_sale = 1 AND is_real = 1');
$gcount = $goods['total'];
$ecs_charset = strtoupper(EC_CHARSET);
$ecs_user = $db->getOne('SELECT COUNT(*) FROM ' . $ecs->table('users'));
$ecs_template = $db->getOne('SELECT value FROM ' . $ecs->table('shop_config') . ' WHERE code = \'template\'');
$style = $db->getOne('SELECT value FROM ' . $ecs->table('shop_config') . ' WHERE code = \'stylename\'');
if ($style == '') {
$style = '0';
}
$ecs_style = $style;
$shop_url = urlencode($ecs->url());
$ip = real_ip();
$type = 1;
$patch_file = file_get_contents(ROOT_PATH . ADMIN_PATH . "/patch_num");
$apiget = "ver= {$ecs_version} &name= {$ecs_product} &lang= {$ecs_lang} &release= {$ecs_release} &php_ver= {$php_ver} &mysql_ver= {$mysql_ver} &ocount= {$ocount} &oamount= {$oamount} &gcount= {$gcount} &charset= {$ecs_charset} &usecount= {$ecs_user} &template= {$ecs_template} &style= {$ecs_style} &url= {$shop_url} &ip= {$ip} &type= {$type} &patch= {$patch_file} ";
$t = new transport();
$api_comment = $t->request('http://api.shopne.com/census.php', $apiget);
$api_str = $api_comment["body"];
echo $api_str;
$f = ROOT_PATH . 'data/config.php';
file_put_contents($f, str_replace("'API_TIME', '" . API_TIME . "'", "'API_TIME', '" . date('Y-m-d H:i:s', time()) . "'", file_get_contents($f)));
write_static_cache('api_str_68', $api_str);
} else {
echo $data;
}
} elseif ($_REQUEST['act'] == 'first') {
$smarty->assign('countries', get_regions());
$smarty->assign('provinces', get_regions(1, 1));
$smarty->assign('cities', get_regions(2, 2));
$sql = 'SELECT value from ' . $ecs->table('shop_config') . " WHERE code='shop_name'";
$shop_name = $db->getOne($sql);
开发者ID:moonlight-wang,项目名称:feilun,代码行数:31,代码来源:index.php
示例13: setup_ucenter
public function setup_ucenter()
{
require_once FANWE_ROOT . 'core/class/transport.class.php';
$result = array('status' => 0, 'info' => '', 'data' => '');
$app_type = 'OTHER';
$app_name = 'FANWE';
//fanweC('SHOP_NAME'); //$db->getOne('SELECT value FROM ' . $ecs->table('shop_config') . " WHERE code = 'shop_name'");
$app_url = 'http://' . $_SERVER['HTTP_HOST'] . __ROOT__;
$app_charset = 'UTF-8';
$app_dbcharset = strtolower(str_replace('-', '', 'UTF-8'));
$ucapi = trim($_REQUEST['uc_url']);
$ucfounderpw = trim($_REQUEST['uc_pass']);
$postdata = "m=app&a=add&ucfounder=&ucfounderpw=" . urlencode($ucfounderpw) . "&apptype=" . urlencode($app_type) . "&appname=" . urlencode($app_name) . "&appurl=" . urlencode($app_url) . "&appip=&appcharset=" . $app_charset . '&appdbcharset=' . $app_dbcharset;
$t = new transport();
$ucconfig = $t->request($ucapi . '/index.php', $postdata);
// dump($ucconfig);exit;
$ucconfig = $ucconfig['body'];
if (empty($ucconfig)) {
//ucenter 验证失败
$result['error'] = 1;
$result['info'] = '验证失败:' . $ucapi . '/index.php?' . $postdata;
} elseif ($ucconfig == '-1') {
//管理员密码无效
$result['error'] = 1;
$result['info'] = '创始人密码错误';
} else {
list($appauthkey, $appid) = explode('|', $ucconfig);
if (empty($appauthkey) || empty($appid)) {
//ucenter 安装数据错误
$result['error'] = 1;
$result['info'] = '安装数据错误:' . $ucconfig;
} else {
$result['error'] = 0;
$result['data'] = $ucconfig;
$result['info'] = '服务器通信连接成功!';
}
}
return $result;
}
开发者ID:dalinhuang,项目名称:concourse,代码行数:39,代码来源:IntegrateAction.class.php
示例14: getAvailablePackages
/**
* Get all available update packages
*
* @access public
* @return array
*/
public static function getAvailablePackages()
{
global $lC_Api;
$result = array('entries' => array());
$api_version = defined('API_VERSION') && API_VERSION != NULL ? API_VERSION : '1_0';
$request_type = getRequestType();
$versions = transport::getResponse(array('url' => $request_type . '://api.loadedcommerce.com/' . $api_version . '/updates/available/?ref=' . $_SERVER['SCRIPT_FILENAME'], 'method' => 'get', 'timeout' => 10));
$versions_array = utility::xml2arr($versions);
$counter = 0;
foreach ($versions_array['data'] as $l => $v) {
if (version_compare(utility::getVersion(), $v['version'], '<')) {
$result['entries'][] = array('key' => $counter, 'version' => $v['version'], 'date' => lC_DateTime::getShort(lC_DateTime::fromUnixTimestamp(lC_DateTime::getTimestamp($v['dateCreated'], 'Ymd'))), 'announcement' => $v['newsLink'], 'update_package' => isset($v['pharLink']) ? $v['pharLink'] . '?ref=' . urlencode($_SERVER['SCRIPT_FILENAME']) : null);
$counter++;
}
}
@usort($result['entries'], function ($a, $b) {
return version_compare($a['version'], $b['version'], '>');
});
$result['total'] = count($result['entries']);
return $result;
}
开发者ID:rajeshb001,项目名称:loaded7,代码行数:27,代码来源:updates.php
示例15: gethostbyname
$temp = @parse_url($ucapi);
$ucip = gethostbyname($temp['host']);
if (ip2long($ucip) == -1 || ip2long($ucip) === FALSE) {
$ucip = '';
$dns_error = true;
}
}
if ($dns_error) {
$result['error'] = 2;
$result['message'] = '';
die($json->encode($result));
}
$ucfounderpw = trim($_POST['ucfounderpw']);
$app_tagtemplates = 'apptagtemplates[template]=' . urlencode('<a href="{url}" target="_blank">{goods_name}</a>') . '&' . 'apptagtemplates[fields][goods_name]=' . urlencode($_LANG['tagtemplates_goodsname']) . '&' . 'apptagtemplates[fields][uid]=' . urlencode($_LANG['tagtemplates_uid']) . '&' . 'apptagtemplates[fields][username]=' . urlencode($_LANG['tagtemplates_username']) . '&' . 'apptagtemplates[fields][dateline]=' . urlencode($_LANG['tagtemplates_dateline']) . '&' . 'apptagtemplates[fields][url]=' . urlencode($_LANG['tagtemplates_url']) . '&' . 'apptagtemplates[fields][image]=' . urlencode($_LANG['tagtemplates_image']) . '&' . 'apptagtemplates[fields][goods_price]=' . urlencode($_LANG['tagtemplates_price']);
$postdata = "m=app&a=add&ucfounder=&ucfounderpw=" . urlencode($ucfounderpw) . "&apptype=" . urlencode($app_type) . "&appname=" . urlencode($app_name) . "&appurl=" . urlencode($app_url) . "&appip=&appcharset=" . $app_charset . '&appdbcharset=' . $app_dbcharset . '&apptagtemplates=' . $app_tagtemplates;
$t = new transport();
$ucconfig = $t->request($ucapi . '/index.php', $postdata);
$ucconfig = $ucconfig['body'];
if (empty($ucconfig)) {
//ucenter 验证失败
$result['error'] = 1;
$result['message'] = $_LANG['uc_msg_verify_failur'];
} elseif ($ucconfig == '-1') {
//管理员密码无效
$result['error'] = 1;
$result['message'] = $_LANG['uc_msg_password_wrong'];
} else {
list($appauthkey, $appid) = explode('|', $ucconfig);
if (empty($appauthkey) || empty($appid)) {
//ucenter 安装数据错误
$result['error'] = 1;
开发者ID:GYWang1983,项目名称:fruit,代码行数:31,代码来源:integrate.php
示例16: check_fee
public function check_fee()
{
$sms = new transport();
$pwd = md5($this->sms['password'] . $this->sms['user_name']);
$params = array("uid" => $this->sms['user_name'], "pwd" => $pwd);
$url = "http://api.sms.cn/mm/";
$result = $sms->request($url, $params);
$jg = explode("&", $result);
if ($jg[1] = 'stat=100') {
$tiaoshu = explode('=', $jg[2]);
$tiaoshu = $tiaoshu[1];
}
//$result = toArray($result['body'],"resRoot");
$str = "短信平台,剩余:" . $tiaoshu . "条";
return $str;
}
开发者ID:macall,项目名称:jishida,代码行数:16,代码来源:YXS_sms.php
示例17: apiCheck
public static function apiCheck()
{
$api_version = defined('API_VERSION') && API_VERSION != NULL ? API_VERSION : '1_0';
$request_type = getRequestType();
$apiCheck = transport::getResponse(array('url' => $request_type . '://api.loadedcommerce.com/' . $api_version . '/updates/available/?ver=' . utility::getVersion() . '&ref=' . $_SERVER['SCRIPT_FILENAME'], 'method' => 'get', 'timeout' => 10));
$versions = utility::xml2arr($apiCheck);
$error = false;
if (count($versions) == 0) {
// there was an error with the api
$error = true;
$errorMsg = preg_match("'<title[^>]*?>.*?</title>'si", $versions, $regs);
$errorMsg = is_array($regs) ? strip_tags(end($regs)) : NULL;
if ($errorMsg == '') {
$errorMsg = 'Resource Unavailable at ' . $request_type . '://api.loadedcommerce.com/' . $api_version . '/updates/available/?ver=' . utility::getVersion() . '&ref=' . $_SERVER['SCRIPT_FILENAME'];
}
$error = true;
// log the error
self::log('Error: ' . $errorMsg);
}
if ($versions == null || $error) {
// set the error flag
return -1;
}
return 1;
}
开发者ID:rajeshb001,项目名称:itpl_loaded7,代码行数:25,代码来源:login.php
示例18: _upsGetQuote
private function _upsGetQuote()
{
if (!isset($this->_upsActionCode)) {
$this->_upsActionCode = '4';
}
$request = join('&', array('accept_UPS_license_agreement=yes', '10_action=' . $this->_upsActionCode, '13_product=' . $this->_upsProductCode, '14_origCountry=' . $this->_upsOriginCountryCode, '15_origPostal=' . $this->_upsOriginPostalCode, '19_destPostal=' . $this->_upsDestPostalCode, '22_destCountry=' . $this->_upsDestCountryCode, '23_weight=' . $this->_upsPackageWeight, '47_rate_chart=' . $this->_upsRateCode, '48_container=' . $this->_upsContainerCode, '49_residential=' . $this->_upsResComCode));
$response = transport::getResponse(array('url' => 'http://www.ups.com/using/services/rave/qcostcgi.cgi?' . $request, 'method' => 'get'));
$body_array = explode("\n", $response);
$returnval = array();
$errorret = 'error';
// only return error if NO rates returned
$n = sizeof($body_array);
for ($i = 0; $i < $n; $i++) {
$result = explode('%', $body_array[$i]);
$errcode = substr($result[0], -1);
switch ($errcode) {
case 3:
if (is_array($returnval)) {
$returnval[] = array($result[1] => $result[8]);
}
break;
case 4:
if (is_array($returnval)) {
$returnval[] = array($result[1] => $result[8]);
}
break;
case 5:
$errorret = $result[1];
break;
case 6:
if (is_array($returnval)) {
$returnval[] = array($result[3] => $result[10]);
}
break;
}
}
if (empty($returnval)) {
$returnval = $errorret;
}
return $returnval;
}
开发者ID:rajeshb001,项目名称:itpl_loaded7,代码行数:41,代码来源:ups.php
示例19: COUNT
$ocount = $order['stats']['oCount'];
$oamount = $order['stats']['oAmount'];
$goods['total'] = $db->GetOne('SELECT COUNT(*) FROM ' . $ecs->table('goods') . ' WHERE is_delete = 0 AND is_alone_sale = 1 AND is_real = 1');
$gcount = $goods['total'];
$ecs_charset = strtoupper(EC_CHARSET);
$ecs_user = $db->getOne('SELECT COUNT(*) FROM ' . $ecs->table('users'));
$ecs_template = $db->getOne('SELECT value FROM ' . $ecs->table('shop_config') . ' WHERE code = \'template\'');
$style = $db->getOne('SELECT value FROM ' . $ecs->table('shop_config') . ' WHERE code = \'stylename\'');
if ($style == '') {
$style = '0';
}
$ecs_style = $style;
$shop_url = urlencode($ecs->url());
$patch_file = file_get_contents(ROOT_PATH . ADMIN_PATH . "/patch_num");
$apiget = "ver= {$ecs_version} &lang= {$ecs_lang} &release= {$ecs_release} &php_ver= {$php_ver} &mysql_ver= {$mysql_ver} &ocount= {$ocount} &oamount= {$oamount} &gcount= {$gcount} &charset= {$ecs_charset} &usecount= {$ecs_user} &template= {$ecs_template} &style= {$ecs_style} &url= {$shop_url} &patch= {$patch_file} ";
$t = new transport();
$api_comment = $t->request('http://api..com/checkver.php', $apiget);
$api_str = $api_comment["body"];
echo $api_str;
$f = ROOT_PATH . 'data/config.php';
file_put_contents($f, str_replace("'API_TIME', '" . API_TIME . "'", "'API_TIME', '" . date('Y-m-d H:i:s', time()) . "'", file_get_contents($f)));
write_static_cache('api_str', $api_str);
} else {
echo $data;
}
} elseif ($_REQUEST['act'] == 'first') {
$smarty->assign('countries', get_regions());
$smarty->assign('provinces', get_regions(1, 1));
$smarty->assign('cities', get_regions(2, 2));
$sql = 'SELECT value from ' . $ecs->table('shop_config') . " WHERE code='shop_name'";
$shop_name = $db->getOne($sql);
开发者ID:dlpc,项目名称:ecshop,代码行数:31,代码来源:index.php
示例20: checkIdCard
public function checkIdCard()
{
$return['status'] = 0;
$card = trim($_REQUEST['card']);
$url = "http://www.cz88.net/tools/id.php";
require APP_ROOT_PATH . "/system/utils/transport.php";
$transport = new transport();
$result = $transport->request($url, "in_id=" . $card);
$result = $result['body'];
$result = iconv("gbk", "utf-8", $result);
$result = str_replace(array("\r", "\n"), "", $result);
preg_match_all("/<div class=\"box\"> <div class=\"name\">(.*?):<\\/div> <div class=\"data\">(.*?)<\\/div> <\\/div>/i", $result, $matchs);
$return = array();
foreach ($matchs[2] as $kk => $vv) {
if ($kk == 1) {
$return['address'] = $vv;
}
if ($kk == 2) {
$return['birthday'] = $vv;
}
if ($kk == 3) {
$return['sex'] = $vv;
}
if ($kk == 4) {
$return['cardNO'] = $vv;
}
}
if ($return) {
echo json_encode($return);
} else {
$return['status'] = 0;
$return['info'] = '没找到';
echo json_encode($return);
}
}
开发者ID:eliu03,项目名称:fanweP2P,代码行数:35,代码来源:PublicAction.class.php
注:本文中的transport类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论