【问题标题】:Google+ and googleCalendar API : Error "Cannot redeclare class Google_Acl"Google+ 和 googleCalendar API:错误“无法重新声明 Google_Acl 类”
【发布时间】:2013-12-18 23:40:54
【问题描述】:

我正在使用 google api php 客户端。

但是,当我尝试包含以下三个库时:

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';

我得到:Cannot redeclare class Google_AclGoogle_CalendarService.php 的第 784 行。 我知道我可以修改 Google_CalendarService.php 以便仅在该类不存在时才创建该类,但这有点混乱。

我需要同时加载两个库以创建有效的 AuthURL 来授权 google plus(获取个人资料图片)和日历(获取日历)上的请求。

最好的解决方法是什么?

【问题讨论】:

    标签: php class google-api google-api-php-client


    【解决方案1】:

    好像这3个库不能一起用

    来自 google code.google-api-php-client 的回复

    不幸的是,它不是同一个对象 - 存在名称冲突 这个版本的库。 alpha 版本 1.0.0 包括更好的 避免这种情况的名称生成: http://github.com/google/google-api-php-client/

    目前的解决方法是不要同时包含两者 不幸的是。

    https://code.google.com/p/google-api-php-client/issues/detail?id=439

    【讨论】:

      猜你喜欢
      • 2023-04-02
      • 1970-01-01
      • 1970-01-01
      • 2012-01-29
      • 2012-12-24
      • 2014-01-13
      • 2010-10-17
      • 2014-11-07
      • 2012-07-31
      相关资源
      最近更新 更多