Installing and loading google client php api I am developing a php module that uses the Google Client class from the google client php api. I have downloaded and unzipped the latest google client php api at sites/all/libraries, and put my module at sites/all/modules. The code loading the library is this: 

if (($library = libraries_load("google-api-php-client")) &amp;&amp; !empty($library['loaded'])) {
    print "success";
}

$client = new Google_Client();


However, I am getting "Class 'Google_Client' not found" when I try to access it. Also, the print is not showing, as if the library never loads. However when I use libraries_get_path() I do receive the correct path: sites/all/libraries/google-api-php-client

I have tried the checks here but they all fail. I am using the Libraries API 7.x-2.1 and drupal 7.22

My hook_libraries_info() implementation: 

function hook_libraries_info() {
    $libraries['google-api-php-client'] = array(
        'name' =&gt; 'Google API PHP Client', 
        'vendor url' =&gt; 'https://code.google.com/p/google-api-php-client/', 
        'download url' =&gt; 'https://code.google.com/p/google-api-php-client/downloads/list', 
        'version arguments' =&gt; array(
            'file' =&gt; 'README',
            'pattern' =&gt; '/Version (\d+)/', 
            'lines' =&gt; 5,
        ), 
        'files' =&gt; array(
            'php' =&gt; array(
                'Google_Client.php',
                'config.php',
            ),
        ),
        'integration files' =&gt; array(
            'calendarVis' =&gt; array(
                'php' =&gt; array(
                    'Google_Client.php',
                    'config.php',
                ),
            ),
        ),
    );
    return $libraries;
}


Other than that, I have tried creating an .info file, which worked on my initial wampserver setup, but I cannot make it work anywhere else. Here is the .info file:

name = calendarVis
description = Google Calendar Visualization for P-space
core = 7.x

dependencies[] = libraries


Also, after accessing the page that uses the module and returning to administrator menus, I am getting this error message:

"Warning: Invalid argument supplied for foreach() in libraries_invoke() (line 161 of drupal-7.22/sites/all/modules/libraries/libraries.module).
Notice: Undefined index: installed in libraries_load() (line 621 of drupal-7.22/sites/all/modules/libraries/libraries.module)."
Here's an updated answer (the version of the client library I'm using is  "google/apiclient": "1.0.*@beta")

    function hook_libraries_info() {
     $libraries['google-api-php-client'] = array(
     'name' =&gt; 'Google API PHP Client',
     'vendor url' =&gt; 'http://developers.google.com/api-client-library/php',
     'download url' =&gt; 'http://developers.google.com/api-client-library/php',
     'path' =&gt; 'src/Google/',
     'version' =&gt; '1',
     'files' =&gt; array(
      'php' =&gt; array(
        'autoload.php'
      )
    )
  );
  return $libraries;
}


Note, the 'autoload.php' file in the files array.  This will automagically load all the classes you might want, and seems to work well for me; rather than manually selecting each file the library includes that I might need.

I load the library and then use it like this:

$library = libraries_load('google-api-php-client');
module_load_include('inc', 'page_speed', 'page_speed_client');


My inc file contains the logic I want for defining a new client and service (see the Google docs) and does a Pagespeed Insight query, and (for now) simply dumps the returned data onto a page.

Final caveat, remember to clear cache if you edit your files array, otherwise the library won't load properly, that caught me out a couple of times.