2017 © Pedro Peláez
 

joomla-package google

Joomla Google Package

image

joomla/google

Joomla Google Package

  • Friday, May 25, 2018
  • by mbabker
  • Repository
  • 14 Watchers
  • 3 Stars
  • 248 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 15 Forks
  • 0 Open issues
  • 13 Versions
  • 0 % Grown

The README.md

The Google Package Build Status

Deprecated

The joomla/google package is deprecated with no further updates planned., (*1)

Using the Google Package

The Google package is designed to be a straightforward interface for working with various Google APIs. You can find a list of APIs and documentation for each API at https://developers.google.com/products/., (*2)

Instantiating Google

Instantiating Google is easy:, (*3)

use Joomla\Google\Google;

$google = new Google;

This creates a generic Google object that can be used to instantiate objects for specific Google APIs., (*4)

Sometimes it is necessary to specify additional options. This can be done by injecting in a Registry object with your preferred options:, (*5)

use Joomla\Google\Google;
use Joomla\Registry\Registry;

$options = new Registry;
$options->set('clientid', 'google_client_id.apps.googleusercontent.com');
$options->set('clientsecret', 'google_client_secret');

$google = new Google($options);

Accessing the JGoogle APIs

The Google Package divides APIs into two types: data APIs and embed APIs. Data APIs use Joomla\Http to send and receive data from Google. Embed APIs output HTML, JavaScript, and XML in order to embed information from Google in a webpage., (*6)

The Google package is still incomplete, but there are five object APIs that have currently been implemented:, (*7)

Data: Google Calendar, Google AdSense, Google Picasa, (*8)

Embed: Google Maps, Google Analytics, (*9)

Once a Google object has been created, it is simple to use it to create objects for each individual API:, (*10)

$calendar = $google->data('calendar');

or, (*11)

$analytics = $google->data('analytics');

Using an API

See below for an example demonstrating the use of the Calendar API:, (*12)

use Joomla\Google\Google;
use Joomla\Registry\Registry;

$options = new Registry;

// Client ID and Client Secret can be obtained  through the Google API Console (https://code.google.com/apis/console/).
$options->set('clientid', 'google_client_id.apps.googleusercontent.com');
$options->set('clientsecret', 'google_client_secret');
$options->set('redirecturi', JURI::current());

$google = new Google($options);

// Get a calendar API object
$calendar = $google->data('calendar');

// If the client hasn't been authenticated via OAuth yet, redirect to the appropriate URL and terminate the program
if (!$calendar->isAuth())
{
    JResponse::sendHeaders();
    die();
}

// Create a new Google Calendar called "Hello World."
$calendar->createCalendar('Hello World');

More Information

The following resources contain more information:Joomla! API Reference, Google Developers Homepage, (*13)

Installation via Composer

Add "joomla/google": "~1.0" to the require block in your composer.json and then run composer install., (*14)

{
    "require": {
        "joomla/google": "~1.0"
    }
}

Alternatively, you can simply run the following from the command line:, (*15)

composer require joomla/google "~1.0"

The Versions

09/02 2014

1.1.1

1.1.1.0 https://github.com/joomla-framework/google-api

Joomla Google Package

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

framework google joomla

03/12 2013

1.1.0

1.1.0.0 https://github.com/joomla/joomla-framework-google

Joomla Google Package

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

framework google joomla

30/11 2013
22/10 2013
16/08 2013
16/08 2013

1.0-beta

1.0.0.0-beta https://github.com/joomla/joomla-framework-google

Joomla Google Package

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

framework google joomla