当前位置: 首页>>代码示例>>PHP>>正文


PHP curl::mPostContentType方法代码示例

本文整理汇总了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');
//.........这里部分代码省略.........
开发者ID:h3len,项目名称:Project,代码行数:101,代码来源:program_record_do.php


注:本文中的curl::mPostContentType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。