title: Example on how to config google cloud storage with KnpGaufetteBundle
body: <p>I am trying to configure a <a href="https://github.com/KnpLabs/KnpGaufretteBundle" rel="nofollow">KnpGaufretteBundle</a> to use <code>Google Cloud Storage</code> for storing my files. This is the config:</p>
  
  <pre><code>## definition of the GCS service
  app.google_cloud_storage.service:
      class: \Google_Service_Storage
      factory_class: Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\GoogleCloudStorageAdapterFactory
      factory_method: 'create'
      arguments: 
          - "123@developer.gserviceaccount.com"
          - "http://localhost/file.p12"
          - "pwd"
  
  ## config of knp_gaufrette
  knp_gaufrette:
      stream_wrapper: ~
      adapters:
          gcs_minn_images:
              google_cloud_storage:
                  service_id: 'app.google_cloud_storage.service'
                  bucket_name: 'minn-images'
      filesystems:
          gcs_minn_images_fs:
              adapter: gcs_minn_images 
  </code></pre>
  
  <p>The error message I got is:</p>
  
  <p><strong>ContextErrorException in GoogleCloudStorageAdapterFactory.php line 16:
  Catchable Fatal Error: Argument 1 passed to Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\GoogleCloudStorageAdapterFactory::create() must be an instance of Symfony\Component\DependencyInjection\ContainerBuilder, string given, called in /home/amine/NetBeansProjects/tuto/app/cache/dev/appDevDebugProjectContainer.php on line 724 and defined</strong></p>
  
  <p>According to the error message, I gave a string of stead of ContainerBuilder. Great! Let's add the ContainerBuilder to the arguments as follows:</p>
  
  <pre><code>## definition of the GCS service
  app.google_cloud_storage.service:
      class: \Google_Service_Storage
      factory_class: Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\GoogleCloudStorageAdapterFactory
      factory_method: 'create'
      arguments: 
          - @service_container
          - "123@developer.gserviceaccount.com"
          - "http://localhost/file.p12"
          - "pwd"
  </code></pre>
  
  <p>The result is again an error:</p>
  
  <p><strong>Catchable Fatal Error: Argument 1 passed to Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\GoogleCloudStorageAdapterFactory::create() must be an instance of Symfony\Component\DependencyInjection\ContainerBuilder, instance of appDevDebugProjectContainer given, called in /home/amine/NetBeansProjects/tuto/app/cache/dev/appDevDebugProjectContainer.php on line 724 and defined</strong></p>
  
  <p>So now, the error is telling me that I provide an instance of appDevDebugProjectContainer in stead of ContainerBuilder!!</p>
  
  <p>Ok, let's have a look to <code>/home/amine/NetBeansProjects/tuto/app/cache/dev/appDevDebugProjectContainer.php</code> on line 724...</p>
  
  <pre><code>class appDevDebugProjectContainer extends Container{
  // ...
  /**
   * Gets the 'app.google_cloud_storage.service' service.
   *
   * This service is shared.
   * This method always returns the same instance of the service.
   *
   * @return \Google_Service_Storage A Google_Service_Storage instance.
   */
  protected function getApp_GoogleCloudStorage_ServiceService()
  {
      return $this-&gt;services['app.google_cloud_storage.service'] =\Knp\Bundle\GaufretteBundle\DependencyInjection\Factory\GoogleCloudStorageAdapterFactory::create($this, '123@developer.gserviceaccount.com', 'http://localhost/file.p12', 'pwd');
  }
  </code></pre>
  
  <p>I am really lost...
  So, is there any <strong>complete example</strong> to config google cloud storage?</p>