Download the PHP package lfischer/open-weather-map-api without Composer

On this page you can find all versions of the php package lfischer/open-weather-map-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 open-weather-map-api

Open Weather Map API Client

This library will help you integrate the Open Weather Map API to your webservice. It is lightweight and provides all necessary code including a lot of convenience methods.

Quick start

Using the API is very easy - you'll only need to provide a API key (Get one here) in order to use it. There are endpoints for retrieving different weather data by predefined conditions, like "by country and city", "by latitude and longitude", "by airport code" or even "by IP address".

Simply create a API instance and get the endpoint you need. These endpoints will contain convenience methods with typed parameters to receive the desired data.

Default options

Most endpoints can define a language to get API responses in your language. For more details scroll down :)

By default you will receive an array with the data you like. Some endpoints can be used with different modes like "XML" and "HTML".

Also it is possible to use different units like "metric" and "imperial".

API endpoints for data collection

The goal is to implement PHP classes for every data collection API endpoint. The main API class has accessor methods for each available endpoint.

Sadly some endpoints require a paid subscription which I don't have. If anyone likes to contribute or test the affected endpoints please let me know!

More convenience

The API client provides convenience methods and classes to set different modes (xml, json or html), units (metric or imperial) or languages (49 languages available).

Use the constants located in Mode, Unit and Language to get the correct values and autocompletion in your IDE.

Different Request options

The API client can use three different request adapters, according to your environment and possible other libraries.

cURL

In case you can not use file_get_contents, you can use the 'Curl' request adapter. For this your environment needs to provide the curl PHP extension.

Dump

The Dump request adapter can be used to return the prepared URL in case you have your own request library to work with. This is also used for testing.

Guzzle

If you are a fan of the great Guzzle library, you can use this adapter and make use of all its great features :)

Simple

The 'Simple' request adapter makes use of file_get_contents (just as the previous versions). For this adapter you will need to activate the fopen wrappers.

Response types

According to the mode option the response will be returned in a different Response class. Every response type has a getResponse method that returns the specific set of data.

Each type also contains a getRawResponse method which will return the raw string response from the API, in case you'd like to process the response on your own.

Contribution

As mentioned before I do not have a paid subscription in order to develop and test every data collection. For this I need YOUR help ;)

If anyone likes to contribute or test the affected endpoints please let me know!


All versions of open-weather-map-api with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
ext-curl Version *
ext-json Version *
ext-libxml Version *
ext-simplexml Version *
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 lfischer/open-weather-map-api contains the following files

Loading the files please wait ....