本文整理汇总了PHP中curl::setUrlHost方法的典型用法代码示例。如果您正苦于以下问题:PHP curl::setUrlHost方法的具体用法?PHP curl::setUrlHost怎么用?PHP curl::setUrlHost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类curl
的用法示例。
在下文中一共展示了curl::setUrlHost方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: settings_process
/**
* 配置更新前处理
*
*/
protected function settings_process()
{
if ($this->settings['schedule_control_wowza']['is_wowza'] && ($this->settings['App_schedule'] || $this->settings['App_live_control'])) {
if (!$this->settings['schedule_control_wowza']['is_wowza']) {
$this->input['base']['schedule_control_wowza'] = array();
//$this->errorOutput('请修改配置选项schedule_control_wowza=>is_wowza以启用播控');
} else {
$this->input['base']['schedule_control_wowza']['is_wowza'] = 1;
if (!$this->input['base']['schedule_control_wowza']['host']) {
$this->errorOutput('请设置wowza主机');
}
if (!$this->input['base']['schedule_control_wowza']['inputdir']) {
$this->errorOutput('请设置wowza目录');
}
}
$curl = new curl();
$curl->initPostData();
$curl->setSubmitType('post');
$curl->addRequestData('base[server_info][host]', $this->input['base']['schedule_control_wowza']['host']);
$curl->addRequestData('base[server_info][input_dir]', $this->input['base']['schedule_control_wowza']['inputdir']);
$curl->addRequestData('a', 'doset');
//
if ($this->settings['App_schedule']) {
//$this->errorOutput(var_export($this->settings['App_schedule'],1));
$curl->setUrlHost($this->settings['App_schedule']['host'], $this->settings['App_schedule']['dir']);
$ret = $curl->request('configuare.php');
if (!$ret['success']) {
$this->errorOutput("同步串联单配置失败");
}
}
if ($this->settings['App_live_control']) {
$curl->setUrlHost($this->settings['App_live_control']['host'], $this->settings['App_live_control']['dir']);
$ret = $curl->request('configuare.php');
if (!$ret['success']) {
$this->errorOutput("同步播控配置失败");
}
}
}
$max_time_shift = intval($this->input['base']['max_time_shift']);
$this->input['base']['max_time_shift'] = $max_time_shift > 0 ? $max_time_shift : 168;
}
示例2: media_server_operate
private function media_server_operate($time_shift_server, $data = array())
{
$curl = new curl();
$curl->setUrlHost($time_shift_server['host'] . ($time_shift_server['port'] ? ':' . $time_shift_server['port'] : ''));
$curl->setSubmitType('get');
$curl->initPostData();
$curl->setReturnFormat('json');
foreach ($data as $k => $v) {
$curl->addRequestData($k, $v);
}
$ret = $curl->request('');
return xml2Array($ret);
}