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")) && !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' => 'Google API PHP Client',
'vendor url' => 'https://code.google.com/p/google-api-php-client/',
'download url' => 'https://code.google.com/p/google-api-php-client/downloads/list',
'version arguments' => array(
'file' => 'README',
'pattern' => '/Version (\d+)/',
'lines' => 5,
),
'files' => array(
'php' => array(
'Google_Client.php',
'config.php',
),
),
'integration files' => array(
'calendarVis' => array(
'php' => 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)."
hook_libraries_info()
implementation?