1. Go to this page and download the library: Download mrcnpdlk/weather-api library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mrcnpdlk / weather-api example snippets
/**
* Cache in system files
*/
$oFilesConfig = new \Phpfastcache\Drivers\Files\Config();
$oFilesConfig->setPath(sys_get_temp_dir())->setDefaultTtl(60);
$oInstanceCacheFiles = new \Phpfastcache\Helper\Psr16Adapter('files', $oFilesConfig);
/**
* Cache in Redis
*/
$oRedisConfig = new \Phpfastcache\Drivers\Redis\Config();
$oRedisConfig
->setHost('localhost')
->setPort(6379)
->setDefaultTtl(60)
;
$oInstanceCacheRedis = new \Phpfastcache\Helper\Psr16Adapter('redis', $oRedisConfig);
$oClient = new \mrcnpdlk\Weather\Client();
$oClient
->setCacheInstance($oInstanceCacheFiles)
->setLoggerInstance($oInstanceLogger)
->setAirlyConfig('AIRLY_TOKEN') // not
use mrcnpdlk\Weather\NativeModel\GeoPoint;
$oApi->setLocation(new GeoPoint(51.758158,19.544377));