ningyougang commented on PR #120:
URL:
https://github.com/apache/openwhisk-runtime-php/pull/120#issuecomment-1193851222
The steps of test `Support array result for sequence action in php`
* Write split.php and sort.php
```php
[root@nccddev130026 workspace]# cat ~/split.php
<?php
function main(array $args) : array
{
$payload = $args["payload"] ?? "aaaa\nbbbbb\ncccccc";
$separator = $args["separator"] ?? "\n";
$result = explode($separator,$payload);
return $result;
}
[root@nccddev130026 workspace]# cat ~/sort.php
<?php
function main(array $args) : array
{
$result = array_reverse($args);
return $result;
}
```
* Create sequence action and invoke it (I tested php:7.4/8.0, worked well
both)
```
wsk -i action create /whisk.system/utils/split-php --kind php:7.4 ~/split.php
wsk -i action create /whisk.system/utils/sort-php --kind php:7.4 ~/sort.php
wsk -i action create mySequence-php --sequence
/whisk.system/utils/split-php,/whisk.system/utils/sort-php
wsk -i action invoke --result mySequence-php --param payload
"dddd\nbbbb\ncccc\nfffffff\nggggggggg" -r -v
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]