Download the PHP package jtipsy/weather without Composer

On this page you can find all versions of the php package jtipsy/weather. 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

weather

基于高德开放平台的PHP天气信息组件

安装

配置

使用

获取实时天气

示例:

{

"status": "1",
"count": "1",
"info": "OK",
"infocode": "10000",
"lives": [
    {
        "province": "内蒙古",
        "city": "呼和浩特市",
        "adcode": "150100",
        "weather": "阴",
        "temperature": "-9",
        "winddirection": "北",
        "windpower": "4",
        "humidity": "53",
        "reporttime": "2021-12-16 17:00:39"
    }
]

}

获取近期天气预报

示例:

{

"status": "1",
"count": "1",
"info": "OK",
"infocode": "10000",
"forecasts": [
    {
        "city": "呼和浩特市",
        "adcode": "150100",
        "province": "内蒙古",
        "reporttime": "2021-12-16 17:00:39",
        "casts": [
            {
                "date": "2021-12-16",
                "week": "4",
                "dayweather": "多云",
                "nightweather": "晴",
                "daytemp": "-4",
                "nighttemp": "-17",
                "daywind": "西北",
                "nightwind": "西北",
                "daypower": "4",
                "nightpower": "4"
            },
            {
                "date": "2021-12-17",
                "week": "5",
                "dayweather": "晴",
                "nightweather": "晴",
                "daytemp": "-8",
                "nighttemp": "-17",
                "daywind": "西",
                "nightwind": "西",
                "daypower": "4",
                "nightpower": "4"
            },
            {
                "date": "2021-12-18",
                "week": "6",
                "dayweather": "晴",
                "nightweather": "晴",
                "daytemp": "-3",
                "nighttemp": "-14",
                "daywind": "西",
                "nightwind": "西",
                "daypower": "4",
                "nightpower": "4"
            },
            {
                "date": "2021-12-19",
                "week": "7",
                "dayweather": "晴",
                "nightweather": "晴",
                "daytemp": "-1",
                "nighttemp": "-11",
                "daywind": "西",
                "nightwind": "西",
                "daypower": "4",
                "nightpower": "4"
            }
        ]
    }
]

}

获取XML格式返回值

示例:

参数说明

在Laravel中使用

在 Laravel 中使用也是同样的安装方式,配置写在 config/services.php 中:

'weather' => [
    'key' => env('WEATHER_API_KEY'),
],

可以用两种方式来获取 Jtipsy\Weather\Weather 实例:

public function edit(Weather $weather) 
{
    $response = $weather->getWeather('呼和浩特市');
}

public function edit() 
{
    $response = app('weather')->getWeather('深圳');
}

参考

License

MIT# weather


All versions of weather with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^7.4
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 jtipsy/weather contains the following files

Loading the files please wait ....