Skip to content

Commit

Permalink
Update PHP version everywhere to 7.4, changed composer flag to :1 to …
Browse files Browse the repository at this point in the history
…always use the most up-to-date composer:1 version.

Signed-off-by: Shikachuu <zcmate@gmail.com>
  • Loading branch information
Shikachuu authored and alexellis committed Oct 21, 2021
1 parent cdef5a5 commit 6e2657c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ This repository contains the Classic OpenFaaS templates, but many more are avail
| java11-vert-x | Java and [Vert.x](https://vertx.io/) | 11 | Debian GNU/Linux | of-watchdog | [Java LTS template](https://github.com/openfaas/templates/tree/master/template/java11-vert-x)
| java11 | Java | 11 | Debian GNU/Linux | of-watchdog | [Java LTS template](https://github.com/openfaas/templates/tree/master/template/java11)
| ruby | Ruby | 2.7 | Alpine Linux 3.11 | classic| [Ruby template](https://github.com/openfaas/templates/tree/master/template/ruby)
| php7 | PHP | 7.2 | Alpine Linux | classic | [PHP 7 template](https://github.com/openfaas/templates/tree/master/template/php7)
| php7 | PHP | 7.4 | Alpine Linux | classic | [PHP 7 template](https://github.com/openfaas/templates/tree/master/template/php7)
| csharp | C# | N/A | Debian GNU/Linux 9 | classic | [C# template](https://github.com/openfaas/templates/tree/master/template/csharp)

For more information on the templates check out the [docs](https://docs.openfaas.com/cli/templates/).
Expand Down
4 changes: 2 additions & 2 deletions template/php7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ ARG BUILDPLATFORM
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/classic-watchdog:0.1.5 as watchdog

# start with the official Composer image and name it
FROM --platform=${TARGETPLATFORM:-linux/amd64} composer:1.7 AS composer
FROM --platform=${TARGETPLATFORM:-linux/amd64} composer:1 AS composer

# continue with the official PHP image
FROM --platform=${TARGETPLATFORM:-linux/amd64} php:7.2-alpine
FROM --platform=${TARGETPLATFORM:-linux/amd64} php:7.4-alpine

# copy the Composer PHAR from the Composer image into the PHP image
COPY --from=composer /usr/bin/composer /usr/bin/composer
Expand Down
6 changes: 3 additions & 3 deletions template/php7/function/src/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
class Handler
{
/**
* @param $data
* @return
* @param string $data
* @return string
*/
public function handle($data)
public function handle(string $data): string
{
return $data;
}
Expand Down
2 changes: 1 addition & 1 deletion template/php7/template.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: php7
fprocess: php index.php
welcome_message: |
You have created a new function which uses PHP 7.2.
You have created a new function which uses PHP 7.4.
Dependencies and extensions can be added using the composer.json
and php-extension.sh files.
See https://github.com/openfaas/templates/blob/master/template/php7.

0 comments on commit 6e2657c

Please sign in to comment.