ez-google-api-php-client

UNIX name Owner Status
ez-google-api-php-client 7x stable
Version Compatible with
N/A N/A
A eZ Publish PHP client library for accessing Google APIs

Google APIs Client Library for PHP and eZPublish 4.x

Description

The Google API Client Library enables you to work with Google APIs such as Google+, Drive, or YouTube on your server with eZPublish4.x

Beta

eZPublish integration is still in beta and is in parallel development with [Google API](https://github.com/google/google-api-php-client)

Requirements

Developer Documentation

http://developers.google.com/api-client-library/php

Installation

Enabled the extension in your site.ini

Basic Example

See the examples/ directory for examples of the key client features. You can
view them in your browser by running the php built-in web server.

$ php -S localhost:8000 -t examples/

And then browsing to the host and port you specified
(in the above example, http://localhost:8000).

$googleApiIni = \eZINI::instance('googleapi.ini');
$googleAnalyticsIni = \eZINI::instance('googleanalytics.ini');
$googleapi = new eZGoogleApi(
'oauth2',
array(
'application_name' => $googleAnalyticsIni->variable('GoogleAnalyticsSettings', 'ApplicationName'),
'scopes' => \Google_Service_Analytics::ANALYTICS_READONLY
)
);

// create service and get data
$service = eZGoogleAnalytics::getService($googleapi->client);
$service->setRessource('reportingcorega');
$service->setProfileID(PROFILEID);
$service->setPeriod(PERIODAFTERBEFORE, PERIODBEFORE);
$service->setParameter("max-results", 1000);
$service->getResults();

No news yet.

This project has no reviews yet. Be the first one to review it!

No forum messages yet.