本文整理汇总了PHP中curl::setReturnFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP curl::setReturnFormat方法的具体用法?PHP curl::setReturnFormat怎么用?PHP curl::setReturnFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类curl
的用法示例。
在下文中一共展示了curl::setReturnFormat方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __getConfig
public function __getConfig()
{
//获取mediaserver的里面视频类型的配置
if ($this->settings['App_mediaserver']) {
$curl = new curl($this->settings['App_mediaserver']['host'], $this->settings['App_mediaserver']['dir'] . 'admin/');
$curl->setReturnFormat('json');
$curl->initPostData();
$curl->addRequestData('a', '__getConfig');
$m_config = $curl->request('index.php');
}
if ($m_config && is_array($m_config)) {
$video_type = $m_config[0]['video_type']['allow_type'];
} else {
$video_type = $this->default_type;
}
$video_type_arr = explode(',', $video_type);
$flash_video_type = '';
foreach ($video_type_arr as $k => $v) {
$flash_video_type .= '*' . $v . ';';
}
$video_types = str_replace('.', '', $video_type);
$this->settings['flash_video_type'] = $flash_video_type;
$this->settings['video_type'] = $video_types;
parent::__getConfig();
}
示例2: setting
public function setting()
{
$data = array('id' => intval($this->user['id']), 'password' => trim($this->input['password']), 'password_again' => trim($this->input['password_again']), 'old_password' => trim($this->input['old_password']));
if ($data['password'] && $data['password'] != $data['password_again']) {
$this->ReportError('两次输入的密码不一样');
}
$curl = new curl($this->settings['App_auth']['host'], $this->settings['App_auth']['dir']);
$curl->setSubmitType('post');
$curl->setReturnFormat('json');
$curl->initPostData();
$curl->addRequestData('a', 'update_password');
foreach ($data as $key => $val) {
$curl->addRequestData($key, $val);
}
if ($_FILES['Filedata']) {
$curl->addFile($_FILES);
}
$return = $curl->request('member.php');
if ($return && $return[0]) {
if ($return[0]['error'] == -1) {
$this->ReportError('原始密码错误');
}
}
$this->redirect('更新成功');
}
示例3: __destruct
}
public function __destruct()
{
parent::__destruct();
}
public function convert()
{
global $gGlobalConfig;
include_once ROOT_PATH . 'lib/class/curl.class.php';
if ($gGlobalConfig['App_officeconvert']) {
$curl = new curl($gGlobalConfig['App_officeconvert']['host'], $gGlobalConfig['App_officeconvert']['dir']);
}
$curl->setSubmitType('post');
$curl->setReturnFormat('json');
$curl->initPostData();
$curl->addRequestData('custom_appid', CUSTOM_APPID);
$curl->addRequestData('custom_appkey', CUSTOM_APPKEY);
$curl->addFile($_FILES);
$result = $curl->request('convert.php');
//var_dump($result);exit;
$path = 'cache/word/zip_' . uniqid() . '/';
$zipDir = ROOT_PATH . $path;
$return = array();
if (hg_mkdir($zipDir) && is_writeable($zipDir)) {
$zipFile = $zipDir . 'word.zip';
file_put_contents($zipFile, $result);
$unzipDir = $zipDir . 'unzip/';
if (hg_mkdir($unzipDir) && is_writeable($unzipDir)) {
$unzipCmd = ' unzip ' . $zipFile . ' -d ' . realpath($unzipDir);
exec($unzipCmd);
$rmZip = ' rm -f ' . $zipFile;
exec($rmZip);
示例4: __destruct
}
public function __destruct()
{
parent::__destruct();
}
/**
* 转换word文档
*/
public function convert()
{
$app_id = isset($this->input['custom_appid']) ? trim($this->input['custom_appid']) : '';
$app_key = isset($this->input['custom_appkey']) ? trim($this->input['custom_appkey']) : '';
if (empty($app_id) || empty($app_key)) {
$this->errorOutput(PARAM_WRONG);
}
//先验证是否有权限
$auth = new Auth();
$auth_info = $auth->getAccessToken($app_id, $app_key);
if (!$auth_info) {
$this->errorOutput(NO_AUTH);
}
//处理上传的word文档
$gGlobalConfig['officeconvert'] = array('host' => '10.0.1.59:8080', 'dir' => 'officeConverter/');
$curl = new curl($gGlobalConfig['officeconvert']['host'], $gGlobalConfig['officeconvert']['dir']);
$curl->setSubmitType('post');
$curl->setReturnFormat('str');
$curl->initPostData();
$curl->addFile($_FILES);
$curl->addRequestData('custom_appid', $app_id);
$curl->addRequestData('custom_appkey', $app_key);
示例5: show
public function show()
{
$sql = "SELECT app_uniqueid, trade_number, out_trade_number, total_fee FROM " . DB_PREFIX . "orders\n WHERE order_type = 'THIRD_PARTY' AND trade_status = 'HAS_PAY' AND out_trade_notify IN(0,1)\n ORDER BY out_trade_notify_time ASC LIMIT 1";
$order = $this->db->query_first($sql);
//通知第三方订单
$sql = "SELECT * FROM " . DB_PREFIX . "app_access WHERE app_uniqueid = '" . $order['app_uniqueid'] . "'";
$app = $this->db->query_first($sql);
if (!empty($app)) {
$curl = new curl($app['host'], $app['dir']);
$curl->setSubmitType('post');
$curl->setReturnFormat('json');
$curl->initPostData();
$curl->addRequestData('a', $app['order_detail_func']);
$curl->addRequestData('trade_number', $order['out_trade_number']);
$curl->addRequestData('total_fee', $order['total_fee']);
$ret = $curl->request($app['request_file']);
if ($ret['success'] == 1) {
$status = $ret['data']['status'];
if ($status == 0) {
$curl->initPostData();
$curl->addRequestData('a', $app['pay_func']);
$curl->addRequestData('trade_number', $order['out_trade_number']);
$curl->addRequestData('total_fee', $order['total_fee']);
$ret = $curl->request($app['request_file']);
}
$this->db->update_data(array('out_trade_notify' => $status, 'out_trade_notify_time' => TIMENOW), 'orders', " trade_number = '" . $order['trade_number'] . "'");
} else {
$this->db->update_data(array('out_trade_notify' => 0, 'out_trade_notify_time' => TIMENOW), 'orders', " trade_number = '" . $order['trade_number'] . "'");
}
}
var_dump($ret);
var_dump($order);
}
示例6: show
public function show()
{
$this->appstore->initPostData();
$this->appstore->addRequestData('a', 'get_sort');
$menu_group = $this->appstore->request('index.php');
$menu_group = $menu_group['sort'];
$this->appstore->initPostData();
$menu_apps = $this->appstore->request('index.php');
$menu_apps = $menu_apps['apps'];
$curl = new curl($this->product_server['host'] . ':' . $this->product_server['port'], '');
$curl->setClient(CUSTOM_APPID, CUSTOM_APPKEY);
$curl->setSubmitType('get');
$curl->setReturnFormat('json');
$curl->initPostData();
$curl->addRequestData('install', 1);
$curl->addRequestData('pre_release', 1);
$curl->addRequestData('app', $app);
$appinfo = $this->appinfo;
$program_url = $curl->request('check_version.php');
$appinfo['pre_release_url'] = $program_url;
$curl->initPostData();
$curl->addRequestData('install', 1);
$curl->addRequestData('app', $app);
$program_url = $curl->request('check_version.php');
$appinfo['release_url'] = $program_url;
$this->tpl->addVar('appinfo', $appinfo);
$this->tpl->addVar('_settings', $this->settings);
$this->tpl->addVar('menu_group', $menu_group);
$this->tpl->addVar('menu_apps', $menu_apps);
$this->tpl->outTemplate('admin_appstore');
}
示例7: checklogin
private function checklogin($username, $password)
{
$curl = new curl($this->settings['App_auth']['host'], $this->settings['App_auth']['dir']);
$curl->setSubmitType('post');
$curl->setReturnFormat('json');
$curl->initPostData();
$curl->addRequestData('a', 'show');
$curl->addRequestData('username', $username);
$curl->addRequestData('password', $password);
$ret = $curl->request('get_access_token.php');
return $ret[0];
}
示例8: get_mediaserver_config
private function get_mediaserver_config()
{
//获取需要修改的配置
$curl = new curl($this->settings['App_mediaserver']['host'], $this->settings['App_mediaserver']['dir']);
$curl->setSubmitType('post');
$curl->setReturnFormat('json');
$curl->initPostData();
$curl->addRequestData('a', 'settings');
$settings = $curl->request('configuare.php');
$config = array('default_record_file_path' => !empty($settings) ? $settings['define']['UPLOAD_DIR'] : '');
return $config;
}
示例9: config
function config()
{
$curl = new curl('localhost', 'livsns/api/auth/');
$curl->setSubmitType('post');
$curl->setReturnFormat('json');
$curl->initPostData();
$curl->addRequestData('a', 'settings');
$ret = $curl->request('configuare.php');
$user_configs = array('base' => $ret['base'], 'define' => $ret['define']);
$curl = new curl('10.0.1.40', 'livworkbench/api/');
$curl->setSubmitType('post');
$curl->setReturnFormat('json');
$curl->initPostData();
$curl->setClient(CUSTOM_APPID, CUSTOM_APPKEY);
$curl->addRequestData('app', 'auth');
$curl->addRequestData('version', '1.0.0');
$curl->addRequestData('pre_release', '1');
$new_configs = $curl->request('config.php');
if ($new_configs) {
$doset = array();
foreach ($new_configs as $k => $v) {
if (is_array($v)) {
foreach ($v as $kk => $vv) {
if (!$user_configs[$k][$kk]) {
$doset[$k][$kk] = $vv;
}
}
}
}
}
if ($doset) {
$curl = new curl('localhost', 'livsns/api/auth/');
$curl->setSubmitType('post');
$curl->setReturnFormat('json');
$curl->initPostData();
$curl->addRequestData('a', 'doset');
foreach ($doset as $k => $v) {
foreach ($v as $kk => $vv) {
if (is_array($vv)) {
foreach ($vv as $kkk => $vvv) {
$curl->addRequestData($k . "[{$kk}][{$kkk}]", $vvv);
}
} else {
$curl->addRequestData($k . "[{$kk}]", $vv);
}
}
}
$ret = $curl->request('configuare.php');
}
print_r($doset);
print_r($curl);
}
示例10: access_token_expired
private function access_token_expired($access_token)
{
//获取需要修改的配置
require_once ROOT_PATH . 'lib/class/curl.class.php';
$curl = new curl($this->settings['App_auth']['host'], $this->settings['App_auth']['dir']);
$curl->setSubmitType('post');
$curl->setReturnFormat('json');
$curl->initPostData();
$curl->addRequestData('a', 'access_token_expired');
$curl->addRequestData('access_token', $access_token);
$ret = $curl->request('get_app_info.php');
return $ret[0];
}
示例11: add2log
private function add2log($content, $operation = 'login')
{
$curl = new curl($this->settings['App_logs']['host'], $this->settings['App_logs']['dir'] . 'admin/');
$curl->setSubmitType('post');
$curl->setReturnFormat('json');
$curl->initPostData();
$curl->addRequestData('a', 'create');
$curl->addRequestData('bundle_id', 'm2o');
$curl->addRequestData('moudle_id', 'm2o');
$curl->addRequestData('operation', $operation);
$curl->addRequestData('title', $content);
$ret = $curl->request('logs_update.php');
return $ret;
}
示例12: addmonitorlog
private function addmonitorlog($mark, $title, $content = '', $type = 0)
{
if (!$this->settings['App_servermonitor']) {
return;
}
include_once ROOT_PATH . 'lib/class/curl.class.php';
$curl = new curl($this->settings['App_servermonitor']['host'], $this->settings['App_servermonitor']['dir'] . 'admin/');
$curl->setReturnFormat('json');
$curl->setSubmitType('post');
$curl->initPostData();
$curl->addRequestData('a', 'create');
$curl->addRequestData('mark', $mark);
$curl->addRequestData('title', $title);
$curl->addRequestData('type', $type);
$curl->addRequestData('content', $content);
$curl->request('logs_update.php');
}
示例13: create_publish_table
public function create_publish_table()
{
$planret = array();
if ($this->settings['App_livmedia']) {
include_once ROOT_PATH . 'lib/class/curl.class.php';
$curl = new curl($this->settings['App_livmedia']['host'], $this->settings['App_livmedia']['dir']);
$curl->setSubmitType('post');
$curl->setReturnFormat('json');
$curl->initPostData();
$curl->addRequestData('a', 'settings');
$ret = $curl->request('configuare.php');
$planret[1] = $ret['define']['PUBLISH_SET_ID'];
}
$this->addItem_withkey('message', 'success');
$this->addItem_withkey('ret', $planret);
$this->output();
}
示例14: detail
public function detail()
{
if (!$this->input['id']) {
$this->errorOutput(NOID);
}
$ret = $this->mode->show_detail($this->input['id']);
if (!$ret['title']) {
$this->errorOutput(NODATA);
}
/***从会员接口取会员相关信息和拓展信息****/
if ($this->user['user_id'] && $this->settings['App_members']) {
$curl = new curl($this->settings['App_members']['host'], $this->settings['App_members']['dir'] . 'admin/');
$curl->setSubmitType('post');
$curl->setReturnFormat('json');
$curl->initPostData();
$curl->addRequestData('id', $this->user['user_id']);
$curl->addRequestData('a', 'detail');
$info = $curl->request('member.php');
$info = $info[0];
if ($info && is_array($info)) {
$data = array('mobile' => $info['mobile'], 'avatar' => $info['avatar'], 'mobile' => $info['mobile'], 'email' => $info['email']);
if ($info['extension'] && is_array($info['extension'])) {
foreach ($info['extension'] as $k => $v) {
$data[$v['field']] = $v['value'];
}
}
}
}
/***从会员接口取会员相关信息和拓展信息****/
//会员信息对应到相关字段上去
if ($data && $ret['forms'] && is_array($ret['forms'])) {
foreach ($ret['forms'] as $key => $val) {
if (!$val['default_value'] && $val['member_field'] && !$val['member_field_addr']) {
$ret['forms'][$key]['default_value'] = $data[$val['member_field']];
} else {
if (!$val['default_value'] && $val['member_field_addr'] && is_array($val['element'])) {
foreach ($val['element'] as $ks => $ele) {
$ret['forms'][$key]['element'][$ks]['default_value'] = $data[$val['member_field_addr'][$ele['id']]];
}
}
}
}
}
$this->addItem($ret);
$this->output();
}
示例15: getSystemUserInfo
public function getSystemUserInfo($uid)
{
if (!$uid || !$this->settings['App_auth']) {
return false;
}
$ret = array();
$curl = new curl($this->settings['App_auth']['host'], $this->settings['App_auth']['dir']);
$curl->setSubmitType('post');
$curl->setReturnFormat('json');
$curl->initPostData();
$curl->addRequestData('a', 'getMemberById');
$curl->addRequestData('id', $uid);
$ret = $curl->request('member.php');
if (!$ret || $ret['ErrorCode']) {
return false;
}
$ret = $ret[0];
return $ret;
}