定制 buibr/xmlepg 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

buibr/xmlepg

Composer 安装命令:

composer require buibr/xmlepg

包简介

Parse XMLTV EPG from file or url

README 文档

README

Parse XMLTV Epg from file or url.

<?php
require 'vendor/autoload.php';

$Parser = new \buibr\xmlepg\EpgParser();
$Parser->setFile($argv[1]);
$Parser->setTargetTimeZone('Europe/Skopje');
// $Parser->setChannelfilter('prosiebenmaxx.de'); //optional
// $Parser->setIgnoreDescr('Keine Details verfügbar.'); //optional

try {
	$Parser->parseFile();
} catch (Exception $e) {
	throw new \RuntimeException($e);
}
/** @noinspection ForgottenDebugOutputInspection */
print_r($Parser->getEpgdata());

OR

<?php
require 'vendor/autoload.php';

$epg = new \buibr\xmlepg\EpgParser();
$epg->setUrl($url);
$epg->setTargetTimeZone('Europe/Skopje');
$epg->setProgrammGroup('@id'); // group programms by index.

try {
	$epg->parseUrl();
} catch (Exception $e) {
	throw new \RuntimeException($e);
}
/** @noinspection ForgottenDebugOutputInspection */
print_r($epg->getEpgdata());

OR

<?php
require 'vendor/autoload.php';

$cmd = "curl '{$url}' \
	-H 'Connection: keep-alive' \
	-H 'Pragma: no-cache' \
	-H 'Cache-Control: no-cache' \
	-H 'Upgrade-Insecure-Requests: 1' \
	-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36' \
	-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8' \
	-H 'Accept-Encoding: gzip, deflate' \
	-H 'Accept-Language: en-US,en;q=0.9' \
	-H 'Cookie: _ga=GA1.2.1889888653.1552387822; _gid=GA1.2.1207299097.1552387822' --compressed ";
$output = shell_exec($cmd);

try 
{
	$Parser = new \buibr\xmlepg\EpgParser();
	$Parser->setContent( $output );
	$Parser->parseContent();
} 
catch (Exception $e) 
{
	throw new \RuntimeException($e);
}

print_r($Parser->getEpgdata());

Example file:

php -f testFile.php xml/sample.xml

Example url:

php -f testUrl.php http://tvprofil.net/xmltv/data/top-channel.al/2019-04-15_top-channel.al_tvprofil.net.xml

Example content:

php -f testContent.php http://tvprofil.net/xmltv/data/top-channel.al/2019-04-15_top-channel.al_tvprofil.net.xml

buibr/xmlepg 适用场景与选型建议

buibr/xmlepg 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 400 次下载、GitHub Stars 达 5, 最近一次更新时间为 2019 年 04 月 14 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 buibr/xmlepg 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 buibr/xmlepg 我们能提供哪些服务?
定制开发 / 二次开发

基于 buibr/xmlepg 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 400
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-04-14