Merge branch 'release/1.0.1'
This commit is contained in:
commit
735efcf4cb
@ -4,6 +4,12 @@ Tous les changements notables apportés à ce projet seront documentés dans ce
|
||||
Le format est basé sur [Keep a Changelog](http://keepachangelog.com/fr/1.0.0/)
|
||||
et ce projet adhère à [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [1.0.1] - 2018-10-22
|
||||
|
||||
### Corrections
|
||||
- Composer Installer auto-version SHA (thanks to @delcourq)
|
||||
- Fix GraphQL endpoint to handle GET request
|
||||
|
||||
## [1.0.0] - 2018-04-24
|
||||
|
||||
### Ajouts
|
||||
|
@ -2,7 +2,7 @@ FROM php
|
||||
MAINTAINER Conjecto <contact@conjecto.com>
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
--no-install-recommends git zip zlib1g-dev
|
||||
--no-install-recommends git zip zlib1g-dev wget
|
||||
|
||||
RUN docker-php-ext-install -j$(nproc) zip
|
||||
|
||||
@ -11,12 +11,14 @@ WORKDIR /var/app/
|
||||
|
||||
# install composer
|
||||
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||
RUN php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
|
||||
RUN php composer-setup.php
|
||||
RUN php -r "unlink('composer-setup.php');"
|
||||
RUN \
|
||||
EXPECTED_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig) && \
|
||||
php -r "if (hash_file('SHA384', 'composer-setup.php') === '${EXPECTED_SIGNATURE}') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \
|
||||
php composer-setup.php && \
|
||||
php -r "unlink('composer-setup.php');"
|
||||
|
||||
# install vendors
|
||||
RUN php composer.phar install
|
||||
|
||||
# run server
|
||||
CMD ["php", "-S", "0.0.0.0:80", "-t", "/var/app/www"]
|
||||
CMD ["php", "-S", "0.0.0.0:80", "-t", "/var/app/www"]
|
||||
|
@ -5,16 +5,24 @@ header('Access-Control-Allow-Credentials: true', true);
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
header('Access-Control-Allow-Headers: Content-Type');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
|
||||
return;
|
||||
$payload = null;
|
||||
|
||||
switch($_SERVER['REQUEST_METHOD']) {
|
||||
case "POST":
|
||||
if (isset($_SERVER['CONTENT_TYPE']) && $_SERVER['CONTENT_TYPE'] === 'application/json') {
|
||||
$rawBody = file_get_contents('php://input');
|
||||
$requestData = json_decode($rawBody ?: '', true);
|
||||
} else {
|
||||
$requestData = $_POST;
|
||||
}
|
||||
break;
|
||||
case "GET":
|
||||
$requestData = $_GET;
|
||||
break;
|
||||
default:
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_SERVER['CONTENT_TYPE']) && $_SERVER['CONTENT_TYPE'] === 'application/json') {
|
||||
$rawBody = file_get_contents('php://input');
|
||||
$requestData = json_decode($rawBody ?: '', true);
|
||||
} else {
|
||||
$requestData = $_POST;
|
||||
}
|
||||
$payload = isset($requestData['query']) ? $requestData['query'] : null;
|
||||
|
||||
require_once __DIR__.'/../vendor/autoload.php';
|
||||
|
Loading…
x
Reference in New Issue
Block a user