GOOGLE API客户端“PHP致命错误:未捕获错误:在/home/mybinptf/public_html/laravel/quickstart.php中找不到类'Google_Service_Sheets'”

时间:2017-12-31 13:52:55

标签: php json google-api composer-php

我正在尝试开始整合Google Api php快速启动器。我打算用它来进行文字广告投票。

文件Quickstart.phpcomposer.json位于laravel文件夹中。 我通过namecheap cpanel安装了composer。

<?php
require_once __DIR__ . '/vendor/autoload.php';


define('APPLICATION_NAME', 'Google Sheets API PHP Quickstart');
define('CREDENTIALS_PATH', '~/.credentials/sheets.googleapis.com-php-quickstart.json');
define('CLIENT_SECRET_PATH', __DIR__ . '/client_secret.json');
// If modifying these scopes, delete your previously saved credentials
// at ~/.credentials/sheets.googleapis.com-php-quickstart.json
define('SCOPES', implode(' ', array(
    Google_Service_Sheets::SPREADSHEETS_READONLY)
));

if (php_sapi_name() != 'cli') {
  throw new Exception('This application must be run on the command line.');
}

/**
 * Returns an authorized API client.
 * @return Google_Client the authorized client object
 */

0 个答案:

没有答案