dev-master
9999999-devGuzzle silex provider
MIT
The Requires
- php >=5.3.2
- guzzle/guzzle >=2.0.0
silex guzzle
Guzzle silex provider
This project is no longer maintained and has not been updated to work with Guzzle 5. If someone wishes to use Guzzle via a provider with Silex, then I suggest creating a new repo called something like guzzle-silex-provider
, and I'll link to it from here., (*1)
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., (*2)
You will need to install a copy of Guzzle in order to use this service provider., (*3)
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', ));
Using the instantiated ServiceBuilder:, (*4)
// Get a command "foo" from "my_client" $result = $app['guzzle']['my_client']->getCommand('foo'); $result = $foo->execute();
Using the Guzzle client:, (*5)
$response = $app['guzzle.client']->head('http://www.guzzlephp.org')->send();
More information about Guzzle ServiceBuilders can be found at http://guzzle3.readthedocs.org/en/latest/webservice-client/using-the-service-builder.html, (*6)
Guzzle silex provider
MIT
silex guzzle