Skip to content

Commit b97c8d8

Browse files
authored
chore: upgrade to PHP 8.1 and PHP 8.2, drop support for PHP 7.4 and below (GoogleCloudPlatform#1838)
1 parent 7a93622 commit b97c8d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+165
-141
lines changed

.kokoro/deploy_gae.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Configure the docker image for kokoro-trampoline.
44
env_vars: {
55
key: "TRAMPOLINE_IMAGE"
6-
value: "gcr.io/cloud-devrel-kokoro-resources/php74"
6+
value: "gcr.io/cloud-devrel-kokoro-resources/php80"
77
}
88

99
# Run the deployment tests

.kokoro/deploy_gcf.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Configure the docker image for kokoro-trampoline.
44
env_vars: {
55
key: "TRAMPOLINE_IMAGE"
6-
value: "gcr.io/cloud-devrel-kokoro-resources/php74"
6+
value: "gcr.io/cloud-devrel-kokoro-resources/php80"
77
}
88

99
# Run the deployment tests

.kokoro/deploy_misc.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Configure the docker image for kokoro-trampoline.
44
env_vars: {
55
key: "TRAMPOLINE_IMAGE"
6-
value: "gcr.io/cloud-devrel-kokoro-resources/php74"
6+
value: "gcr.io/cloud-devrel-kokoro-resources/php80"
77
}
88

99
# Run the deployment tests
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Configure the docker image for kokoro-trampoline.
44
env_vars: {
55
key: "TRAMPOLINE_IMAGE"
6-
value: "gcr.io/cloud-devrel-kokoro-resources/php74"
6+
value: "gcr.io/cloud-devrel-kokoro-resources/php81"
77
}
88

99
# Give the docker image a unique project ID and credentials per PHP version
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Configure the docker image for kokoro-trampoline.
44
env_vars: {
55
key: "TRAMPOLINE_IMAGE"
6-
value: "gcr.io/cloud-devrel-kokoro-resources/php73"
6+
value: "gcr.io/cloud-devrel-kokoro-resources/php82"
77
}
88

99
# Give the docker image a unique project ID and credentials per PHP version

.kokoro/php_rest.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Configure the docker image for kokoro-trampoline.
44
env_vars: {
55
key: "TRAMPOLINE_IMAGE"
6-
value: "gcr.io/cloud-devrel-kokoro-resources/php73"
6+
value: "gcr.io/cloud-devrel-kokoro-resources/php80"
77
}
88

99
# Set this project to run REST tests only

.kokoro/system_tests.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,8 @@ fi
5959
# Install global test dependencies
6060
composer install -d testing/
6161

62+
# Configure the current directory as a safe directory
63+
git config --global --add safe.directory $(pwd)
64+
6265
# Run tests
6366
bash testing/run_test_suite.sh

appengine/standard/errorreporting/README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,24 @@ these two steps:
1010
```sh
1111
composer require google/cloud-error-reporting
1212
```
13-
1. Create a [`php.ini`](php.ini) file in the root of your project and set
14-
`auto_prepend_file` to the following:
15-
```ini
16-
; in php.ini
17-
auto_prepend_file=/srv/vendor/google/cloud-error-reporting/src/prepend.php
13+
1. Add the command to autoload the "prepend.php" file at the beginning of every
14+
request in `composer.json:
15+
```js
16+
{
17+
"autoload": {
18+
"files": ["vendor/google/cloud-error-reporting/src/prepend.php"]
19+
}
20+
}
21+
1822
```
1923

2024
The [`prepend.php`][prepend] file will be executed prior to each request, which
2125
registers the client library's error handler.
2226
2327
[prepend]: https://github.com/GoogleCloudPlatform/google-cloud-php-errorreporting/blob/main/src/prepend.php
2428
25-
If you cannot modify your `php.ini`, the `prepend.php` file can be manually
26-
included to register the error handler:
29+
Alternatively, the `prepend.php` file can be manually included to register the
30+
error handler:
2731
2832
```php
2933
# This works for files in the root of your project. Adjust __DIR__ accordingly.
@@ -56,8 +60,10 @@ in your browser. Browse to `/` to see a list of examples to execute.
5660
5761
### Run Locally
5862
59-
Uncomment the `require_once` statement at the top of [`index.php`](index.php),
60-
or add the `auto_prepend_file` above to your local `php.ini`.
63+
The `prepend.php` file will be autoloaded on each request via composer. You
64+
can also uncomment the `require_once` statement at the top of
65+
[`index.php`](index.php), or load the file using `auto_prepend_file` in your
66+
local `php.ini`.
6167
6268
Now run the sample locally using PHP's build-in web server:
6369

appengine/standard/errorreporting/app.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
runtime: php74
1+
runtime: php82
22

33
# Defaults to "serve index.php" and "serve public/index.php". Can be used to
44
# serve a custom PHP front controller (e.g. "serve backend/index.php") or to
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"require": {
3-
"google/cloud-error-reporting": "^0.19.0"
3+
"google/cloud-error-reporting": "^0.20.0"
4+
},
5+
"autoload": {
6+
"files": [
7+
"vendor/google/cloud-error-reporting/src/prepend.php"
8+
]
49
}
510
}

0 commit comments

Comments
 (0)