Download the PHP package mrcnpdlk/weather-api without Composer

On this page you can find all versions of the php package mrcnpdlk/weather-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package weather-api

WEATHER API - (not only) Polish weather + air quality

Contents

  1. Installation
  2. Basic usage
    1. Cache
    2. Logger
  3. External sources
    1. Chief Inspectorate of Environmental Protection
    2. Airly
    3. Open Weather Map
  4. API Usage
    1. Create instance
    2. Available methods
    3. Examples

Installation

Install the latest version with composer

Basic usage

Cache

Library supports Cache bundles based on PSR-16 standard.

For below example was used phpfastcache/phpfastcache V7. phpfastcache/phpfastcache supports a lot of endpoints, i.e. Files, Sqlite, Redis and many other. More information about using cache and configuration it you can find in this Wiki.

Log

Library also supports logging packages based on PSR-3 standard, i.e. very popular monolog/monolog.

External sources

GIOS

GIOS (Chief Inspectorate of Environmental Protection - Główny Inspektorat Ochrony Środowiska) provide API without any authentication.

Airly

Airly builds networks of air quality sensors that can be deployed across entire cities or counties. If you want to use external data using this API you have to get the free Token key from here .

OWM

Open Weather Map is well know project for weather and forecast. To use it, get the free Token Key from here .

API usage

Create instance

By default API uses:

We are able to change location calling setLocation() method.

Methods

Name Description Uses external sources?
getAddress() Getting address using revers geocode no
getSunSchedule() Getting surise, sunset, twilight timing etc no
getNearestGiosStation() Getting nearest GIOS station no
getUVIndex() UV Index yes, OWM
getWeather() weather yes, OWM

Examples

getAddress()

getSunSchedule()

Method can give inappropriate results for location near pole.

getUVIndex()

getNearestGiosStation()

mrcnpdlk\Weather\NativeModel\Gios\Station has implemented two methods:

Name Description
getAirQualityIndex() Return air quality index
getSensors() Return list of available sensors for station

For each sensor getData() method return list of historical measurement data.

Native API


All versions of weather-api with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
ext-curl Version *
mrcnpdlk/psr16cache-adapter Version ~0.1.1
php-curl-class/php-curl-class Version ~8.0.3
mjaschen/phpgeo Version ^2.0.2
nesbot/carbon Version ^1.29.2
netresearch/jsonmapper Version ^1.4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mrcnpdlk/weather-api contains the following files

Loading the files please wait ....