You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by cs...@apache.org on 2017/08/01 22:12:00 UTC
[incubator-openwhisk-cli] 01/06: Add PHP 7.1 as a kind (#2415)
This is an automated email from the ASF dual-hosted git repository.
csantanapr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-cli.git
commit 2f2bbb1dfcb88350618848da02bdbcdf871a7094
Author: Rob Allen <ro...@akrabat.com>
AuthorDate: Mon Jul 24 17:38:34 2017 +0100
Add PHP 7.1 as a kind (#2415)
* Implement PHP 7.1 kind
* Add tests for PHP 7.1 action
* Add PHP action documentation
Build the Docker container from php:7.1-alpine and implement the HTTP
server using PHP's built in server.
Note that when using a zip file, the router requires that the `main`
function is stored in `index.php`.
Note about the runner:
The runner sets the exit code to 1 if it has set the last line of stdout
to a string suitable for presentation to the user. Therefore, if the
exit code is not one, then display a generic message.
If there's a runtime error in the action (i.e. not spotted by linter),
then looking for the main() function will find it. Render the error to
the logs so that the user knows what's happened.
Note about vendor folder in a PHP zip:
If the PHP vendor file has a vendor directory, then this directory needs
to be used rather than the one supplied in the action container.
To do this, we require src/vendor/autoload.php which will exist if the
zip file contains it. For the two cases where (1) zip file does not contain a
vendor folder, or (2) when running a non-binary code action, we move the
container's vendor folder into src/.
---
commands/action.go | 2 ++
1 file changed, 2 insertions(+)
diff --git a/commands/action.go b/commands/action.go
index 786e6f1..78d9174 100644
--- a/commands/action.go
+++ b/commands/action.go
@@ -466,6 +466,8 @@ func getExec(args []string, params ActionFlags) (*whisk.Exec, error) {
exec.Kind = "python:default"
} else if ext == ".jar" {
exec.Kind = "java:default"
+ } else if ext == ".php" {
+ exec.Kind = "php:default"
} else {
if ext == ".zip" {
return nil, zipKindError()
--
To stop receiving notification emails like this one, please contact
"commits@openwhisk.apache.org" <co...@openwhisk.apache.org>.