Download the PHP package yidas/google-apiclient-helper without Composer

On this page you can find all versions of the php package yidas/google-apiclient-helper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package google-apiclient-helper

Google API Client Helper


Google APIs Client Helper - Easy way to accessing Google APIs with PHP

Latest Stable Version Latest Unstable Version License

FEATURES

This Helper is based on google-api-php-client and google-api-php-client-services.


OUTLINE

DEMONSTRATION


REQUIREMENTS

This library requires the following:


INSTALLATION

Run Composer in your project:

composer require yidas/google-apiclient-helper

Then you could call it after Composer is loaded depended on your PHP framework:


GOOGLE CLIENT

Configuration

There are many way to set Google_Client by Helper:

Config Array Method

The config keys refer to the methods of Google_Client. For exmaple, authConfig refers to Google_Client->setAuthConfig().

Config Chain Method

The methods refer to the same method names of Google_Client. For exmaple, setAuthConfig() refers to Google_Client->setAuthConfig().

`

Encapsulating Method

After encapsulating Google_Client into Helper, the Helper would share with the same Google_Client object.

AccessToken Usage

refreshAccessToken()

Simple way to get refreshed access token or false expired to skip

Example:

Helper handles the setting setAccessType('offline') & setApprovalPrompt('force') for refresh token.

verifyAccessToken()

Verify an access_token. This method will verify the current access_token by Google API, if one isn't provided.

verifyScopes()

Verify scopes of tokenInfo by access_token. This method will verify the current access_token by Google API, if one isn't provided.

Example:

Implementation

There are more implementations such as addScope() or createAuthUrl() for OAuth register, you cloud refer following sample code:

yidas/php-google-api-sample


GOOGLE SERVICES

You could directly use any Service Helpers which uses Google_Client from yidas\google\apiHelper\Client:

Or you could reset a Google_Client for each Service Helper:

Use getService() to get back current Google Service object for advanced usage:

People

API Document: https://developers.google.com/people/api/rest/

People helper has smart call refered to Google_Service_PeopleService_Person methods, which provides easy interface to setValue() for a person.

Attributes

It's easy to set attributes for a person by Helper, which provides three types for input data:

1. Origin Object

Input by original Google Attribute Classes that are not so convenience.

2. Array

Input by array type would map to the API key-value setting.

3. String

Input by string type would enable Helper attribute handler which automatically settles value for all attributes.

getSimpleContacts()

Get simple contact data with parser

Example:

Result:

This is simple fields parser, you could use listPeopleConnections() if you need all fields.

createContact()

Create a People Contact

Example:

Resource Name: $person->resourceName or $person['resourceName'].

updateContact()

Update a People Contact

Example:

deleteContact

Delete a People Contact

Example:

You could also use find pattern:


EXCEPTIONS

For all Google Exception including Client and Services:

Otherwise, for Google Services only:


REFERENCE


All versions of google-apiclient-helper with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
google/apiclient Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package yidas/google-apiclient-helper contains the following files

Loading the files please wait ....