From 9e63a4c091c4ac1037c3430738109835a1f1b1e8 Mon Sep 17 00:00:00 2001 From: Tobias Feijten Date: Thu, 11 Feb 2016 12:25:00 +0100 Subject: [PATCH 1/3] Update bundle to add support of Google API 2.0 --- Services/GoogleClient.php | 3 +-- UPGRADING.md | 6 ++++++ composer.json | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 UPGRADING.md diff --git a/Services/GoogleClient.php b/Services/GoogleClient.php index afae1ff..70c33d4 100644 --- a/Services/GoogleClient.php +++ b/Services/GoogleClient.php @@ -27,8 +27,7 @@ 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); + $client->setLogger($symfonyLogger); } $client -> setApplicationName($config['application_name']); diff --git a/UPGRADING.md b/UPGRADING.md new file mode 100644 index 0000000..ee3b47f --- /dev/null +++ b/UPGRADING.md @@ -0,0 +1,6 @@ +UPGRADING +========= + +Upgrade from version 2.\* to 3.\* +------------------------------- +* Since version 3.\*, we use 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. \ No newline at end of file diff --git a/composer.json b/composer.json index 960fb8d..e45b54f 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "php": ">=5.3.2", "symfony/framework-bundle": "2.*|~3.0", "symfony/yaml": "2.*|~3.0", - "google/apiclient": "1.*" + "google/apiclient": "2.*" }, "require-dev": { "mockery/mockery": "*" @@ -25,7 +25,7 @@ }, "extra": { "branch-alias": { - "dev-master": "2.2.x-dev" + "dev-master": "3.0.x-dev" } } } From cd33dbfee5512936abe9c362be5ca2a4d9faca48 Mon Sep 17 00:00:00 2001 From: Tobias Feijten Date: Thu, 11 Feb 2016 12:33:38 +0100 Subject: [PATCH 2/3] Add BC for API v1 --- Services/GoogleClient.php | 8 +++++++- UPGRADING.md | 3 ++- composer.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Services/GoogleClient.php b/Services/GoogleClient.php index 70c33d4..066c91c 100644 --- a/Services/GoogleClient.php +++ b/Services/GoogleClient.php @@ -27,7 +27,13 @@ public function __construct(array $config, LoggerInterface $symfonyLogger = null $client = new \Google_Client($config); if ($symfonyLogger) { - $client->setLogger($symfonyLogger); + //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']); diff --git a/UPGRADING.md b/UPGRADING.md index ee3b47f..ea39d5f 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -3,4 +3,5 @@ UPGRADING Upgrade from version 2.\* to 3.\* ------------------------------- -* Since version 3.\*, we use 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. \ No newline at end of file +* Since version 3.\*, 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`. \ No newline at end of file diff --git a/composer.json b/composer.json index e45b54f..f4e1daf 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "php": ">=5.3.2", "symfony/framework-bundle": "2.*|~3.0", "symfony/yaml": "2.*|~3.0", - "google/apiclient": "2.*" + "google/apiclient": "1.*|2.*" }, "require-dev": { "mockery/mockery": "*" From 627003feac3f67f79d7cf1fb329721ae76b859c3 Mon Sep 17 00:00:00 2001 From: Tobias Feijten Date: Thu, 11 Feb 2016 13:06:00 +0100 Subject: [PATCH 3/3] Change v3.0 to v2.2 --- UPGRADING.md | 4 ++-- composer.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/UPGRADING.md b/UPGRADING.md index ea39d5f..988aa57 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -1,7 +1,7 @@ UPGRADING ========= -Upgrade from version 2.\* to 3.\* +Upgrade from version 2.1.\* to 2.2.\* ------------------------------- -* Since version 3.\*, 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. +* 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`. \ No newline at end of file diff --git a/composer.json b/composer.json index f4e1daf..e5b809f 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ }, "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "2.3.x-dev" } } }