rebangm/silex-guzzlehttp-provider

Guzzle http service provider for Silex

v2.0.0 2016-10-28 15:46 UTC

This package is not auto-updated.

Last update: 2024-05-22 22:54:00 UTC


README

Latest Stable Version Build Status codecov.io

Installation

Create a composer.json in your projects root-directory::

{
    "require": {
        "rebangm/silex-guzzlehttp-provider": "*"
    }
}

and run::

curl -s http://getcomposer.org/installer | php
php composer.phar install

Getting started

Supposing that the skeleton of your application is ready, you simply need to register this service provider by specifying the parameters and options needed to access Guzzle:

This will register one instance of Guzzle\Client accessible from anywhere in your application by using $app['guzzle']. all parameters are optional and they accept the same values accepted by the constructor of Guzzle\Client (see the documentation of Guzzle).

    $app->register(new SilexGuzzle\GuzzleServiceProvider(),array(
        'guzzle.base_uri' => "http://httpbin.com/",
        'guzzle.timeout' => 3.14,
        'guzzle.request_options' =>
            ['auth' => ['admin', 'admin']]
    ));

You can find more details on how to use this provider in the examples directory or the test suite.

Reporting bugs and contributing code

Contributions are highly appreciated either in the form of pull requests for new features, bug fixes or just bug reports. We only ask you to adhere to a basic basic set of rules before submitting your changes or filing bugs on the issue tracker to make it easier for everyone to stay consistent while working on the project.

Project links

Author

License

'silex-guzzlehttp-provider' is licensed under the MIT license. GitHub license