You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ra...@apache.org on 2019/12/20 21:50:51 UTC
[openwhisk] branch master updated: Add PHP 7.4 runtime (#4767)
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/openwhisk.git
The following commit(s) were added to refs/heads/master by this push:
new 5802bc2 Add PHP 7.4 runtime (#4767)
5802bc2 is described below
commit 5802bc21e87db53e12cc8741759b7e15ab1b7566
Author: Rob Allen <ro...@akrabat.com>
AuthorDate: Fri Dec 20 21:50:39 2019 +0000
Add PHP 7.4 runtime (#4767)
* Update list of runtimes.
* Update Swagger description
* Update docs
* Add unicode.tests file
---
ansible/files/runtimes.json | 16 +++++++++++++++-
core/controller/src/main/resources/apiv1swagger.json | 1 +
docs/actions-new.md | 2 +-
docs/actions-php.md | 10 ++++++----
tests/dat/actions/unicode.tests/php-7.4.txt | 9 +++++++++
5 files changed, 32 insertions(+), 6 deletions(-)
diff --git a/ansible/files/runtimes.json b/ansible/files/runtimes.json
index eb7f3e6..a0ac11b 100644
--- a/ansible/files/runtimes.json
+++ b/ansible/files/runtimes.json
@@ -143,7 +143,7 @@
"php": [
{
"kind": "php:7.3",
- "default": true,
+ "default": false,
"deprecated": false,
"image": {
"prefix": "openwhisk",
@@ -154,6 +154,20 @@
"attachmentName": "codefile",
"attachmentType": "text/plain"
}
+ },
+ {
+ "kind": "php:7.4",
+ "default": true,
+ "deprecated": false,
+ "image": {
+ "prefix": "openwhisk",
+ "name": "action-php-v7.4",
+ "tag": "nightly"
+ },
+ "attached": {
+ "attachmentName": "codefile",
+ "attachmentType": "text/plain"
+ }
}
],
"ruby": [
diff --git a/core/controller/src/main/resources/apiv1swagger.json b/core/controller/src/main/resources/apiv1swagger.json
index b9c1060..f93015c 100644
--- a/core/controller/src/main/resources/apiv1swagger.json
+++ b/core/controller/src/main/resources/apiv1swagger.json
@@ -1897,6 +1897,7 @@
"nodejs:12",
"nodejs:default",
"php:7.3",
+ "php:7.4",
"php:default",
"python:2",
"python:3",
diff --git a/docs/actions-new.md b/docs/actions-new.md
index 918f038..b5a3767 100644
--- a/docs/actions-new.md
+++ b/docs/actions-new.md
@@ -61,7 +61,7 @@ Further, you should automate and pass the following test suites:
Actions when created specify the desired runtime for the function via a property called "kind".
When using the `wsk` CLI, this is specified as `--kind <runtime-kind>`. The value is typically
a string describing the language (e.g., `nodejs`) followed by a colon and the version for the runtime
-as in `nodejs:8` or `php:7.3`.
+as in `nodejs:8` or `php:7.4`.
The manifest is a map of runtime family names to an array of specific kinds. The details of the
schema are found in the [Exec Manifest](../common/scala/src/main/scala/org/apache/openwhisk/core/entity/ExecManifest.scala).
diff --git a/docs/actions-php.md b/docs/actions-php.md
index d59345d..3083d5b 100644
--- a/docs/actions-php.md
+++ b/docs/actions-php.md
@@ -23,12 +23,13 @@ The process of creating PHP actions is similar to that of [other actions](action
The following sections guide you through creating and invoking a single PHP action,
and demonstrate how to bundle multiple PHP files and third party dependencies.
-PHP actions are executed using PHP 7.3. The specific
+PHP actions are executed using PHP 7.4 or 7.3. The specific
version of PHP is listed in the CHANGELOG files in the [PHP runtime repository](https://github.com/apache/openwhisk-runtime-php).
To use a PHP runtime, specify the `wsk` CLI parameter `--kind` when creating or
updating an action. The available PHP kinds are:
+* PHP 7.4: `--kind php:7.4`
* PHP 7.3: `--kind php:7.3`
An action is simply a top-level PHP function. For example, create a file called `hello.php`
@@ -56,7 +57,7 @@ wsk action create helloPHP hello.php
```
The CLI automatically infers the type of the action from the source file extension.
-For `.php` source files, the action runs using a PHP 7.3 runtime.
+For `.php` source files, the action runs using a PHP 7.4 runtime.
Action invocation is the same for PHP actions as it is for [any other action](actions.md#the-basics).
@@ -86,7 +87,7 @@ zip -r helloPHP.zip index.php helper.php
and then create the action:
```bash
-wsk action create helloPHP --kind php:7.3 helloPHP.zip
+wsk action create helloPHP --kind php:7.4 helloPHP.zip
```
## Including Composer dependencies
@@ -97,7 +98,7 @@ 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.3 helloPHP.zip
+wsk action create helloPHP --kind php:7.4 helloPHP.zip
```
The PHP runtime will automatically include Composer's autoloader for you, so you can immediately
@@ -120,6 +121,7 @@ The following PHP extensions are available in addition to the standard ones:
- gd
- intl
- mbstring
+- mongodb
- mysqli
- pdo_mysql
- pdo_pgsql
diff --git a/tests/dat/actions/unicode.tests/php-7.4.txt b/tests/dat/actions/unicode.tests/php-7.4.txt
new file mode 100644
index 0000000..bdd88cb
--- /dev/null
+++ b/tests/dat/actions/unicode.tests/php-7.4.txt
@@ -0,0 +1,9 @@
+<?php
+// Licensed to the Apache Software Foundation (ASF) under one or more contributor
+// license agreements; and to You under the Apache License, Version 2.0.
+
+function main(array $args) : array {
+ $str = $args['delimiter'] . " ☃ " . $args['delimiter'];
+ echo $str . "\n";
+ return ["winter" => $str];
+}