I have added a library to the libraries folder. I have the Libraries API module installed and I wrote this code:
function my_module_libraries_info() { $libraries['google-api-php-client'] = array( 'name' => 'Google Api PHP Client', 'path' => 'src/Google', 'vendor_url' => 'https://github.com/google/google-api-php-client', 'download_url'=> 'https://github.com/google/google-api-php-client', 'files' => array( 'php' => array( 'Client.php', 'Service.php', ), ), ); return $libraries; }
and the code to call it
$library =libraries_load('google-api-php-client'); dpm($library);
This dpm did give me a library array, so it looked like it was ok. But then I tried
$client = new Google_Client();
and I got an error:
PHP Fatal error: require(): Failed opening required 'http://[site-name-here]/sites/all/libraries/google-api-php-client/src/Google/Client.php'
When I tried this
global $base_root; require $base_root . '/'. libraries_get_path('google-api-php-client') . '/src/Google/Client.php';
I got the same error message. I checked and saw tat the files were still there. What is going wrong?