dbursem/ogn-client-php
Composer 安装命令:
composer require dbursem/ogn-client-php
包简介
OGN client implementation
README 文档
README
This client can be used to track aircraft and save their logs to a database. Saving other beacons is not (yet) supported.
Install
- run
composer require dbursem/ogn-client-php. Check http://getcomposer.org for more info on composer. - install the database schema from the ogn-client-db.sql file.
- Copy the example directory to your install directory
- Copy the aprsbot.cfg.php file to local.aprsbot.cfg.php and edit it with your personal settings. OGN server and port are already in it.
- Set the filter to a valid APRS filter. If you leave it empty, a filter will be used that selects only the airplanes in the database.
Usage
- Call the example aprsbot from the commandline with
php aprsbot.php. - you'll see some debug info and hopefully logs will be added to your database.
- set debug to false in aprsbot.php (line 7) to stop the debug messages.
Be noted: This is a daemon that should run in the background indefinately. All it does is saving coordinates to a database. There's no use in trying to call it through a webserver, as there's no output other than the debug messages.
Minimal steps to create your own aprsbot:
- Create an instance of APRS:
$aprs = new dbursem\phpaprs\APRS();
- Connect to the APRS host
if ($aprs->connect(HOST, PORT, MYCALL, PASSCODE, $filter) == FALSE) { die( "Connect failed\n"); }
- Create an instance of OGNClient:
$ogn = new OGNClient\OGNClient(DB_NAME,DB_USER,DB_PASS,DB_HOST, $debug);
- Create a loop to handle the input/output and save records to the database
while (1) { if (time() - $lastbeacon > BEACON_INTERVAL) { //send beacon (every 5 minutes) to keep connection alive echo "Send beacon\n"; $aprs->sendPacket($beacon); $lastbeacon = time(); } $aprs->ioloop(5); // handle Socket I/O events $ogn->savePositions(); //save received positions to database }
About the igc.php file
This code won't work as-is, I only bundled the file to serve as an example of how to generate an IGC file from the logs in ognlogs. Create your own functions to do this in your environment or wait till I have time to make A proper class for it.
check the openlayers igc example if you want to show the IGC in a webbrowser.
As said before, this class has some rough edges so handle with care!
dbursem/ogn-client-php 适用场景与选型建议
dbursem/ogn-client-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 154 次下载、GitHub Stars 达 6, 最近一次更新时间为 2015 年 11 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「APRS」 「OGN」 「Glidernet」 「Open Glider Net」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 dbursem/ogn-client-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dbursem/ogn-client-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 dbursem/ogn-client-php 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
统计信息
- 总下载量: 154
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPLv3
- 更新时间: 2015-11-18