File tree Expand file tree Collapse file tree 4 files changed +13
-3
lines changed
Expand file tree Collapse file tree 4 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 11<?php
2+
23/**
34 * Copyright 2020 Google LLC.
45 *
Original file line number Diff line number Diff line change 11{
22 "require" : {
3- "google/cloud-functions-framework" : " ^1.0"
3+ "php" : " >= 7.4" ,
4+ "google/cloud-functions-framework" : " ^1.1"
45 },
56 "scripts" : {
67 "start" : [
Original file line number Diff line number Diff line change 1616<!-- [START functions_helloworld_http] ->
1717<?php
1818
19+ use Google \CloudFunctions \FunctionsFramework ;
1920use Psr \Http \Message \ServerRequestInterface ;
2021
22+ // Register the function with Functions Framework.
23+ // This enables omitting the `FUNCTIONS_SIGNATURE_TYPE=http` environment
24+ // variable when deploying. The `FUNCTION_TARGET` environment variable should
25+ // match the first parameter.
26+ FunctionsFramework::http ('helloHttp ' , 'helloHttp ' );
27+
2128function helloHttp (ServerRequestInterface $ request ): string
2229{
2330 $ name = 'World ' ;
Original file line number Diff line number Diff line change 11{
22 "require" : {
3- "google/cloud-functions-framework" : " ^1.0.0"
3+ "cloudevents/sdk-php" : " ^1.0" ,
4+ "google/cloud-functions-framework" : " ^1.1"
45 },
56 "scripts" : {
67 "start" : [
78 " Composer\\ Config::disableProcessTimeout" ,
8- " FUNCTION_SIGNATURE_TYPE=cloudevent FUNCTION_TARGET=helloworldPubsub php -S localhost:${PORT:-8080} vendor/bin/router.php"
9+ " FUNCTION_TARGET=helloworldPubsub php -S localhost:${PORT:-8080} vendor/bin/router.php"
910 ]
1011 },
1112 "require-dev" : {
You can’t perform that action at this time.
0 commit comments