Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Core/tests/Unit/ServiceBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@ public function serviceProvider()
[
'bigQuery',
BigQueryClient::class
], [
'logging',
LoggingClient::class
], [
'language',
LanguageClient::class
Expand Down
56 changes: 56 additions & 0 deletions Logging/MIGRATING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Migrating Google Cloud Logging from V1 to V2

## How to upgrade

Update your `google/cloud-logging` dependency to `^2.0`:

```
{
"require": {
"google/cloud-logging": "^2.0"
}
}
```

## Changes

### Client Options changes

The following client options are removed/replaced with other options present in
[`ClientOptions`][ClientOptions]. This was done to ensure client options are consistent across all
Google Cloud clients.

- `authCache` -> Moved to `credentialsConfig.authCache`
- `authCacheOptions` -> Moved to `credentialsConfig.authCacheOptions`
- `credentialsFetcher` -> Moved to `credentials`
- `keyFile` -> Moved to `credentials`
- `keyFilePath` -> Moved to `credentials`
- `requestTimeout` -> Removed from client options and moved to a call option `timeoutMillis`
- `scopes` -> Moved to `credentialsConfig.scopes`
- `quotaProject` -> Moved to `credentialsConfig.quotaProject`
- `httpHandler` -> Moved to `transportConfig.rest.httpHandler`
- `authHttpHandler` -> Moved to `credentialsConfig.authHttpHandler`
- `retries` -> Removed from client options and moved to call options `retrySettings.maxRetries`

### Retry Options changes

The retry options have been moved to use [`RetrySettings`][RetrySettings] in call options
and function parameters.

- `retries` -> Renamed to `retrySettings.maxRetries`
- `maxRetries` -> Renamed to `retrySettings.maxRetries`

[RetrySettings]: https://googleapis.github.io/gax-php/v1.26.1/Google/ApiCore/RetrySettings.html

[ClientOptions]: https://googleapis.github.io/gax-php/v1.26.1/Google/ApiCore/Options/ClientOptions.html

### `ConnectionInterface`, `Connection\Grpc`, and `Connection\Rest` are not used anymore.

This is a major change, but one that we hope won't break any users. When the
`LoggingClient` was created, behind the scenes a connection adapter was initialized.

The Rest and Grpc connection classes (along with the `ConnectionInterface`) have been
removed in favor of using the GAPIC generated clients directly. See `src/Connection/Gapic.php`
for an example.


5 changes: 3 additions & 2 deletions Logging/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"minimum-stability": "stable",
"require": {
"php": "^8.1",
"google/cloud-core": "^1.61",
"google/cloud-core": "^1.66",
"google/gax": "^1.38.0"
},
"require-dev": {
Expand All @@ -20,7 +20,8 @@
"google/cloud-bigquery": "^1.0",
"google/cloud-pubsub": "^2.0",
"opis/closure": "^3",
"monolog/monolog": "^3.8"
"monolog/monolog": "^3.8",
"dg/bypass-finals": "^1.9"
},
"provide": {
"psr/log-implementation": "2.0||3.0"
Expand Down
41 changes: 14 additions & 27 deletions Logging/owlbot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,29 +32,16 @@

php.owlbot_main(src=src, dest=dest)


### [START] protoc backwards compatibility fixes

# roll back to private properties.
s.replace(
"src/**/V*/**/*.php",
r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$",
r"""Generated from protobuf field \1
*/
private $""")

# Replace "Unwrapped" with "Value" for method names.
s.replace(
"src/**/V*/**/*.php",
r"public function ([s|g]\w{3,})Unwrapped",
r"public function \1Value"
)

### [END] protoc backwards compatibility fixes

# fix relative cloud.google.com links
s.replace(
"src/**/V*/**/*.php",
r"(.{0,})\]\((/.{0,})\)",
r"\1](https://cloud.google.com\2)"
)
# format generated clients
subprocess.run([
'npm',
'exec',
'--yes',
'--package=@prettier/plugin-php@^0.19',
'--',
'prettier',
'**/Client/*',
'--write',
'--parser=php',
'--single-quote',
'--print-width=120'])
2 changes: 1 addition & 1 deletion Logging/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="./tests/Unit/bootstrap.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">src</directory>
Expand Down
104 changes: 0 additions & 104 deletions Logging/src/Connection/ConnectionInterface.php

This file was deleted.

Loading
Loading