Download the PHP package isometriks/google-api-bundle without Composer

On this page you can find all versions of the php package isometriks/google-api-bundle. 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-api-bundle

Google API

Installation

Add routing:

Note: Your redirect_uri below and in the developer console should match that of the isometriks_google_redirect route. So if you do as above, then redirect_uri below in dev environment should be: http://example.com/app_dev.php/google/redirect and without app_dev.php for production. redirect_route will generate redirect_uri.

Configuration:

Controller Annotations

Without Annotations

Token Storage

By default the system will use sessions to store the tokens. If you are going to be using refresh tokens (type = offline) then this won't work well as destroying the session will destroy your refresh token since you only get one the very first time you authorize. In this case you can create your own storage, or if you need to store tokens for users we provide an abstract class to help with that.

Example of User storage:

And remember to change the config:

You can extend the abstract service we provide: isometriks_google_api.storage.user_storage As noted in the above class you will need to either add setter injection or add an argument to the constructor so you can make sure that the user is persisted in your ORM / other implementation.

Display a "Connect" screen

You can easily attach into the events to display a "connect" button view before sending the user to Google for the token using the Events::OAUTH_PRE_AUTH event:


<?php

// ...

class PreAuthListener implements EventSubscriberInterface
{
    protected $twig;

    public function __construct(\Twig_Environment $twig)
    {
        $this->twig = $twig;
    }

    public function onPreAuth(ClientEvent $event)
    {
        // Or use your own template, ours is mostly just an example
        $content = $this->twig->render('IsometriksGoogleApiBundle:OAuth:connect.html.twig', array(
            'auth_url' => $event->getClient()->createAuthUrl(),
        ));

        $event->setResponse(new Response($content));
    }

    public static function getSubscribedEvents()
    {
        return array(
            Events::OAUTH_PRE_AUTH => 'onPreAuth',
        );
    }
}

All versions of google-api-bundle with dependencies

PHP Build Version
Package Version
Requires google/apiclient Version ~1.1.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 isometriks/google-api-bundle contains the following files

Loading the files please wait ....