2017 © Pedro Peláez
 

silex-provider kt_guzzle-silex

Guzzle3 silex provider (kt)

image

mi-la01/kt_guzzle-silex

Guzzle3 silex provider (kt)

  • Tuesday, July 7, 2015
  • by MI-LA01
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 14 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Guzzle Silex Service Provider

The GuzzleServiceProvider provides a Guzzle ServiceBuilder and default Client object through Michael Dowling’s Guzzle framework. Guzzle is a PHP HTTP client and framework for building RESTful web service clients., (*1)

You will need to install a copy of Guzzle in order to use this service provider., (*2)

Parameters

  • guzzle.services: (optional) array|string|SimpleXMLElement Data describing your web service clients. You can pass the path to a file (.js|.json|.php), an array of data, or an instantiated SimpleXMLElement containing configuration data. See the Guzzle docs for more info.
  • guzzle.base_url: (optional) The base url for the default web service client. When left out, the actual calls made must use absolute URLs.
  • guzzle.plugins: (optional) An array of guzzle plugins to register with the client.

Services

  • guzzle: An instantiated Guzzle ServiceBuilder.
  • guzzle.client: A default Guzzle web service client using the base URL.

Registering

require __DIR__ . '/../silex.phar';
require __DIR__ . '/../vendor/Guzzle/GuzzleServiceProvider.php';

use Silex\Application;
use Guzzle\GuzzleServiceProvider;

$app = new Application();

$app->register(new GuzzleServiceProvider(), array(
    'guzzle.services' => '/path/to/services.json',
));

Example Usage

Using the instantiated ServiceBuilder:, (*3)

// Get a command "foo" from "my_client"
$result = $app['guzzle']['my_client']->getCommand('foo');
$result = $foo->execute();

Using the Guzzle client:, (*4)

$response = $app['guzzle.client']->head('http://www.guzzlephp.org')->send();

More information

More information about Guzzle ServiceBuilders can be found at http://docs.guzzlephp.org/en/latest/webservice-client/using-the-service-builder.html, (*5)

The Versions

07/07 2015

dev-master

9999999-dev

Guzzle3 silex provider (kt)

  Sources   Download

MIT

The Requires

 

silex guzzle

07/07 2015

1.0.1

1.0.1.0

Guzzle silex provider

  Sources   Download

The Requires

 

silex guzzle

13/02 2013

v1.0.0

1.0.0.0

Guzzle silex provider

  Sources   Download

The Requires

 

silex guzzle