Skip to content

Commit 4257d70

Browse files
johnmccabealexellis
authored andcommitted
Add PHP7 Template to docs
Signed-off-by: John McCabe <[email protected]>
1 parent efd9f83 commit 4257d70

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docs/cli/templates.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,3 +306,32 @@ Type in `faas-cli new --list` and look for any languages ending in `-armhf`. You
306306
For these platforms do the same as above and look for the `-arm64` suffix.
307307

308308
> It is easy to make your own templates so if you need to use this platform please convert one of the "regular" templates for your platform.
309+
310+
## 9.0 PHP 7
311+
312+
To create a PHP7 function named `my-function` type in:
313+
314+
$ faas-cli new my-function --lang php7
315+
316+
You'll see:
317+
318+
my-function.yml
319+
my-function/src/Handler.php
320+
my-function/composer.json
321+
my-function/php-extension.sh
322+
323+
Add any dependencies/extensions as described below and implement your functions business logic in `Handler.php`.
324+
325+
### 9.1 Composer Dependencies
326+
327+
You should edit `composer.json` and add any required package dependencies, referring to the [Composer Documentation](https://getcomposer.org/doc/) for instructions on using `composer.json`.
328+
329+
**Private Composer Repositories**
330+
331+
Refer to the [PHP7 Template Documentation](https://github.com/openfaas/templates/tree/master/template/php7) for instructions on how to use [Composers]((https://getcomposer.org/doc/)) `COMPOSER_AUTH` environment variable to configure access to dependencies in private repositories.
332+
333+
### 9.1 PHP Extensions
334+
335+
The PHP7 template is based upon the [Docker Library PHP image](https://hub.docker.com/_/php/) and provides the `php-extension.sh` script which exposes the ability to customise extensions installed in a function image.
336+
337+
Refer to the [PHP7 Template Documentation](https://github.com/openfaas/templates/tree/master/template/php7) for instructions on customising installed extensions.

0 commit comments

Comments
 (0)