本文整理汇总了PHP中curl::mPostContentType方法的典型用法代码示例。如果您正苦于以下问题:PHP curl::mPostContentType方法的具体用法?PHP curl::mPostContentType怎么用?PHP curl::mPostContentType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类curl
的用法示例。
在下文中一共展示了curl::mPostContentType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: restart
function restart()
{
switch (intval($this->input['sort'])) {
case 0:
//重建当前时间之后所有的
$sql = "SELECT * FROM " . DB_PREFIX . "program_record WHERE start_time > " . TIMENOW . " AND conid <> 0";
//. " AND (start_time+toff)<" . strtotime(date('Y-m-d',TIMENOW) . ' 23:59:59')
//录制等待中的,并未开始录制,并且是当天,删除录制,重新提交
$q = $this->db->query($sql);
$queue_id = $record_id = $space = "";
while ($row = $this->db->fetch_array($q)) {
$queue_id .= $space . $row['conid'];
//$record_id .= $space . $row['id'];
$space = ',';
}
if ($queue_id) {
$sql = "SELECT * FROM " . DB_PREFIX . "program_queue WHERE id IN(" . $queue_id . ")";
$q = $this->db->query($sql);
include_once ROOT_PATH . 'lib/class/curl.class.php';
$obj_curl = new curl($this->settings['mms']['record_server']['host'], $this->settings['mms']['record_server']['dir']);
while ($row = $this->db->fetch_array($q)) {
$obj_curl->setSubmitType('get');
$obj_curl->initPostData();
$obj_curl->addRequestData('action', 'SELECT');
$obj_curl->addRequestData('id', $row['conid']);
$record_xml = $obj_curl->request('');
$record_array = xml2Array($record_xml);
if ($record_array) {
if ($record_array['result']) {
if ($record_array['record']['status'] == 'waiting') {
$obj_curl->mPostContentType('string');
$obj_curl->setSubmitType('get');
$obj_curl->setReturnFormat('json');
$obj_curl->initPostData();
$obj_curl->addRequestData('action', 'DELETE');
$obj_curl->addRequestData('id', $row['conid']);
$record_xml = $obj_curl->request('');
$record_array_delete = xml2Array($record_xml);
/*
if($record_array_delete['result'])
{
}
*/
}
}
}
//ing
$sql = "DELETE FROM " . DB_PREFIX . "program_record_log WHERE id=" . $row['log_id'];
$this->db->query($sql);
$sql = "DELETE FROM " . DB_PREFIX . "program_queue WHERE id=" . $row['id'];
$this->db->query($sql);
$update_sql = "UPDATE " . DB_PREFIX . "program_record SET is_record=0,conid=0 WHERE id=" . $row['record_id'];
//内容清空,录制清空
$this->db->query($update_sql);
echo $row['record_id'] . '-----------------ok<br/>';
}
}
break;
case 1:
$sql = "SELECT * FROM " . DB_PREFIX . "program_record WHERE start_time > " . TIMENOW . " AND conid <> 0";
//. " AND (start_time+toff)<" . strtotime(date('Y-m-d',TIMENOW) . ' 23:59:59')
//录制等待中的,并未开始录制,并且是当天,删除录制,重新提交
$q = $this->db->query($sql);
$queue_id = $record_id = $space = "";
while ($row = $this->db->fetch_array($q)) {
//$queue_id .= $space . $row['conid'];
$record_id .= $space . $row['id'];
$space = ',';
}
$update_sql = "UPDATE " . DB_PREFIX . "program_record SET is_record=0,conid=0 WHERE id IN(" . $record_id . ")";
//内容清空,录制清空
$this->db->query($update_sql);
echo $record_id . '-----------------ok<br/>';
break;
case 2:
//往后退一步
$sql = "SELECT * FROM " . DB_PREFIX . "program_record WHERE conid=0 and start_time > " . TIMENOW;
//. " AND (start_time+toff)<" . strtotime(date('Y-m-d',TIMENOW) . ' 23:59:59')
//录制等待中的,并未开始录制,并且是当天,删除录制,重新提交
$q = $this->db->query($sql);
$queue_id = $record_id = $space = "";
$record = array();
include_once ROOT_PATH . 'lib/class/curl.class.php';
$obj_curl = new curl($this->settings['mms']['record_server']['host'], $this->settings['mms']['record_server']['dir']);
while ($row = $this->db->fetch_array($q)) {
$obj_curl->setSubmitType('get');
$obj_curl->initPostData();
$obj_curl->addRequestData('action', 'SELECT');
$obj_curl->addRequestData('id', $row['id']);
$record_xml = $obj_curl->request('');
$record_array = xml2Array($record_xml);
if ($record_array) {
if ($record_array['result']) {
if ($record_array['record']['status'] == 'waiting') {
print_r($row);
print_r($record_array);
$obj_curl->mPostContentType('string');
$obj_curl->setSubmitType('get');
$obj_curl->setReturnFormat('json');
//.........这里部分代码省略.........