chbl/weather

v2.0.3 2020-12-04 13:57 UTC

This package is auto-updated.

Last update: 2024-09-04 22:24:50 UTC


README

Scrutinizer Code Quality Code Coverage Build Status Build Status CircleCI

Anax (在 ramverk1 仓库中使用) 的天气模块

ramverk1 课程中使用的模块,使用 PHP 框架 Anax。

安装

composer require chbl/weather

`make install`

`make install test`

要运行测试,请使用 make test,但请记得先添加您的API密钥。

以下有进一步说明!

复制配置

rsync -av vendor/chbl/weather/config/ config/

rsync -av vendor/chbl/weather/src/ src/

rsync -av vendor/chbl/weather/test/ test/

rsync -av vendor/chbl/weather/view/ view/

添加您的个人API密钥

在config/文件夹中创建文件 weatherapi.phpapikey.php

将以下内容粘贴到 weatherapi.php 并将 xxx 替换为您的API密钥。

`

return [

"weatherKeyHolder" => [

    "weatherKey" => "xxx",

    "mapboxKey" => "xxx"

]

];`

为您的 GetGeolocation API,执行相同的操作,但使用以下代码,并将其粘贴到 apikey.php 中,

`

return ["keyHolder" => ["apiKey" => "x"]];`

结构

天气服务将在 /weather 下可用,IP 服务将在 /validate 下可用