nihl/weatherreport

v1.1.0 2020-12-16 11:19 UTC

This package is auto-updated.

Last update: 2024-09-17 04:27:14 UTC


README

Build Status CircleCI Join the chat at https://gitter.im/nilshollmer/weather-report Scrutinizer Code Quality Build Status

Anax天气报告模块,用于获取和显示天气预报数据。

该模块设计用于与外部服务 ipstackopenweathermap 结合使用。

安装

1:
使用composer将此模块安装到现有的Anax安装中。
composer require nihl/weatherreport

2:
使用以下命令复制配置以集成它

# Root of your Anax based repository
rsync -av vendor/nihl/weatherreport/config ./

rsync -av vendor/nihl/weatherreport/view ./

# If you want to test the source code you can also copy the test-catalogue
rsync -av vendor/nihl/weatherreport/test ./

# If you want to edit the source code you can also copy the src-catalogue
rsync -av vendor/nihl/weatherreport/src ./

3:
ipstackopenweathermap 注册账户。更新apikey-configuration文件以包含ipstack和openweathermap的API密钥

# config/apikeys.php

return $apikeys = [
    "ipstack" => "your_ipstack_apikey",
    "openweather" => "your_openweathermap_apikey"
];

4:
将apikey-configuration文件添加到您的 .gitignore 文件中。

# .gitignore
config/apikeys.php

5:
weatherreport模块现在已在您的Anax安装中可用。
使用以下代码将其添加到您的导航栏中

# config/navbar/header
return [
    "items" => [
        ...
        [
            "text" => "Weather",
            "url" => "weatherreport",
            "title" => "Weather report",
            "submenu" => [
                "items" => [
                    [
                        "text" => "Rest API",
                        "url" => "weatherreport/api",
                        "title" => "Weather report-API"
                    ],
                ],
            ],
        ],
    ],
];

依赖关系

这是一个Anax模块,其主要用途是与Anax框架一起使用。

您可以在 anax/anax 上安装一个实例,并在其中运行此模块以进行测试和开发。

仓库 "my redovisa-page" 是如何做到这一点的示例。