2015-01-14 145 views
0

我想将Google Calender API与我的yii应用程序集成。无法将Google Calender API集成到yii

我遵循PHP this link步骤:

  • 我添加了谷歌库文件夹作为组分
  • 包括在config/main.php
  • 用于文库src文件夹的路径使用require_once加入autoload.php文件。

当我尝试运行它,我得到一个错误

包括(Google_Client.php):未能打开流:没有这样的文件或目录。

是不是autoload.php文件应该包括谷歌库所需的所有文件?但不知何故,这不会发生。任何想法为什么?

回答

0

解决!这是自动加载的问题。我没有注册yii的自动加载,然后调用库自动加载,然后重新注册自动加载。有效。

我添加这些线进行修复:

spl_autoload_unregister(array('YiiBase','autoload')); 
require_once realpath('/path/to/google/autoload.php'); 
spl_autoload_register(array('YiiBase','autoload')); 
相关问题