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
1 change: 1 addition & 0 deletions functions/helloworld_http/SampleUnitTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Copyright 2020 Google LLC.
*
Expand Down
3 changes: 2 additions & 1 deletion functions/helloworld_http/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"require": {
"google/cloud-functions-framework": "^1.0"
"php": ">= 7.4",
"google/cloud-functions-framework": "^1.1"
},
"scripts": {
"start": [
Expand Down
7 changes: 7 additions & 0 deletions functions/helloworld_http/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@
<!-- [START functions_helloworld_http] ->
<?php

use Google\CloudFunctions\FunctionsFramework;
use Psr\Http\Message\ServerRequestInterface;

// Register the function with Functions Framework.
// This enables omitting the `FUNCTIONS_SIGNATURE_TYPE=http` environment
// variable when deploying. The `FUNCTION_TARGET` environment variable should
// match the first parameter.
FunctionsFramework::http('helloHttp', 'helloHttp');

function helloHttp(ServerRequestInterface $request): string
{
$name = 'World';
Expand Down
5 changes: 3 additions & 2 deletions functions/helloworld_pubsub/composer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"require": {
"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": {
Expand Down