bashikr/weather-module

Anax天气模块。

v2.10.0 2020-12-11 13:13 UTC

README

Build Status CircleCI Scrutinizer Code Quality Code Coverage Build Status Code Intelligence Status Pipeline GitLab

天气模块 (bashikr/weather-module)

Anax天气模块 (weather-module) 实现了天气服务。您可以使用此模块,与Anax安装一起使用。

如何将weather-module作为服务使用?

这是一个Anax模块,其使用主要是为了与Anax框架一起使用。您可以在anax/anax上先安装一个实例,然后在其中运行此模块。

在安装模块之前,请确保您的Anax项目根目录中的 autoload and require 结构与您的 composer.json 相同。

"autoload": {
    "psr-4": {
        "Anax\\": "src/",
        "Bashar\\": "src/"
    }
},

使用composer安装。

要使用composer安装weather-module,请输入以下命令

composer require bashikr/weather-module

您可以使用scaffold postprocessing文件复制所有模块配置文件。

# Go to the root of your Anax base repo
bash vendor/bashikr/weather-module/.anax/scaffold/postprocess.d/700_weather_module.bash

一旦执行了上述bash命令,您../config/page.php的结构将发生变化。因此,您必须再次用原始内容替换page.php的内容。在这里,您可以复制Anax模板代码page.php

请勿忘记在配置存储库中添加您的令牌

在此文件中插入您的天气令牌

# Go to the root of your Anax base repo
config/OpnWrMpToken.php

在此文件中插入您的IP令牌

# Go to the root of your Anax base repo
config/geoToken.php

启动模块,请将此路由 /ip-weather 添加到导航栏。您可以在路径中找到导航栏文件

# Go to the root of your Anax base repo

config/navbar/header.php          // The actual navbar
# Go to the root of your Anax base repo

config/navbar/responsive.php      // The hamburger menu