Skip to content

Commit

Permalink
Updated the application to use Symfony Flex
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Aug 30, 2017
1 parent 1b77c9e commit 372ddae
Show file tree
Hide file tree
Showing 195 changed files with 3,883 additions and 2,213 deletions.
23 changes: 23 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This file is a "template" of which env vars needs to be defined in your configuration or in an .env file
# Set variables here that may be different on each deployment target of the app, e.g. development, staging, production.
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration

###> symfony/framework-bundle ###
APP_ENV=dev
APP_DEBUG=1
APP_SECRET=67d829bf61dc5f87a73fd814e2c9f629
###< 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 a 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=sqlite:///var/data/blog.sqlite
###< doctrine/doctrine-bundle ###

###> symfony/swiftmailer-bundle ###
# For Gmail as a transport, use: "gmail://username:password@localhost"
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
# Delivery is disabled by default via "null://localhost"
MAILER_URL=null://localhost
###< symfony/swiftmailer-bundle ###
17 changes: 13 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/app/config/parameters.yml
/build/
/node_modules/
/phpunit.xml
Expand All @@ -15,7 +14,17 @@
/var/sessions/*
!var/sessions/.gitkeep
!var/SymfonyRequirements.php
/public/build/fonts/glyphicons-*
/public/build/images/glyphicons-*
###> symfony/framework-bundle ###
.env
/public/bundles/
/var/
/vendor/
/web/bundles/
/web/build/fonts/glyphicons-*
/web/build/images/glyphicons-*
###< symfony/framework-bundle ###
###> symfony/phpunit-bridge ###
/phpunit.xml
###< symfony/phpunit-bridge ###
###> symfony/web-server-bundle ###
.web-server-pid
###< symfony/web-server-bundle ###
10 changes: 5 additions & 5 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ COMMENT;

$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('config')
->exclude('var')
->exclude('web/bundles')
->exclude('web/css')
->exclude('web/fonts')
->exclude('web/js')
->notPath('web/config.php')
->exclude('public/bundles')
->exclude('public/css')
->exclude('public/fonts')
->exclude('public/js')
;

return PhpCsFixer\Config::create()
Expand Down
11 changes: 4 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ cache:
matrix:
fast_finish: true
include:
- php: 5.5
- php: 5.6
- php: 7.0
- php: 7.1

before_install:
Expand All @@ -21,15 +18,15 @@ install:
- composer install

script:
- cp .env.dist .env
- ./vendor/bin/simple-phpunit
# this checks that the source code follows the Symfony Code Syntax rules
- ./vendor/bin/php-cs-fixer fix --diff --dry-run -v
# this checks that the YAML config files contain no syntax errors
- ./bin/console lint:yaml app/config
- ./bin/console lint:yaml @CodeExplorerBundle
- ./bin/console lint:yaml config
# this checks that the Twig template files contain no syntax errors
- ./bin/console lint:twig app/Resources @CodeExplorerBundle
- ./bin/console lint:twig templates
# this checks that the XLIFF translations contain no syntax errors
- ./bin/console lint:xliff app/Resources
- ./bin/console lint:xliff translations
# this checks that the application doesn't use dependencies with known security vulnerabilities
- ./bin/console security:check --end-point=http://security.sensiolabs.org/check_lock
46 changes: 46 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
ifndef APP_ENV
include .env
endif

###> symfony/framework-bundle ###
CONSOLE := $(shell which bin/console)
sf_console:
ifndef CONSOLE
@printf "Run \033[32mcomposer require cli\033[39m to install the Symfony console.\n"
endif

cache-clear:
ifdef CONSOLE
@$(CONSOLE) cache:clear --no-warmup
else
@rm -rf var/cache/*
endif
.PHONY: cache-clear

cache-warmup: cache-clear
ifdef CONSOLE
@$(CONSOLE) cache:warmup
else
@printf "cannot warmup the cache (needs symfony/console)\n"
endif
.PHONY: cache-warmup

serve_as_sf: sf_console
ifndef CONSOLE
@${MAKE} serve_as_php
endif
@$(CONSOLE) | grep server:start > /dev/null || ${MAKE} serve_as_php
@$(CONSOLE) server:start

@printf "Quit the server with \033[32;49mbin/console server:stop.\033[39m\n"

serve_as_php:
@printf "\033[32;49mServer listening on http://127.0.0.1:8000\033[39m\n";
@printf "Quit the server with CTRL-C.\n"
@printf "Run \033[32mcomposer require symfony/web-server-bundle\033[39m for a better web server\n"
php -S 127.0.0.1:8000 -t public

serve:
@${MAKE} serve_as_sf
.PHONY: sf_console serve serve_as_sf serve_as_php
###< symfony/framework-bundle ###
7 changes: 0 additions & 7 deletions app/.htaccess

This file was deleted.

16 changes: 0 additions & 16 deletions app/AppCache.php

This file was deleted.

80 changes: 0 additions & 80 deletions app/AppKernel.php

This file was deleted.

85 changes: 0 additions & 85 deletions app/config/config.yml

This file was deleted.

41 changes: 0 additions & 41 deletions app/config/config_dev.yml

This file was deleted.

Loading

0 comments on commit 372ddae

Please sign in to comment.