From 64a7eb5e45625dee034781d8571474adb375ccfe Mon Sep 17 00:00:00 2001 From: Annie Fu Date: Thu, 18 Nov 2021 10:17:48 -0800 Subject: [PATCH 1/3] refactor(functions): declarative function signature for helloworld_http Update to the new [declarative function signature](https://github.com/GoogleCloudPlatform/functions-framework-php/pull/116) style that was introduced in Functions Framework v1.1.0 --- functions/helloworld_http/SampleUnitTest.php | 1 + functions/helloworld_http/composer.json | 2 +- functions/helloworld_http/index.php | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/functions/helloworld_http/SampleUnitTest.php b/functions/helloworld_http/SampleUnitTest.php index 31bdd750a5..3a17334d08 100644 --- a/functions/helloworld_http/SampleUnitTest.php +++ b/functions/helloworld_http/SampleUnitTest.php @@ -1,4 +1,5 @@ Date: Thu, 18 Nov 2021 15:17:33 -0800 Subject: [PATCH 2/3] require PHP >= 7.4 --- functions/helloworld_pubsub/composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/functions/helloworld_pubsub/composer.json b/functions/helloworld_pubsub/composer.json index 4b22abce19..c4ee25ae43 100644 --- a/functions/helloworld_pubsub/composer.json +++ b/functions/helloworld_pubsub/composer.json @@ -1,6 +1,7 @@ { "require": { - "google/cloud-functions-framework": "^1.0.0" + "php": ">= 7.4", + "google/cloud-functions-framework": "^1.0.0", }, "scripts": { "start": [ From b53fb6b0335fd0fb409fd52705add15cf1f238e8 Mon Sep 17 00:00:00 2001 From: Annie Fu Date: Thu, 18 Nov 2021 15:20:20 -0800 Subject: [PATCH 3/3] Add PHP 7.4 restriction to correct file --- functions/helloworld_http/composer.json | 1 + functions/helloworld_pubsub/composer.json | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/functions/helloworld_http/composer.json b/functions/helloworld_http/composer.json index 73b65bfc99..6149060ac6 100644 --- a/functions/helloworld_http/composer.json +++ b/functions/helloworld_http/composer.json @@ -1,5 +1,6 @@ { "require": { + "php": ">= 7.4", "google/cloud-functions-framework": "^1.1" }, "scripts": { diff --git a/functions/helloworld_pubsub/composer.json b/functions/helloworld_pubsub/composer.json index c4ee25ae43..5c1a42a515 100644 --- a/functions/helloworld_pubsub/composer.json +++ b/functions/helloworld_pubsub/composer.json @@ -1,12 +1,12 @@ { "require": { - "php": ">= 7.4", - "google/cloud-functions-framework": "^1.0.0", + "cloudevents/sdk-php": "^1.0", + "google/cloud-functions-framework": "^1.1" }, "scripts": { "start": [ "Composer\\Config::disableProcessTimeout", - "FUNCTION_SIGNATURE_TYPE=cloudevent FUNCTION_TARGET=helloworldPubsub php -S localhost:${PORT:-8080} vendor/bin/router.php" + "FUNCTION_TARGET=helloworldPubsub php -S localhost:${PORT:-8080} vendor/bin/router.php" ] }, "require-dev": {