Skip to content
This repository was archived by the owner on Jul 19, 2024. It is now read-only.

Commit 6f12c76

Browse files
bump up to ^2.0 of superbalist/php-pubsub-google-cloud + add client_identifier support
1 parent abac158 commit 6f12c76

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 2.0.0 - 2016-10-05
4+
5+
* Bump up version ^2.0 of superbalist/php-pubsub-google-cloud
6+
* Add support for `client_identifier` config var added to superbalist/php-pubsub-google-cloud package
7+
38
## 1.0.2 - 2016-09-15
49

510
* Add support for configuring auto topic & subscription creation for the php-pubsub-google-cloud adapter

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"illuminate/support": "^5.3",
1414
"superbalist/php-pubsub": "^1.0",
1515
"superbalist/php-pubsub-redis": "^1.0",
16-
"superbalist/php-pubsub-google-cloud": "^1.0",
16+
"superbalist/php-pubsub-google-cloud": "^2.0",
1717
"illuminate/console": "^5.3"
1818
},
1919
"autoload": {

config/pubsub.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
'driver' => 'gcloud',
5858
'project_id' => env('GOOGLE_CLOUD_PROJECT_ID'),
5959
'key_file' => env('GOOGLE_CLOUD_KEY_FILE'),
60+
'client_identifier' => null,
6061
'auto_create_topics' => true,
6162
'auto_create_subscriptions' => true,
6263
],

src/PubSubConnectionFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,10 @@ protected function makeGoogleCloudAdapter(array $config)
110110
];
111111
$client = $this->container->make('pubsub.gcloud.pub_sub_client', ['config' => $clientConfig]);
112112

113+
$clientIdentifier = array_get($config, 'client_identifier');
113114
$autoCreateTopics = array_get($config, 'auto_create_topics', true);
114115
$autoCreateSubscriptions = array_get($config, 'auto_create_subscriptions', true);
115116

116-
return new GoogleCloudPubSubAdapter($client, $autoCreateTopics, $autoCreateSubscriptions);
117+
return new GoogleCloudPubSubAdapter($client, $clientIdentifier, $autoCreateTopics, $autoCreateSubscriptions);
117118
}
118119
}

tests/PubSubConnectionFactoryTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,15 @@ public function testMakeGoogleCloudAdapter()
163163
$config = [
164164
'project_id' => '12345',
165165
'key_file' => 'my_key_file.json',
166+
'client_identifier' => 'blah',
167+
'auto_create_topics' => false,
166168
];
167169
$adapter = $factory->make('gcloud', $config);
168170
$this->assertInstanceOf(GoogleCloudPubSubAdapter::class, $adapter);
169171

170-
$config['auto_create_topics'] = false;
171172
$adapter = $factory->make('gcloud', $config); /** @var GoogleCloudPubSubAdapter $adapter */
172173
$this->assertInstanceOf(GoogleCloudPubSubAdapter::class, $adapter);
174+
$this->assertEquals('blah', $adapter->getClientIdentifier());
173175
$this->assertFalse($adapter->areTopicsAutoCreated());
174176
$this->assertTrue($adapter->areSubscriptionsAutoCreated());
175177
}

0 commit comments

Comments
 (0)