Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b8173af

Browse files
authored
Merge pull request #119 from pamil/1.3-sf4-structure
Introduce Symfony 4 directory structure
2 parents a844fe5 + 8af6c45 commit b8173af

81 files changed

Lines changed: 803 additions & 248 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
/bin/*
2-
!/bin/.gitkeep
3-
41
/vendor/
52
/node_modules/
63
/composer.lock
74

85
/etc/build/*
9-
!/etc/build/.gitkeep
6+
!/etc/build/.gitignore
107

118
/tests/Application/yarn.lock

.travis.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ before_install:
2626
- echo "memory_limit=4096M" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
2727
- mkdir -p "${SYLIUS_CACHE_DIR}"
2828

29+
- cp tests/Application/.env.test.dist tests/Application/.env.test
30+
- set -a && source tests/Application/.env.test && set +a
31+
2932
install:
3033
- composer require "symfony/symfony:${SYMFONY_VERSION}" --no-interaction --no-update
3134
- composer install --no-interaction --prefer-dist
@@ -34,7 +37,7 @@ install:
3437
before_script:
3538
- (cd tests/Application && bin/console doctrine:database:create --env=test -vvv)
3639
- (cd tests/Application && bin/console doctrine:schema:create --env=test -vvv)
37-
- (cd tests/Application && bin/console assets:install web --env=test -vvv)
40+
- (cd tests/Application && bin/console assets:install public --env=test -vvv)
3841
- (cd tests/Application && bin/console cache:warmup --env=test -vvv)
3942
- (cd tests/Application && yarn build)
4043

@@ -65,15 +68,15 @@ before_script:
6568
- java -Dwebdriver.chrome.driver=$SYLIUS_CACHE_DIR/chromedriver -jar $SYLIUS_CACHE_DIR/selenium.jar > /dev/null 2>&1 &
6669

6770
# Run webserver
68-
- (cd tests/Application && bin/console server:run 127.0.0.1:8080 -d web --env=test --quiet > /dev/null 2>&1 &)
71+
- (cd tests/Application && bin/console server:run 127.0.0.1:8080 -d public --env=test --quiet > /dev/null 2>&1 &)
6972

7073
script:
7174
- composer validate --strict
72-
- bin/phpstan.phar analyse -c phpstan.neon -l max src/
75+
- vendor/bin/phpstan analyse -c phpstan.neon -l max src/
7376

74-
- bin/phpunit
75-
- bin/phpspec run
76-
- bin/behat --strict -vvv --no-interaction || bin/behat --strict -vvv --no-interaction --rerun
77+
- vendor/bin/phpunit
78+
- vendor/bin/phpspec run
79+
- vendor/bin/behat --strict -vvv --no-interaction || vendor/bin/behat --strict -vvv --no-interaction --rerun
7780

7881
after_failure:
7982
- vendor/lakion/mink-debug-extension/travis/tools/upload-textfiles "${SYLIUS_BUILD_DIR}/*.log"

behat.yml.dist

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ default:
1010
- tests/Behat/Resources/services.xml
1111

1212
FriendsOfBehat\SymfonyExtension:
13+
env_file: tests/Application/.env.test
1314
kernel:
14-
class: AppKernel
15-
path: tests/Application/app/AppKernel.php
16-
bootstrap: vendor/autoload.php
15+
env: test
16+
debug: true
17+
class: Tests\Acme\SyliusExamplePlugin\Application\Kernel
18+
path: tests/Application/Kernel.php
19+
bootstrap: ~
1720

1821
Lakion\Behat\MinkDebugExtension:
1922
directory: etc/build

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@
2727
"phpstan/phpstan-symfony": "^0.10",
2828
"phpstan/phpstan-webmozart-assert": "^0.10",
2929
"phpunit/phpunit": "^6.5",
30-
"sylius-labs/coding-standard": "^2.0"
30+
"sylius-labs/coding-standard": "^2.0",
31+
"symfony/browser-kit": "^3.4|^4.1",
32+
"symfony/debug-bundle": "^3.4|^4.1",
33+
"symfony/dotenv": "^3.4|^4.1",
34+
"symfony/intl": "^3.4|^4.1",
35+
"symfony/web-profiler-bundle": "^3.4|^4.1",
36+
"symfony/web-server-bundle": "^3.4|^4.1"
3137
},
3238
"prefer-stable": true,
3339
"autoload": {
@@ -36,15 +42,9 @@
3642
"Tests\\Acme\\SyliusExamplePlugin\\": "tests/"
3743
}
3844
},
39-
"autoload-dev": {
40-
"classmap": ["tests/Application/app/AppKernel.php"]
41-
},
4245
"extra": {
4346
"branch-alias": {
4447
"dev-master": "1.3-dev"
4548
}
46-
},
47-
"config": {
48-
"bin-dir": "bin"
4949
}
5050
}
File renamed without changes.

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ parameters:
77
reportUnmatchedIgnoredErrors: false
88

99
symfony:
10-
container_xml_path: tests/Application/var/cache/test/appTestDebugProjectContainer.xml
10+
container_xml_path: tests/Application/var/cache/test/ApplicationTestDebugProjectContainer.xml
1111

1212
excludes_analyse:
1313
# Makes PHPStan crash

tests/Application/.env.dist

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This file is a "template" of which env vars needs to be defined in your configuration or in an .env file
2+
# Set variables here that may be different on each deployment target of the app, e.g. development, staging, production.
3+
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
4+
5+
###> symfony/framework-bundle ###
6+
APP_ENV=dev
7+
APP_DEBUG=1
8+
APP_SECRET=EDITME
9+
###< symfony/framework-bundle ###
10+
11+
###> doctrine/doctrine-bundle ###
12+
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
13+
# For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
14+
# Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls
15+
DATABASE_URL=mysql://[email protected]/sylius_%kernel.environment%?serverVersion=5.5
16+
###< doctrine/doctrine-bundle ###
17+
18+
###> symfony/swiftmailer-bundle ###
19+
# For Gmail as a transport, use: "gmail://username:password@localhost"
20+
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
21+
# Delivery is disabled by default via "null://localhost"
22+
MAILER_URL=smtp://localhost
23+
###< symfony/swiftmailer-bundle ###

tests/Application/.env.prod.dist

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This file is a "template" of which env vars needs to be defined in your configuration or in an .env file
2+
# Set variables here that may be different on each deployment target of the app, e.g. development, staging, production.
3+
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
4+
5+
###> symfony/framework-bundle ###
6+
APP_ENV=prod
7+
APP_DEBUG=0
8+
APP_SECRET=EDITME
9+
###< symfony/framework-bundle ###
10+
11+
###> doctrine/doctrine-bundle ###
12+
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
13+
# For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
14+
# Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls
15+
DATABASE_URL=mysql://[email protected]/sylius_%kernel.environment%?serverVersion=5.5
16+
###< doctrine/doctrine-bundle ###
17+
18+
###> symfony/swiftmailer-bundle ###
19+
# For Gmail as a transport, use: "gmail://username:password@localhost"
20+
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
21+
# Delivery is disabled by default via "null://localhost"
22+
MAILER_URL=smtp://localhost
23+
###< symfony/swiftmailer-bundle ###

tests/Application/.env.test.dist

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This file is a "template" of which env vars needs to be defined in your configuration or in an .env file
2+
# Set variables here that may be different on each deployment target of the app, e.g. development, staging, production.
3+
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
4+
5+
###> symfony/framework-bundle ###
6+
APP_ENV=test
7+
APP_DEBUG=1
8+
APP_SECRET=EDITME
9+
###< symfony/framework-bundle ###
10+
11+
###> doctrine/doctrine-bundle ###
12+
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
13+
# For a sqlite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
14+
# Set "serverVersion" to your server version to avoid edge-case exceptions and extra database calls
15+
DATABASE_URL=mysql://[email protected]/sylius_%kernel.environment%?serverVersion=5.5
16+
###< doctrine/doctrine-bundle ###
17+
18+
###> symfony/swiftmailer-bundle ###
19+
# For Gmail as a transport, use: "gmail://username:password@localhost"
20+
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
21+
# Delivery is disabled by default via "null://localhost"
22+
MAILER_URL=null://localhost
23+
###< symfony/swiftmailer-bundle ###

tests/Application/.gitignore

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
/node_modules/
2-
31
/var/*
4-
!/var/.gitkeep
2+
!/var/.gitignore
3+
4+
/public/assets
5+
/public/bundles
6+
/public/css
7+
/public/js
8+
/public/media
9+
10+
/vendor
11+
/node_modules
512

6-
/web/*
7-
!/web/assets/.gitkeep
8-
!/web/bundles/.gitkeep
9-
!/web/media/image/.gitkeep
10-
!/web/app.php
11-
!/web/app_dev.php
12-
!/web/app_test.php
13+
/.env
14+
/.env.prod
15+
/.env.staging
16+
/.env.test
17+
/.env.test_cached

0 commit comments

Comments
 (0)