You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cli/templates.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -306,3 +306,32 @@ Type in `faas-cli new --list` and look for any languages ending in `-armhf`. You
306
306
For these platforms do the same as above and look for the `-arm64` suffix.
307
307
308
308
> 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