Skip to content

Commit

Permalink
Merge pull request #16 from tobias-93/api2.0
Browse files Browse the repository at this point in the history
Update bundle to add support of Google API 2.0
  • Loading branch information
Nyholm committed Feb 11, 2016
2 parents 246d781 + 627003f commit 094982d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
9 changes: 7 additions & 2 deletions Services/GoogleClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@ public function __construct(array $config, LoggerInterface $symfonyLogger = null

$client = new \Google_Client($config);
if ($symfonyLogger) {
$googleLogger = new \Google_Logger_Psr($client, $symfonyLogger);
$client->setLogger($googleLogger);
//BC for Google API 1.0
if (class_exists('\Google_Logger_Psr')) {
$googleLogger = new \Google_Logger_Psr($client, $symfonyLogger);
$client->setLogger($googleLogger);
} else {
$client->setLogger($symfonyLogger);
}
}

$client -> setApplicationName($config['application_name']);
Expand Down
7 changes: 7 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
UPGRADING
=========

Upgrade from version 2.1.\* to 2.2.\*
-------------------------------
* Since version 2.2.\*, we support version 2.\* of the Google API. Although this doesn't change much to the API of this bundle, you should be aware that many things changed (including authentication) in the Google API. See https://github.com/google/google-api-php-client/blob/master/UPGRADING.md.
If you do not want to upgrade, you should add the version constraint `"google/apiclient": "1.*"` to your `composer.json`.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"php": ">=5.3.2",
"symfony/framework-bundle": "2.*|~3.0",
"symfony/yaml": "2.*|~3.0",
"google/apiclient": "1.*"
"google/apiclient": "1.*|2.*"
},
"require-dev": {
"mockery/mockery": "*"
Expand All @@ -25,7 +25,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.2.x-dev"
"dev-master": "2.3.x-dev"
}
}
}

0 comments on commit 094982d

Please sign in to comment.