Add initial support for PHP7 (#97)
* Add initial support for PHP7 * Update PHP env with now an PSR3 logger (Monolog). Now you can also create a handler function with PSR7 Http message and PSR3 logger in parameter. * Add examples for PHP7 environement * For development you can create a function in this path /app/userfuncdev.php it will be loaded * Switch to alpine base image * handler now receive an array with request, response and logger object
This commit is contained in:
committed by
Soam Vasani
parent
c353e7f230
commit
2725da6b1b
@@ -0,0 +1,56 @@
|
||||
# Fission: PHP Environment
|
||||
|
||||
This is the PHP environment for Fission.
|
||||
|
||||
It's a Docker image containing a PHP 7.1 runtime. This image use php:7.1-cli base image with the built-in PHP server
|
||||
|
||||
This environment didn't force you to use class or create a main function.
|
||||
|
||||
A few common extensions are included :
|
||||
- curl
|
||||
- gd
|
||||
- json
|
||||
- mcrypt
|
||||
- PDO (pdo_mysql, pdo_pgsql, pdo_sqlite)
|
||||
- OPcache
|
||||
- ftp
|
||||
- iconv
|
||||
- phar
|
||||
- mysqli
|
||||
- pgsql
|
||||
- SimpleXML
|
||||
- xmlrpc
|
||||
- zip
|
||||
|
||||
## Customizing this image
|
||||
|
||||
To add other extensions or packages(composer.json) you need to edit the Dockerfile and rebuild this image (instructions below).
|
||||
|
||||
## Rebuilding and pushing the image
|
||||
|
||||
You'll need access to a Docker registry to push the image: you can
|
||||
sign up for Docker hub at hub.docker.com, or use registries from
|
||||
gcr.io, quay.io, etc. Let's assume you're using a docker hub account
|
||||
called USER. Build and push the image to the the registry:
|
||||
|
||||
```
|
||||
docker build -t USER/php7-env . && docker push USER/php7-env
|
||||
```
|
||||
|
||||
## Using the image in fission
|
||||
|
||||
You can add this customized image to fission with "fission env
|
||||
create":
|
||||
|
||||
```
|
||||
fission env create --name php7 --image USER/php7-env
|
||||
```
|
||||
|
||||
Or, if you already have an environment, you can update its image:
|
||||
|
||||
```
|
||||
fission env update --name php7 --image USER/php7-env
|
||||
```
|
||||
|
||||
After this, fission functions that have the env parmeter set to the
|
||||
same environment name as this command will use this environment.
|
||||
Reference in New Issue
Block a user