Symfony2 and Google API Integration

I am going to use the Google API located at http://google-api-php-client.googlecode.com/svn/trunk/ with my Symfony2 application.

Is it possible to import this API using composer?

What are the best practices for using this API with my application?

+5
source share
4 answers

It may be too late, but there is no need to use forked git repos, you can directly link to the native Google svn.

Add the following section to composer.json:

"repositories": [
    {
        "type": "package",
        "package": {
            "name": "project/google-api-php-client",
            "version": "1.0.0",
            "source": {
                "type": "svn",
                "url": "http://google-api-php-client.googlecode.com/svn",
                "reference": "trunk"
            }
        }
    }
]

Notes:

  • "project/google-api-php-client" name can be any of your choice
  • If you need a specific revision, use the format "trunk @ revision-number-here" in the reference entry

"require":

"require": {
    ...
    "project/google-api-php-client": "1.0.0"
}

/.

, API Google , "":

"autoload": {
    ...
    "classmap": ["vendor/project/google-api-php-client/src"]
}

"", "" "/": (

+12

Google github composer.json.

Github: https://github.com/google/google-api-php-client

Packagist: https://packagist.org/packages/google/apiclient

"require": {
    ...
    "google/apiclient": "dev-master"
}

, , , , -.

+8

Symfony2, API Google , Google Github 2014 . , API , Symfony2.

Symfony2 Bundle: https://github.com/Happyr/GoogleApiBundle

$ composer require happyr/google-api-bundle
<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new HappyR\Google\ApiBundle\HappyRGoogleApiBundle(),
    );
}
+1

github API Google https://github.com/evert/google-api-php-client .

You can add composer.json to your file: "evert / google-api-php-client"

0
source

All Articles