dev-master
9999999-devGuzzle3 silex provider (kt)
MIT
The Requires
- php >=5.3.2
- guzzle/guzzle >=2.0.0
silex guzzle
Guzzle3 silex provider (kt)
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)
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:, (*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 about Guzzle ServiceBuilders can be found at http://docs.guzzlephp.org/en/latest/webservice-client/using-the-service-builder.html, (*5)
Guzzle3 silex provider (kt)
MIT
silex guzzle