sxqibo/fast-weather
最新稳定版本:v1.0.3
Composer 安装命令:
composer require sxqibo/fast-weather
包简介
天气预报
README 文档
README
接口地址
https://market.aliyun.com/products/57096001/cmapi010812.html
使用方法
引入
composer require sxqibo/fast-weather
实例化
$config = [ 'appcode' => '你的 appcode', ]; $weather = new FastWeather($config);
支持接口
- getAreaToWeatherDate: 未来7日中某天的天气预报
- getAreaToWeather: 地名查询天气预报
- getAreaToId: 地名查询code
- getGpsToWeather: 经纬度查询天气预报
- getDay40: 查未来40天预报
- getDay15: 未来15天预报
- getHour24: 查询24小时预报
- getIpToWeatherIP: 查询天气预报
- getWeatherHistory: 查询历史天气情况
- getPhonePostCodeWeather: 区号邮编查询天气预报
- getSpotToWeather: 景点名称天气预报
报错处理
若出现错误如下: Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/… in xxx.php
其原因是由于本地的CURL的SSL证书太旧了,导致不识别此证书。
解决方法
- 从 http://curl.haxx.se/ca/cacert.pem 下载一个最新的证书。然后保存到一个任意目录。
- 然后把catr.pem放到php的bin目录下,然后编辑php.ini,用记事本或者notepad++打开 php.ini文件,大概在1932行。 去掉curl.cainfo前面的注释“;”,然后在后面写上cacert.pem证书的完整路径及文件名,我的如下:
- curl.cainfo = /Applications/EasySrv/software/php/php-8.2/bin/cacert.pem
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-03