Download the PHP package davidwofford/phpdarksky without Composer
On this page you can find all versions of the php package davidwofford/phpdarksky. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download davidwofford/phpdarksky
More information about davidwofford/phpdarksky
Files in davidwofford/phpdarksky
Package phpdarksky
Short Description PhpDarkSky is a simple wrapper for making requests to the dark sky api - https://darksky.net/dev
License MIT
Homepage https://github.com/davidwofford/PhpDarkSky
Informations about the package phpdarksky
PHP Dark Sky
A simple wrapper for connecting to and pulling information from the Dark Sky api
Features
- An easy to use wrapper for connecting to the dark sky api to get weather data
- Methods to get filtered down data instead of 1 massive blob
Notes
- All data is returned as associative arrays
- Errors from the Dark Sky api are returned as exceptions
Requirements
- PHP >= 7.2
- A Dark Sky api key
Installation
Composer
To install through composer add the following line to your composer.json
file:
or run this command
Copy
If you do not wish to use composer, copy the PhpDarkSky directory to your library / vendor folder and add:
Usage
Get the forecast
To get all of the forecast data for a location
Get the current forecast only
This will return data that would be in the currently
array from getForecast
There is a similar function for all of the other arrays that appear in getForecast
as well.
Get the time machine data
To get the time machine data for a location
As with the forecast items above there is a method to get filtered down arrays for each of the array items that appear from this call as well.
Configuration
If you are having issues with your ssl cert being denied locally you can add this define in your project to bypass the ssl cert check.
define('PHP_DARK_SKY_BYPASS_SSL', true);
DO NOT TURN THIS ON IN PRODUCTION