此包已被废弃且不再维护。作者建议使用 zazimou/cap 包。

通用警报协议版本 1.2 读取器

v0.1.2 2020-03-26 09:39 UTC

This package is auto-updated.

Last update: 2022-04-01 09:02:26 UTC


README

Build Status

CAP 是一个用于读取通用警报协议版本 1.2 的库

目前该库仅针对捷克 ČHMÚ(捷克水文气象研究所)结构进行开发

捷克语通用警报协议文档

http://portal.chmi.cz/files/portal/docs/meteo/om/vystrahy/doc/Dokumentace_CAP.pdf

特性

  • 您可以下载此文件,无问题地作为已知对象进行读取
  • 部分内容已修改为对象(字符串与 datetime 到 \DateTime,...)

修改为对象

  • 所有带有 datetime 值的字符串到 \DateTime
  • 所有可对象化的字符串值(例如,引用、发送者名称等)
  • 所有可能具有多个值的属性都进行了数组化,这些属性具有复数名称

安装

Composer

{
    "require": {
        "thestormwinter/cap": "*"
    }
}

使用

use theStormWinter\CAP\Cap;

// find Url where is cap file uploaded
$url = "http://portal.chmi.cz/files/portal/docs/meteo/om/bulletiny/XOCZ50_OKPR.xml";

// create new instance of Cap
$cap = new Cap;

// download the file
$file = $cap->read($url);

变更日志

0.1.1

  • 添加 .gitattributes

0.1.0

  • 库的第一个版本