This is an automated email from the ASF dual-hosted git repository. rabbah pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git
The following commit(s) were added to refs/heads/master by this push: new a766514 Add information on using Composer with the PHP runtime (#3728) a766514 is described below commit a7665146f89cd499f7af4e794bde5365761d8f20 Author: Rob Allen <r...@akrabat.com> AuthorDate: Fri Jun 8 02:17:06 2018 +0100 Add information on using Composer with the PHP runtime (#3728) --- docs/actions.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/actions.md b/docs/actions.md index 36edb62..05de898 100644 --- a/docs/actions.md +++ b/docs/actions.md @@ -644,6 +644,19 @@ and then create the action: wsk action create helloPHP --kind php:7.1 helloPHP.zip ``` +### Including Composer dependencies + +If your PHP action requires [Composer](https://getcomposer.org) dependencies, you can install them as usual using `composer require` which will create a `vendor` directory. Add this directory to your action's zip file and create the action: + +```bash +zip -r helloPHP.zip index.php vendor +wsk action create helloPHP --kind php:7.1 helloPHP.zip +``` + +The PHP runtime will automatically include Composer's autoloader for you, so you can immediately use the dependencies in your action code. + +Note that if you don't include your own `vendor` folder, then the runtime will include one for you. The packages included are listed in the [reference](https://github.com/apache/incubator-openwhisk/blob/master/docs/reference.md#composer-packages). + ## Creating Swift actions -- To stop receiving notification emails like this one, please contact rab...@apache.org.