[TOC]
## 需求
1. PHP 5.5.0
2. 使用PHP的流, allow_url_fopen 必須在php.ini中啟用。
3. 要使用cURL,你必須已經有版本cURL >= 7.19.4,并且編譯了OpenSSL 與 zlib。
>[info] ### 注解
> 如果沒有安裝cURL,Guzzle處理HTTP請求的時候不再使用cURL,而是使用PHP流處理,或者你也可以提供自己的發送HTTP請求的處理方式。
## 安裝
推薦使用 [Composer](http://getcomposer.org/) 安裝Guzzle,Composer是PHP的依賴管理工具,允許你在項目中聲明依賴關系,并安裝這些依賴。
> #### 安裝 Composer
> curl -sS https://getcomposer.org/installer | php
你可以使用composer.phar客戶端將Guzzle作為依賴添加到項目:
> php composer.phar require guzzlehttp/guzzle:^7.0
或者,你可以編輯項目中已存在的composer.json文件,添加Guzzle作為依賴:
```json
{
"require": {
"guzzlehttp/guzzle": "^7.0"
}
}
```
安裝完畢后,你需要引入Composer的自動加載文件:
```php
require 'vendor/autoload.php';
```
你可以在 [getcomposer.org](http://getcomposer.org/) 發現更多關于怎樣安裝Composer、配置自動加載以及其他有用的東西。
## 開發版
開發期間,你也可以安裝master分支下的最新內容,只需要將Guzzle版本設置成 `^7.0@dev` :
```json
{
"require": {
"guzzlehttp/guzzle": "^7.0@dev"
}
}
```
## 許可證
Licensed using the[MIT license](https://opensource.org/licenses/MIT).
*****
Copyright (c) 2015 Michael Dowling <[https://github.com/mtdowling](https://github.com/mtdowling)>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## 貢獻
### 指導方針
1. Guzzle utilizes PSR-1, PSR-2, PSR-4, and PSR-7.
2. Guzzle is meant to be lean and fast with very few dependencies. This means that not every feature request will be accepted.
3. Guzzle has a minimum PHP version requirement of PHP 7.2. Pull requests must not require a PHP version greater than PHP 7.2 unless the feature is only utilized conditionally and the file can be parsed by PHP 7.2.
4. All pull requests must include unit tests to ensure the change works as expected and to prevent regressions.
### 測試
為了做出貢獻,您需要從GitHub簽出源代碼并使用Composer安裝Guzzle的依賴項:
> git clone https://github.com/guzzle/guzzle.git
> cd guzzle && composer install
Guzzle已通過PHPUnit進行了單元測試。 使用Makefile運行測試:
> make test
>[info] ### 注解
> 您需要安裝node.js v8或更高版本才能在Guzzle的HTTP處理程序上執行集成測試。
## 報告安全漏洞
We want to ensure that Guzzle is a secure HTTP client library for everyone. If you've discovered a security vulnerability in Guzzle, we appreciate your help in disclosing it to us in a[responsible manner](https://en.wikipedia.org/wiki/Responsible_disclosure).
Publicly disclosing a vulnerability can put the entire community at risk. If you've discovered a security concern, please email us at[security@guzzlephp.org](mailto:security%40guzzlephp.org). We'll work with you to make sure that we understand the scope of the issue, and that we fully address your concern. We consider correspondence sent to[security@guzzlephp.org](mailto:security%40guzzlephp.org)our highest priority, and work to address any issues that arise as quickly as possible.
After a security vulnerability has been corrected, a security hotfix release will be deployed as soon as possible.