Вопрос

When using the described in the Google Contacts API example simple.php, and the Google API PHP Client from GitHub, version 1.0.4-beta, I get the following error:

Fatal error: Call to undefined method Google_IO_Curl::authenticatedRequest()

However, when I change this line...

$val = $client_svc_contacts->getIo()->authenticatedRequest($req);

...to...

$val = $client_svc_contacts->getAuth()->authenticatedRequest($req);

...then it starts working again.

I am using version 1.0.4-beta unmodified except for the addition of the following line at the top of Client.php:

set_include_path(str_replace('/Google','',dirname(__FILE__)));

I recognize that simple.php was written for version 0.6, not v1+, but is the example just out of date compared to the version on GitHub? Or is there something wrong with my implementation?

Это было полезно?

Решение

Found a migration guide that had the answer ...

A new home for authenticatedRequest

The authenticatedRequest method has been moved from the io classes to the auth classes.

So it appears that replacing getIo() with getAuth() was the correct course of action.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top