有关Core Reporting API的官方教程告诉我们包括两个文件:
require_once 'google-api-php-client/src/Google_Client.php';
require_once 'google-api-php-client/src/contrib/Google_AnalyticsService.php';
但是,正如我们在GitHub页面(https://github.com/google/google-google-api-php-client)上看到的那样,没有Google_Client.php
文件(实际上,我在文件夹内的任何位置都找不到它)。官方教程过时了吗?我能做些什么?
请尝试以下代码,请包含autoload.php
文件...
require_once 'google-api-php-client/autoload.php';
$client = new Google_Client();
$client->setApplicationName("Client_Library_Examples");
$client->setDeveloperKey("YOUR_APP_KEY");
$service = new Google_Service_Books($client);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句