PHP code example of socloz / guzzle-bundle
1. Go to this page and download the library: Download socloz/guzzle-bundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
socloz / guzzle-bundle example snippets
php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Ddeboer\GuzzleBundle\DdeboerGuzzleBundle(),
);
}
/*
* Copyright CloseToMe 2011/2012
*/
namespace Acme\ExampleBundle\Webservice;
use Guzzle\Common\Collection;
use Guzzle\Service\Client;
use Guzzle\Service\Description\ServiceDescription;
class MyWebserviceClient extends Client
{
public static function factory($config = array())
{
$client = new self($config['base_url'], $config);
// Add custom setup code
// Attach a service description to the client
$description = ServiceDescription::factory($config);
$client->setDescription($description);
return $client;
}
}