Skip to content

Commit

Permalink
Merge pull request api-platform#526 from dunglas/upgrade-flex
Browse files Browse the repository at this point in the history
Upgrade Flex
  • Loading branch information
dunglas committed Jan 23, 2018
2 parents 0aed8f4 + 7bd25cb commit 3209d3c
Show file tree
Hide file tree
Showing 31 changed files with 2,742 additions and 2,582 deletions.
2 changes: 1 addition & 1 deletion admin/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:8.7-alpine
FROM node:9.4-alpine

RUN mkdir -p /usr/src/admin

Expand Down
2 changes: 1 addition & 1 deletion admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@api-platform/admin": "^0.1.15"
},
"devDependencies": {
"react-scripts": "1.0.14"
"react-scripts": "1.1.0"
},
"scripts": {
"start": "react-scripts start",
Expand Down
1,680 changes: 883 additions & 797 deletions admin/yarn.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions api/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ Dockerfile*
.env*
!var/.gitignore
var/*
helm/*
16 changes: 11 additions & 5 deletions api/.env
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# This file is a "template" of which env vars need to be defined for your application
# Create environment variables when deploying to production
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration

###> symfony/framework-bundle ###
APP_ENV=dev
APP_DEBUG=1
APP_SECRET=!ChangeMe!
TRUSTED_PROXIES=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
TRUSTED_HOSTS=localhost,api
###< symfony/framework-bundle ###

###> doctrine/doctrine-bundle ###
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls
DATABASE_URL=pgsql://api-platform:!ChangeMe!@db/api?serverVersion=9.6
# Configure your db driver and server_version in config/packages/doctrine.yaml
DATABASE_URL=pgsql://api-platform:!ChangeMe!@db/api
###< doctrine/doctrine-bundle ###

APP_TRUSTED_PROXIES=["10.0.0.0/8","172.16.0.0/12","192.168.0.0/16"]
APP_TRUSTED_HOSTS=["localhost", "api"]
###> nelmio/cors-bundle ###
CORS_ALLOW_ORIGIN=^https?://localhost:?[0-9]*$
###< nelmio/cors-bundle ###

VARNISH_URL=http://cache-proxy
3 changes: 3 additions & 0 deletions api/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@

###> symfony/framework-bundle ###
.env
/public/bundles/
/var/
/vendor/
###< symfony/framework-bundle ###

/helm/api/charts
/helm/api/requirements.lock
6 changes: 3 additions & 3 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM composer:1.5
FROM php:7.1-fpm-alpine
FROM composer:1.6
FROM php:7.2-fpm-alpine3.7

RUN apk add --no-cache --virtual .persistent-deps \
git \
icu-libs \
libpq \
zlib

ENV APCU_VERSION 5.1.8
ENV APCU_VERSION 5.1.9
RUN set -xe \
&& apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
Expand Down
2 changes: 1 addition & 1 deletion api/Dockerfile.varnish
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.6
FROM alpine:3.7

RUN apk add --no-cache varnish

Expand Down
18 changes: 14 additions & 4 deletions api/bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;
use Symfony\Component\Dotenv\Dotenv;

umask(0000);
set_time_limit(0);

require __DIR__.'/../vendor/autoload.php';
Expand All @@ -16,12 +15,23 @@ if (!class_exists(Application::class)) {
throw new \RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
}

if (!isset($_SERVER['APP_ENV'])) {
if (!class_exists(Dotenv::class)) {
throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.');
}
(new Dotenv())->load(__DIR__.'/../.env');
}

$input = new ArgvInput();
$env = $input->getParameterOption(['--env', '-e'], $_SERVER['APP_ENV'] ?? 'dev');
$debug = ($_SERVER['APP_DEBUG'] ?? true) !== '0' && !$input->hasParameterOption(['--no-debug', '']);
$debug = ($_SERVER['APP_DEBUG'] ?? ('prod' !== $env)) && !$input->hasParameterOption(['--no-debug', '']);

if ($debug) {
umask(0000);

if ($debug && class_exists(Debug::class)) {
Debug::enable();
if (class_exists(Debug::class)) {
Debug::enable();
}
}

$kernel = new Kernel($env, $debug);
Expand Down
24 changes: 15 additions & 9 deletions api/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.0.8",
"php": "^7.1.3",
"ext-iconv": "*",
"api-platform/api-pack": "^1.0",
"guzzlehttp/guzzle": "^6.0",
"guzzlehttp/guzzle": "^6.3",
"nelmio/cors-bundle": "^1.5",
"symfony/console": "^3.3 || ^4.0",
"symfony/console": "^4.0",
"symfony/flex": "^1.0",
"symfony/framework-bundle": "^3.3 || ^4.0",
"symfony/yaml": "^3.3 || ^4.0"
"symfony/framework-bundle": "^4.0",
"symfony/lts": "^4@dev",
"symfony/yaml": "^4.0"
},
"config": {
"preferred-install": {
Expand All @@ -27,10 +29,16 @@
"App\\Tests\\": "tests/"
}
},
"replace": {
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install": "symfony-cmd"
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
Expand All @@ -40,9 +48,7 @@
]
},
"conflict": {
"symfony/symfony": "*",
"symfony/twig-bundle": "<3.3",
"symfony/debug": "<3.3"
"symfony/symfony": "*"
},
"extra": {
"symfony": {
Expand Down
Loading

0 comments on commit 3209d3c

Please sign in to comment.