Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8852565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:25:58+00:00 2026-06-14T13:25:58+00:00

I’m doing a bundle in symfony2 with google drive api. I have a class

  • 0

I’m doing a bundle in symfony2 with google drive api. I have a class in Utils folder: Authentication which interact with the files from google (that I put in that exact same folder) and I wanna include those files in my Authentication.php.

I include like this:

require_once 'google-api-php-client/src/Google_Client.php';
require_once 'google-api-php-client/src/contrib/Google_DriveService.php';
require_once 'google-api-php-client/src/contrib/Google_Oauth2Service.php';

But I get this error:

Fatal error: main(): Failed opening required ‘google-api-php-client\src\Google_Client.php’

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T13:25:59+00:00Added an answer on June 14, 2026 at 1:25 pm

    When you build a Bundle you should work with the framework functions and use the integrated autoloader.

    Don’t fight the framework

    In your case i would prefer a Service folder in your Bundle. Then you can put your google classes in that folder and build a Proxy class which is in the correct namespace and abstract your google code.

    In the Service class you can import your lib with require or you can load your sources over composer. We use here the easiest way.

    <?php    
    namespace MySF2Bundle\Service;
    
    require_once __DIR__.'/google-api-php-client/src/Google_Client.php'
    ...
    
    class GoogleAPIWrapper {
        public function getGoogleDriveConnection() {
           /**
            * Implement the Google drive functions
            */
        }
    }
    

    Then you can use it in your Bundle when you import the namespace:

    use MySF2Bundle\Service\GoogleAPIWrapper;
    

    With this method you can abstract the Google API from your Bundle Code and you can work with a better structure. Its possible that you get some trouble with the namespaces. But you can test it.

    Otherwise you can look on other bundles on Github 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 Symfony2 project

    So you can implement the complete lib and load the library in the symfony2 autoloader

    $loader->registerPrefixes(array(
        'Google' => __DIR__.'/../vendor/Google/Drive/',
    ));
    

    So you see there are some possibilities to implement an external Library.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am doing a simple coin flipping experiment for class that involves flipping a
I have an autohotkey script which looks up a word in a bilingual dictionary
I have an array which has BIG numbers and small numbers in it. I
I have a text area in my form which accepts all possible characters from
I have thousands of HTML files to process using Groovy/Java and I need to
I have a bunch of posts stored in text files formatted in yaml/textile (from
I'm making a simple page using Google Maps API 3. My first. One marker
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.