8000 feature #617 Updated the application to use Symfony Flex (javiereguiluz) · symfony/demo@4af9be7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4af9be7

Browse files
committed
feature #617 Updated the application to use Symfony Flex (javiereguiluz)
This PR was squashed before being merged into the master branch (closes #617). Discussion ---------- Updated the application to use Symfony Flex This fixes #616. ----- The application works, but I need to check tests because there were some issues with the `dama/doctrine-test-bundle` dependency used to run tests. ----- When testing this locally, in your .env file, you must use an absolute file path to define the SQLite path. Otherwise you'll see this error: ``` An exception occurred in driver: SQLSTATE[HY000] [14] unable to open database file ``` This is a known limitation of DotEnv and we're working on it. Commits ------- 372ddae Updated the application to use Symfony Flex
2 parents 1b77c9e + 372ddae commit 4af9be7

File tree

195 files changed

+3883
-2213
lines changed

Some content is hidden

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

195 files changed

+3883
-2213
lines changed

.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=67d829bf61dc5f87a73fd814e2c9f629
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=sqlite:///var/data/blog.sqlite
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 ###

.gitignore

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/app/config/parameters.yml
21
/build/
32
/node_modules/
43
/phpunit.xml
@@ -15,7 +14,17 @@
1514
/var/sessions/*
1615
!var/sessions/.gitkeep
1716
!var/SymfonyRequirements.php
17+
/public/build/fonts/glyphicons-*
18+
/public/build/images/glyphicons-*
19+
###> symfony/framework-bundle ###
20+
.env
21+
/public/bundles/
22+
/var/
1823
/vendor/
19-
/web/bundles/
20-
/web/build/fonts/glyphicons-*
21-
/web/build/images/glyphicons-*
24+
###< symfony/framework-bundle ###
25+
###> symfony/phpunit-bridge ###
26+
/phpunit.xml
27+
###< symfony/phpunit-bridge ###
28+
###> symfony/web-server-bundle ###
29+
.web-server-pid
30+
###< symfony/web-server-bundle ###

.php_cs.dist

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ COMMENT;
1111

1212
$finder = PhpCsFixer\Finder::create()
1313
->in(__DIR__)
14+
->exclude('config')
1415
->exclude('var')
15-
->exclude('web/bundles')
16-
->exclude('web/css')
17-
->exclude('web/fonts')
18-
->exclude('web/js')
19-
->notPath('web/config.php')
16+
->exclude('public/bundles')
17+
->exclude('public/css')
18+
->exclude('public/fonts')
19+
->exclude('public/js')
2020
;
2121

2222
return PhpCsFixer\Config::create()

.travis.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ cache:
88
matrix:
99
fast_finish: true
1010
include:
11-
- php: 5.5
12-
- php: 5.6
13-
- php: 7.0
1411
- php: 7.1
1512

1613
before_install:
@@ -21,15 +18,15 @@ install:
2118
- composer install
2219

2320
script:
21+
- cp .env.dist .env
2422
- ./vendor/bin/simple-phpunit
2523
# this checks that the source code follows the Symfony Code Syntax rules
2624
- ./vendor/bin/php-cs-fixer fix --diff --dry-run -v
2725
# this checks that the YAML config files contain no syntax errors
28-
- ./bin/console lint:yaml app/config
29-
- ./bin/console lint:yaml @CodeExplorerBundle
26+
- ./bin/console lint:yaml config
3027
# this checks that the Twig template files contain no syntax errors
31-
- ./bin/console lint:twig app/Resources @CodeExplorerBundle
28+
- ./bin/console lint:twig templates
3229
# this checks that the XLIFF translations contain no syntax errors
33-
- ./bin/console lint:xliff app/Resources
30+
- ./bin/console lint:xliff translations
3431
# this checks that the application doesn't use dependencies with known security vulnerabilities
3532
- ./bin/console security:check --end-point=http://security.sensiolabs.org/check_lock

Makefile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
ifndef APP_ENV
2+
include .env
3+
endif
4+
5+
###> symfony/framework-bundle ###
6+
CONSOLE := $(shell which bin/console)
7+
sf_console:
8+
ifndef CONSOLE
9+
@printf "Run \033[32mcomposer require cli\033[39m to install the Symfony console.\n"
10+
endif
11+
12+
cache-clear:
13+
ifdef CONSOLE
14+
@$(CONSOLE) cache:clear --no-warmup
15+
else
16+
@rm -rf var/cache/*
17+
endif
18+
.PHONY: cache-clear
19+
20+
cache-warmup: cache-clear
21+
ifdef CONSOLE
22+
@$(CONSOLE) cache:warmup
23+
else
24+
@printf "cannot warmup the cache (needs symfony/console)\n"
25+
endif
26+
.PHONY: cache-warmup
27+
28+
serve_as_sf: sf_console
29+
ifndef CONSOLE
30+
@${MAKE} serve_as_php
31+
endif
32+
@$(CONSOLE) | grep server:start > /dev/null || ${MAKE} serve_as_php
33+
@$(CONSOLE) server:start
34+
35+
@printf "Quit the server with \033[32;49mbin/console server:stop.\033[39m\n"
36+
37+
serve_as_php:
38+
@printf "\033[32;49mServer listening on http://127.0.0.1:8000\033[39m\n";
39+
@printf "Quit the server with CTRL-C.\n"
40+
@printf "Run \033[32mcomposer require symfony/web-server-bundle\033[39m for a better web server\n"
41+
php -S 127.0.0.1:8000 -t public
42+
43+
serve:
44+
@${MAKE} serve_as_sf
45+
.PHONY: sf_console serve serve_as_sf serve_as_php
46+
###< symfony/framework-bundle ###

app/.htaccess

Lines changed: 0 additions & 7 deletions
This file was deleted.

app/AppCache.php

Lines changed: 0 additions & 16 deletions
This file was deleted.

app/AppKernel.php

Lines changed: 0 additions & 80 deletions
This file was deleted.

app/config/config.yml

Lines changed: 0 additions & 85 deletions
This file was deleted.

app/config/config_dev.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0