Initializes the service request object.
public __construct ( string $accessToken, string $tokenType = "OAuth" ) | ||
$accessToken | string | |
$tokenType | string |
/** * set google client * * @param string $scope * @param string $clientEmail * @param string $privateKeyFile */ public function __construct($scope, $clientEmail, $privateKeyFile) { if (!file_exists($privateKeyFile)) { throw new \InvalidArgumentException(sprintf('The file "%s" does not exist.', $privateKeyFile)); } $privateKey = file_get_contents($privateKeyFile); $credentials = new Google_Auth_AssertionCredentials($clientEmail, array($scope), $privateKey); $this->client = new Google_Client(); $this->client->setAssertionCredentials($credentials); parent::__construct(''); }