crontab_aliyun.php 827 B

123456789101112131415161718192021
  1. <?php
  2. //定时任务,在java定时访问调用
  3. header("Content-Type:text/html; charset=utf-8");
  4. define("FANWE_REQUIRE", true);
  5. require './system/mapi_init.php';
  6. fanwe_require(APP_ROOT_PATH . 'mapi/lib/core/common.php');
  7. fanwe_require(APP_ROOT_PATH . 'mapi/lib/redis/BaseRedisService.php');
  8. $ret_array = array();
  9. //结束异常直播
  10. $video=$GLOBALS['db']->getALl("SELECT stream_id,vhost FROM ".DB_PREFIX."video_aliyun AS a WHERE NOT EXISTS( SELECT * FROM fanwe_video AS v WHERE a.stream_id = v.channelid)");
  11. if(!empty($video)){
  12. $m_config = load_auto_cache('m_config');
  13. fanwe_require(APP_ROOT_PATH . 'mapi/lib/core/video_aliyun.php');
  14. $service = new VideoAliyun($m_config);
  15. foreach($video as $item){
  16. $ret_array[]= $service->Stop($item['stream_id'],$item['vhost']);
  17. }
  18. }
  19. echo json_encode($ret_array);