Skip to content

Commit

Permalink
Introduce Symfony Flex
Browse files Browse the repository at this point in the history
  • Loading branch information
pamil committed Aug 27, 2018
1 parent 55d466e commit 2a70a0c
Show file tree
Hide file tree
Showing 24 changed files with 1,034 additions and 55 deletions.
17 changes: 13 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/.php_cs.cache

/var/*
!/var/.gitkeep

Expand All @@ -21,12 +19,23 @@
!/etc/build/.gitkeep

/behat.yml
/phpunit.xml
/phpspec.yml
/.web-server-pid

/.env
/.env.prod
/.env.staging
/.env.test
/.env.test_cached

###> symfony/web-server-bundle ###
/.web-server-pid
###< symfony/web-server-bundle ###

###> friendsofphp/php-cs-fixer ###
/.php_cs
/.php_cs.cache
###< friendsofphp/php-cs-fixer ###

###> phpunit/phpunit ###
/phpunit.xml
###< phpunit/phpunit ###
81 changes: 55 additions & 26 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@
],
"require": {
"php": "^7.2",

"ext-exif": "*",
"ext-fileinfo": "*",
"ext-gd": "*",

"doctrine/collections": "^1.3",
"doctrine/data-fixtures": "^1.1",
"doctrine/doctrine-bundle": "^1.6",
Expand Down Expand Up @@ -53,13 +51,38 @@
"swiftmailer/swiftmailer": "^6.0",
"sylius-labs/association-hydrator": "^1.1",
"sylius-labs/sensio-distribution-bundle": "^6.0",
"symfony/asset": "^3.4|^4.1",
"symfony/config": "^3.4|^4.1",
"symfony/console": "^3.4|^4.1",
"symfony/dependency-injection": "^3.4|^4.1",
"symfony/doctrine-bridge": "^3.4|^4.1",
"symfony/event-dispatcher": "^3.4|^4.1",
"symfony/expression-language": "^3.4|^4.1",
"symfony/filesystem": "^3.4|^4.1",
"symfony/finder": "^3.4|^4.1",
"symfony/flex": "^1.1",
"symfony/form": "^3.4|^4.1",
"symfony/framework-bundle": "^3.4|^4.1",
"symfony/http-foundation": "^3.4|^4.1",
"symfony/http-kernel": "^3.4|^4.1",
"symfony/monolog-bundle": "^3.0",
"symfony/options-resolver": "^3.4|^4.1",
"symfony/polyfill-iconv": "^1.3",
"symfony/polyfill-intl-icu": "^1.3",
"symfony/polyfill-mbstring": "^1.3",
"symfony/process": "^3.4|^4.1",
"symfony/property-access": "^3.4|^4.1",
"symfony/proxy-manager-bridge": "^3.4|^4.1",
"symfony/routing": "^3.4|^4.1",
"symfony/security": "^3.4|^4.1",
"symfony/security-bundle": "^3.4|^4.1",
"symfony/swiftmailer-bundle": "^3.0",
"symfony/symfony": "^3.4|^4.1.1",
"symfony/templating": "^3.4|^4.1",
"symfony/thanks": "^1.0",
"symfony/translation": "^3.4|^4.1",
"symfony/twig-bundle": "^3.4|^4.1",
"symfony/validator": "^3.4|^4.1",
"symfony/yaml": "^3.4|^4.1",
"twig/extensions": "^1.4",
"twig/twig": "^2.0",
"webmozart/assert": "^1.1",
Expand Down Expand Up @@ -97,7 +120,13 @@
"phpstan/phpstan-webmozart-assert": "^0.10",
"phpunit/phpunit": "^6.5",
"stripe/stripe-php": "^4.1",
"sylius-labs/coding-standard": "^2.0"
"sylius-labs/coding-standard": "^2.0",
"symfony/browser-kit": "^3.4|^4.1",
"symfony/debug-bundle": "^3.4|^4.1",
"symfony/dotenv": "^3.4|^4.1",
"symfony/intl": "^3.4|^4.1",
"symfony/web-profiler-bundle": "^3.4|^4.1",
"symfony/web-server-bundle": "^3.4|^4.1"
},
"replace": {
"sylius/addressing": "self.version",
Expand Down Expand Up @@ -149,6 +178,7 @@
"sylius/ui-bundle": "self.version",
"sylius/user": "self.version",
"sylius/user-bundle": "self.version",
"symfony/polyfill-php72": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
Expand All @@ -161,20 +191,6 @@
"ext-intl": "For better performance than using Symfony Polyfill Component",
"ext-mbstring": "For better performance than using Symfony Polyfill Component"
},
"scripts": {
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
},
"autoload": {
"psr-4": {
"Sylius\\Behat\\": "src/Sylius/Behat/",
Expand All @@ -191,15 +207,28 @@
},
"classmap": ["app/AppKernel.php", "app/TestAppKernel.php", "src/Kernel.php"]
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd",
"security-checker security:check": "script"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"extra": {
"symfony-app-dir": "app",
"symfony-bin-dir": "bin",
"symfony-var-dir": "var",
"symfony-web-dir": "public",
"symfony-tests-dir": "tests",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
"symfony": {
"allow-contrib": false
},
"branch-alias": {
"dev-master": "1.3-dev"
Expand Down
21 changes: 5 additions & 16 deletions config/bundles.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Expand All @@ -10,7 +8,6 @@
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true],

Sylius\Bundle\OrderBundle\SyliusOrderBundle::class => ['all' => true],
Sylius\Bundle\MoneyBundle\SyliusMoneyBundle::class => ['all' => true],
Sylius\Bundle\CurrencyBundle\SyliusCurrencyBundle::class => ['all' => true],
Expand All @@ -34,38 +31,30 @@
Sylius\Bundle\ResourceBundle\SyliusResourceBundle::class => ['all' => true],
Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true],
winzou\Bundle\StateMachineBundle\winzouStateMachineBundle::class => ['all' => true],

Sonata\CoreBundle\SonataCoreBundle::class => ['all' => true],
Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true],
Sonata\IntlBundle\SonataIntlBundle::class => ['all' => true],
Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle::class => ['all' => true],
JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true],
FOS\RestBundle\FOSRestBundle::class => ['all' => true],

Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true],
Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true],
Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true],
Payum\Bundle\PayumBundle\PayumBundle::class => ['all' => true],
Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle::class => ['all' => true],

Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['all' => true],
Sylius\Bundle\FixturesBundle\SyliusFixturesBundle::class => ['all' => true],
Sylius\Bundle\PayumBundle\SyliusPayumBundle::class => ['all' => true], // must be added after PayumBundle.
Sylius\Bundle\ThemeBundle\SyliusThemeBundle::class => ['all' => true], // must be added after FrameworkBundle

Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['all' => true], // allows to run build in web server, not recommended for prod environment

Sylius\Bundle\PayumBundle\SyliusPayumBundle::class => ['all' => true],
Sylius\Bundle\ThemeBundle\SyliusThemeBundle::class => ['all' => true],
Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['all' => true],
Sylius\Bundle\AdminBundle\SyliusAdminBundle::class => ['all' => true],
Sylius\Bundle\ShopBundle\SyliusShopBundle::class => ['all' => true],

FOS\OAuthServerBundle\FOSOAuthServerBundle::class => ['all' => true], // Required by SyliusAdminApiBundle
FOS\OAuthServerBundle\FOSOAuthServerBundle::class => ['all' => true],
Sylius\Bundle\AdminApiBundle\SyliusAdminApiBundle::class => ['all' => true],

Sensio\Bundle\DistributionBundle\SensioDistributionBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
Fidry\AliceDataFixtures\Bridge\Symfony\FidryAliceDataFixturesBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
Nelmio\Alice\Bridge\Symfony\NelmioAliceBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
Nelmio\Alice\Bridge\Symfony\NelmioAliceBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true]
];
7 changes: 7 additions & 0 deletions config/packages/dev/jms_serializer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
jms_serializer:
visitors:
json:
options:
- JSON_PRETTY_PRINT
- JSON_UNESCAPED_SLASHES
- JSON_PRESERVE_ZERO_FRACTION
3 changes: 3 additions & 0 deletions config/packages/dev/routing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
framework:
router:
strict_requirements: true
5 changes: 0 additions & 5 deletions config/packages/framework.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
framework:
translator: { fallbacks: ["%locale%", "en"] }
secret: '%env(APP_SECRET)%'
router:
strict_requirements: '%kernel.debug%'
form: true
csrf_protection: true
validation: { enable_annotations: true }
templating: { engines: ["twig"] }
default_locale: "%locale%"
session:
handler_id: ~
4 changes: 4 additions & 0 deletions config/packages/jms_serializer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
jms_serializer:
visitors:
xml:
format_output: '%kernel.debug%'
3 changes: 3 additions & 0 deletions config/packages/nelmio_alice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nelmio_alice:
functions_blacklist:
- 'current'
31 changes: 31 additions & 0 deletions config/packages/prod/doctrine.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
doctrine:
orm:
metadata_cache_driver:
type: service
id: doctrine.system_cache_provider
query_cache_driver:
type: service
id: doctrine.system_cache_provider
result_cache_driver:
type: service
id: doctrine.result_cache_provider

services:
doctrine.result_cache_provider:
class: Symfony\Component\Cache\DoctrineProvider
public: false
arguments:
- '@doctrine.result_cache_pool'
doctrine.system_cache_provider:
class: Symfony\Component\Cache\DoctrineProvider
public: false
arguments:
- '@doctrine.system_cache_pool'

framework:
cache:
pools:
doctrine.result_cache_pool:
adapter: cache.app
doctrine.system_cache_pool:
adapter: cache.system
6 changes: 6 additions & 0 deletions config/packages/prod/jms_serializer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
jms_serializer:
visitors:
json:
options:
- JSON_UNESCAPED_SLASHES
- JSON_PRESERVE_ZERO_FRACTION
3 changes: 3 additions & 0 deletions config/packages/routing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
framework:
router:
strict_requirements: ~
9 changes: 9 additions & 0 deletions config/packages/security_checker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
SensioLabs\Security\SecurityChecker:
public: false

SensioLabs\Security\Command\SecurityCheckerCommand:
arguments: ['@SensioLabs\Security\SecurityChecker']
public: false
tags:
- { name: console.command, command: 'security:check' }
4 changes: 4 additions & 0 deletions config/packages/sonata_core.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sonata_core:
form:
mapping:
enabled: false
4 changes: 4 additions & 0 deletions config/packages/stof_doctrine_extensions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Read the documentation: https://symfony.com/doc/current/bundles/StofDoctrineExtensionsBundle/index.html
# See the official DoctrineExtensions documentation for more details: https://github.com/Atlantic18/DoctrineExtensions/tree/master/doc/
stof_doctrine_extensions:
default_locale: '%locale%'
6 changes: 6 additions & 0 deletions config/packages/test/web_profiler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
web_profiler:
toolbar: false
intercept_redirects: false

framework:
profiler: { collect: false }
8 changes: 8 additions & 0 deletions config/packages/translation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
framework:
default_locale: '%locale%'
translator:
paths:
- '%kernel.project_dir%/translations'
fallbacks:
- '%locale%'
- 'en'
4 changes: 4 additions & 0 deletions config/packages/twig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
twig:
paths: ['%kernel.project_dir%/templates']
debug: '%kernel.debug%'
strict_variables: '%kernel.debug%'
11 changes: 11 additions & 0 deletions config/packages/twig_extensions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:
_defaults:
public: false
autowire: true
autoconfigure: true

# Uncomment any lines below to activate that Twig extension
#Twig\Extensions\ArrayExtension: ~
#Twig\Extensions\DateExtension: ~
#Twig\Extensions\IntlExtension: ~
#Twig\Extensions\TextExtension: ~
3 changes: 3 additions & 0 deletions config/packages/validator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
framework:
validation:
enable_annotations: true
2 changes: 1 addition & 1 deletion etc/travis/suites/application/before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ run_command "bin/console assets:install public --env=test_cached --no-debug -vvv
run_command "yarn build" || exit $?

print_header "Making filesystem readonly" "Sylius"
run_command "chmod -R 555 app bin config docs features src templates tests vendor"
run_command "chmod -R 555 app bin config docs features src templates tests translations vendor"
12 changes: 9 additions & 3 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@
<php>
<ini name="error_reporting" value="-1" />

<server name="KERNEL_CLASS" value="Kernel" />
<server name="APP_ENV" value="test" />
<!-- ###+ symfony/framework-bundle ### -->
<server name="APP_ENV" value="test"/>
<server name="APP_DEBUG" value="1" />
<server name="APP_SECRET" value="SyLiUsIsAwEsOmE" />
<server name="APP_SECRET" value="10719b14109895993491c4c604fcb24e"/>
<!-- env name="TRUSTED_PROXIES" value="127.0.0.1,127.0.0.2" -->
<!-- env name="TRUSTED_HOSTS" value="localhost,example.com" -->
<!-- ###- symfony/framework-bundle ### -->

<server name="KERNEL_CLASS" value="Kernel" />

<server name="SHELL_VERBOSITY" value="-1" />
<server name="IS_DOCTRINE_ORM_SUPPORTED" value="true" />
<server name="ESCAPE_JSON" value="true" />
Expand Down
Loading

0 comments on commit 2a70a0c

Please sign in to comment.