Overview

Requirements

  • PHP 5.5.0
  • To use the PHP stream handler, allow_url_fopen must be enabled in yoursystem's php.ini.
  • To use the cURL handler, you must have a recent version of cURL >= 7.19.4compiled with OpenSSL and zlib.

Note

Guzzle no longer requires cURL in order to send HTTP requests. Guzzle willuse the PHP stream wrapper to send HTTP requests if cURL is not installed.Alternatively, you can provide your own HTTP handler used to send requests.

Installation

The recommended way to install Guzzle is withComposer. Composer is a dependency management toolfor PHP that allows you to declare the dependencies your project needs andinstalls them into your project.

  1. # Install Composer
  2. curl -sS https://getcomposer.org/installer | php

You can add Guzzle as a dependency using the composer.phar CLI:

  1. php composer.phar require guzzlehttp/guzzle:~6.0

Alternatively, you can specify Guzzle as a dependency in your project'sexisting composer.json file:

  1. {
  2. "require": {
  3. "guzzlehttp/guzzle": "~6.0"
  4. }
  5. }

After installing, you need to require Composer's autoloader:

  1. require 'vendor/autoload.php';

You can find out more on how to install Composer, configure autoloading, andother best-practices for defining dependencies at getcomposer.org.

Bleeding edge

During your development, you can keep up with the latest changes on the masterbranch by setting the version requirement for Guzzle to ~6.0@dev.

  1. {
  2. "require": {
  3. "guzzlehttp/guzzle": "~6.0@dev"
  4. }
  5. }

License

Licensed using the MIT license.

Copyright (c) 2015 Michael Dowling <https://github.com/mtdowling>Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, 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 INTHE SOFTWARE.

Contributing

Guidelines

  • Guzzle utilizes PSR-1, PSR-2, PSR-4, and PSR-7.
  • Guzzle is meant to be lean and fast with very few dependencies. This meansthat not every feature request will be accepted.
  • Guzzle has a minimum PHP version requirement of PHP 5.5. Pull requests mustnot require a PHP version greater than PHP 5.5 unless the feature is onlyutilized conditionally.
  • All pull requests must include unit tests to ensure the change works asexpected and to prevent regressions.

Running the tests

In order to contribute, you'll need to checkout the source from GitHub andinstall Guzzle's dependencies using Composer:

  1. git clone https://github.com/guzzle/guzzle.git
  2. cd guzzle && curl -s http://getcomposer.org/installer | php && ./composer.phar install --dev

Guzzle is unit tested with PHPUnit. Run the tests using the Makefile:

  1. make test

Note

You'll need to install node.js v0.5.0 or newer in order to performintegration tests on Guzzle's HTTP handlers.

Reporting a security vulnerability

We want to ensure that Guzzle is a secure HTTP client library for everyone. Ifyou've discovered a security vulnerability in Guzzle, we appreciate your helpin disclosing it to us in a responsible manner.

Publicly disclosing a vulnerability can put the entire community at risk. Ifyou've discovered a security concern, please email us atsecurity@guzzlephp.org. We'll work with you to make sure that we understand thescope of the issue, and that we fully address your concern. We considercorrespondence sent to security@guzzlephp.org our highest priority, and work toaddress any issues that arise as quickly as possible.

After a security vulnerability has been corrected, a security hotfix release willbe deployed as soon as possible.