title: Symfony2.3, How to register a 3rd party bundle in Kernel, and load it from a Controller?
body: <p>I would like to get some help with symfony2 regarding the bundle registration in the Kernel,</p>
  
  <p>Ive read most of symfony2 cookbook and doc for exemple : <a href="http://symfony.com/doc/current/cookbook/bundles/installation.html" rel="nofollow">How to install 3rd party Bundles</a> </p>
  
  <p>But yet everytime I failed doing so.
  I am using symfony 2.3 with composer, both up to date.</p>
  
  <p>Today I would like to use a 3rd party bundle called "google/apiclient"
  found on <a href="https://packagist.org/packages/google/apiclient" rel="nofollow">packagist.org</a>, therefor i add the following line <code>"google/apiclient": "dev-master"</code> to my composer.json file which is located at the root of my project.</p>
  
  <p>Followed by a <code>composer.phar update</code> in order to get the bundle which was downloaded with success and installed in the vendor repository</p>
  
  <p>I belive that so far im doing okay, but the next step is where i get lost.</p>
  
  <p>Next I belive ive to register this new bundle in the app\AppKernel.php
  like the other one, for exemple:<br/> <code>new Symfony\Bundle\TwigBundle\TwigBundle()</code></p>
  
  <p>But I don't know what to write for the <code>new google\apiclient ...</code><br/>
  <strong>So first question is what should I write there and how do you figure it out ?</strong></p>
  
  <p>Once this is done properly, I belive that i'm now able to use it in a controller,
  but my second question is :<br/>
  <strong>How do i load the Client.php which is located in vendor/google/apiclient/src/Google ?</strong></p>
  
  <p>The point of all of this, is to be able to sth like the given exemple in my controller:</p>
  
  <pre><code> require_once 'Google/Client.php';
    require_once 'Google/Service/Books.php';
    $client = new Google_Client();
    $client-&gt;setApplicationName("Client_Library_Examples");
    $client-&gt;setDeveloperKey("YOUR_APP_KEY");
    $service = new Google_Service_Books($client);
    $optParams = array('filter' =&gt; 'free-ebooks');
    $results = $service-&gt;volumes-&gt;listVolumes('Henry David Thoreau', $optParams);
  
    foreach ($results as $item) {
      echo $item['volumeInfo']['title'], "&lt;br /&gt; \n";
    }
  </code></pre>
  
  <p>The goal is to be able to use the google contact api in a symfony2 controller.
  Any help or suggestion welcome, cheers</p>