Phalcon 带phalocon的谷歌API

Phalcon 带phalocon的谷歌API,phalcon,google-login,Phalcon,Google Login,我想在phalcon php框架中使用google+api $client = new Google_Client(); $client->setClientId($client_id); $client->setClientSecret($client_secret); $client->setRedirectUri($redirect_uri); $client->addScope("https://www.googleapis.com/auth/urlshorten

我想在phalcon php框架中使用google+api

$client = new Google_Client();
$client->setClientId($client_id);
$client->setClientSecret($client_secret);
$client->setRedirectUri($redirect_uri);
$client->addScope("https://www.googleapis.com/auth/urlshortener");

在调用这些类之前,我想导入这些类。我怎么能像这样做呢。

需要这些类的最好方法是使用composer来管理它们:

在项目根目录中创建composer.json并填充:

"require": {
  "google/apiclient": "1.0.*@beta"
}
然后从根目录运行

$     composer install
然后在bootstrap或index.php中

/**
* Include composer autoloader
*/
require realpath('..') . "/vendor/autoload.php";
有关更多信息,请访问