无法尝试从Google_Service_Drive_Resource关于->获取数据中返回数据

时间:2019-04-28 07:50:21

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

尝试使用about-> get()方法恢复用户信息时,发生错误。 在方法createRequestUri中无法正确传递数据

严重性:通知

消息:未定义的索引:值

文件名:Service / Resource.php

行号:288

$this->client = new Google_Client();
$this->client->setApplicationName('report');
$this->client->setClientId($this->CI->config->item('client_id')); 
$this->client->setClientSecret($this->CI->config->item('client_secret'));
$this->client->setRedirectUri($this->CI->config->item('redirect_uri'));
$this->client->setAccessType("offline");
$this->client->setScopes(array(
    "https://www.googleapis.com/auth/drive",
    "https://www.googleapis.com/auth/drive.file",
    "https://www.googleapis.com/auth/drive.readonly"
  )
);
$drive = new Google_Service_Drive($this->client);

$drive->about->get(array('user'))

-------这是出现故障的api代码的一部分-------

if ($paramSpec['location'] == 'query') {

    if (is_array($paramSpec['value'])) {
      foreach ($paramSpec['value'] as $value) {
        $queryVars[] = $paramName . '=' . rawurlencode(rawurldecode($value));
      }
    } else {
      $queryVars[] = $paramName . '=' . rawurlencode(rawurldecode($paramSpec['value']));
    }
  }

您应该携带使用相关帐户登录的用户的信息,但是当请求修订中不存在的值时,它将失败。

A PHP Error was encountered

0 个答案:

没有答案