Download the PHP package asti/weather without Composer
On this page you can find all versions of the php package asti/weather. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package weather
Short Description A module for accessing the weather module.
License MIT
Informations about the package weather
Anax module for weather forecast and history
This module can be incorporated with the Anax framework to provide a service that checks weahter forecast and historical weather data based on ip-adress. The module was created as a part of the course Webbaserade ramverk och designmönster, Blekinge Tekniska Högskola.
To install
In your composer.json do:
composer require asti/weather
Integrate the module
From the root of your Anax repo run:
Manually:
rsync -av vendor/asti/weather/config ./
rsync -av vendor/asti/weather/view ./
rsync -av vendor/asti/weather/src ./
rsync -av vendor/asti/weather/test ./
Or simply:
bash vendor/asti/weather/.anax/scaffold/postprocess.d/100_weather.bash
Add API-key
version 1.1.0 You need to use your own API key from Open Weather. Add you key in the config/weather.php file as a value to the key "API-key". You need to use your own API key from IP stack. Add you key in the config/location.php file as a value to the key "API-key".
version 1.2.0 You need to use your own API key from Open Weather. You need to use your own API key from IP stack.
Create a {your root directory}/.env file and add your key value pairs like in the example:
LOCATIONAPIKEY={your location api key}\ WEATHERAPIKEY={your weather api key}
Don't forget to att your .env to .gitignore
Update your config/page.php
The module uses a very basic page layout anax/v2/layout/default. This can be changed in config/page.php to anax/v2/layout/dbwebb_se.
Update your navigation:
Add IP and Weather to your navbar via config/navbar/header.php and via config/navbar/responsive.php
You will need to insert the following lines of code into the items-key in the above files.
[
"text" => "Väder",
"url" => "weather",
"title" => "Få väderprognos",
],
[
"text" => "VäderAPI",
"url" => "weather_api",
"title" => "Få väderprognos",
],
All versions of weather with dependencies
anax/commons Version ^2.0.14
ext-json Version *
ext-curl Version *
anax/anax Version v2.0.17
phpmetrics/phpmetrics Version ^2
phpunit/phpunit Version ^7
vlucas/phpdotenv Version ^5.3