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,12 @@
|
||||
<?php
|
||||
function handler($context){
|
||||
/** @var \Psr\Http\Message\ResponseInterface $response */
|
||||
$response = $context["response"];
|
||||
/** @var \Psr\Http\Message\ServerRequestInterface $request */
|
||||
$request = $context["request"];
|
||||
/** @var \Psr\Log\LoggerInterface $logger */
|
||||
$logger = $context["logger"];
|
||||
|
||||
$response->getBody()->write("Hello from handler PHP");
|
||||
$logger->warning("Hello logger");
|
||||
}
|
||||
Reference in New Issue
Block a user