projecttester / google-api-php-client

Automatically exported from code.google.com/p/google-api-php-client
Apache License 2.0
0 stars 0 forks source link

Google+ and googleCalendar API : Error “Cannot redeclare class Google_Acl” #439

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am using the google api php client.

Howewer, when I'm trying to include the three following libraries:

require_once app_path().'/library/googleapi/contrib/Google_PlusService.php';
require_once app_path().'/library/googleapi/contrib/Google_TasksService.php';
require_once app_path().'/library/googleapi/contrib/Google_CalendarService.php';
I get : Cannot redeclare class Google_Acl on line 784 of 
Google_CalendarService.php. I know I could modify Google_CalendarService.php so 
that the class is only created if it doesn't exist, but this is kind of messy.

I need to load both libraries at the same time to create a valid AuthURL to 
authorize requests on google plus (to get the profile image) and the calendar 
(to get the calendar).

What's the best workaround for this ?

Original issue reported on code.google.com by hipp....@gmail.com on 18 Dec 2013 at 11:53

GoogleCodeExporter commented 9 years ago
Unfortunately its not the same object - there is name collision in this version 
of the library. The alpha version 1.0.0 includes better name generation that 
avoids this: http://github.com/google/google-api-php-client/

The workaround at the moment is not to include both at the same time 
unfortunately. 

Original comment by ianbar...@google.com on 19 Dec 2013 at 11:29