Skip to content

Commit 5221b5d

Browse files
authored
Fix broken dependencies in v29.0.0 of the client library (Issue #1092) by pinning those dependencies to an earlier version.
1 parent 4584038 commit 5221b5d

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 30.0.0
2+
* Fixed the potential break in v29.0.0 (due to dependency conflicts) by pinning the protobuf dependency to be <=4.30.0 and reverting back to the old getLabel method.
3+
* Fixed the potential maximum call size error due to a bug in the GRPC C extension by pinning ext-grpc to be <=1.66.0
4+
15
## 29.0.0
26
* Security fixes, updated deprecated getLabel to isRepeated.
37

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ RUN curl -sS https://getcomposer.org/installer | php
1515
RUN mv composer.phar /usr/local/bin/composer
1616

1717
# Install and configure the gRPC extension.
18-
RUN pecl install grpc
18+
RUN pecl install grpc-1.66.0
1919
RUN echo 'extension=grpc.so' >> $PHP_INI_DIR/conf.d/grpc.ini
2020

2121
# Install and configure the C implementation of Protobuf extension if needed.
22-
RUN if [ "$USE_C_PROTOBUF" = "false" ]; then echo 'Using PHP implementation of Protobuf'; else echo 'Using C implementation of Protobuf'; pecl install protobuf; echo 'extension=protobuf.so' >> $PHP_INI_DIR/conf.d/protobuf.ini; fi
22+
RUN if [ "$USE_C_PROTOBUF" = "false" ]; then echo 'Using PHP implementation of Protobuf'; else echo 'Using C implementation of Protobuf'; pecl install protobuf-4.30.0; echo 'extension=protobuf.so' >> $PHP_INI_DIR/conf.d/protobuf.ini; fi
2323

2424
WORKDIR "/google-ads-php"

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
"php": ">=8.1",
77
"google/gax": "^1.19.1",
88
"grpc/grpc": "^1.36.0",
9-
"google/protobuf": "^3.21.5 || ^4.26",
9+
"google/protobuf": "3.21.5 || >=4.26 <=4.30.0",
1010
"monolog/monolog": "^1.26 || ^2.0 || ^3.0"
1111
},
1212
"require-dev": {
1313
"phpunit/phpunit": "^9.5",
1414
"squizlabs/php_codesniffer": "^3.5",
1515
"ext-bcmath": "*",
16-
"ext-grpc": "*",
17-
"ext-protobuf": "*",
16+
"ext-grpc": ">=1.57.0 <=1.66.0",
17+
"ext-protobuf": "3.21.5 || >=4.26 <=4.30.0",
1818
"ulrichsg/getopt-php": "^3.4",
1919
"react/http": "^1.2.0",
2020
"composer/composer": "^2.0"

src/Google/Ads/GoogleAds/Constants.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ class Constants
2727
public const LIBRARY_NAME = 'gccl';
2828

2929
// The library version.
30-
public const LIBRARY_VERSION = '29.0.0';
30+
public const LIBRARY_VERSION = '30.0.0';
3131
}

src/Google/Ads/GoogleAds/Util/FieldMasks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ private static function getDescriptorForMessage(Message $message)
353353
*/
354354
private static function isFieldRepeated(FieldDescriptor $fieldDescriptor)
355355
{
356-
return $fieldDescriptor->isRepeated();
356+
return $fieldDescriptor->getLabel() === GPBLabel::REPEATED;
357357
}
358358

359359
// TODO: We can remove this function when it's supported in google/gax-php:

0 commit comments

Comments
 (0)