When you create a bundle, you have to work with the functions of the framework and use the built-in autoloader.
Do not fight with the frame
In your case, I would prefer the Tools folder in your Bundle. Then you can put your google classes in this folder and create a proxy class that is in the correct namespace and abstract google code.
In the Service class, you can import your library with the requirement or load your sources on top of the composer. We use the easiest way here.
<?php namespace MySF2Bundle\Service; require_once __DIR__.'/google-api-php-client/src/Google_Client.php' ... class GoogleAPIWrapper { public function getGoogleDriveConnection() { } }
You can then use it in your Bundle when importing a namespace:
use MySF2Bundle\Service\GoogleAPIWrapper;
With this method, you can abstract the Google APIs from your Bundle code, and you can work with a better framework. You may have encountered problems in namespaces. But you can check it out.
Otherwise, you can look at other Github nodes how they implement external libraries.
Here is another way:
http://www.kiwwito.com/article/add-third-party-libraries-to-symfony-2 Add external libraries to the Symfony2 project
So you can implement the full lib library and load the library into the symfony2 autoloader
$loader->registerPrefixes(array( 'Google' => __DIR__.'/../vendor/Google/Drive/', ));
So, you see that there are some possibilities for implementing an external library.
Stony source share