Repository: the-fast-track/book-5.0-1
Branch: master
Commit: 26f6458f88ca
Files: 131
Total size: 11.5 MB
Directory structure:
gitextract_iisn5zjd/
├── .blackfire.yaml
├── .gitignore
├── .symfony/
│ ├── config.vcl
│ ├── routes.yaml
│ └── services.yaml
├── .symfony.cloud.yaml
├── Makefile
├── assets/
│ ├── css/
│ │ ├── _variables.scss
│ │ └── app.scss
│ └── js/
│ └── app.js
├── bin/
│ ├── console
│ └── phpunit
├── blackfire-player.phar
├── composer.json
├── config/
│ ├── bootstrap.php
│ ├── bundles.php
│ ├── packages/
│ │ ├── api_platform.yaml
│ │ ├── assets.yaml
│ │ ├── cache.yaml
│ │ ├── dev/
│ │ │ ├── debug.yaml
│ │ │ ├── easy_log_handler.yaml
│ │ │ ├── monolog.yaml
│ │ │ └── web_profiler.yaml
│ │ ├── doctrine.yaml
│ │ ├── doctrine_migrations.yaml
│ │ ├── easy_admin.yaml
│ │ ├── framework.yaml
│ │ ├── mailer.yaml
│ │ ├── messenger.yaml
│ │ ├── nelmio_cors.yaml
│ │ ├── notifier.yaml
│ │ ├── prod/
│ │ │ ├── doctrine.yaml
│ │ │ ├── monolog.yaml
│ │ │ ├── routing.yaml
│ │ │ └── webpack_encore.yaml
│ │ ├── routing.yaml
│ │ ├── security.yaml
│ │ ├── sensio_framework_extra.yaml
│ │ ├── test/
│ │ │ ├── dama_doctrine_test_bundle.yaml
│ │ │ ├── framework.yaml
│ │ │ ├── monolog.yaml
│ │ │ ├── twig.yaml
│ │ │ ├── validator.yaml
│ │ │ ├── web_profiler.yaml
│ │ │ └── webpack_encore.yaml
│ │ ├── translation.yaml
│ │ ├── twig.yaml
│ │ ├── validator.yaml
│ │ ├── webpack_encore.yaml
│ │ └── workflow.yaml
│ ├── routes/
│ │ ├── annotations.yaml
│ │ ├── api_platform.yaml
│ │ ├── dev/
│ │ │ ├── framework.yaml
│ │ │ └── web_profiler.yaml
│ │ └── easy_admin.yaml
│ ├── routes.yaml
│ ├── secrets/
│ │ ├── dev/
│ │ │ ├── dev.AKISMET_KEY.ca01fb.php
│ │ │ ├── dev.SLACK_DSN.b2b579.php
│ │ │ ├── dev.decrypt.private.php
│ │ │ ├── dev.encrypt.public.php
│ │ │ └── dev.list.php
│ │ ├── prod/
│ │ │ ├── prod.AKISMET_KEY.ca01fb.php
│ │ │ ├── prod.SLACK_DSN.b2b579.php
│ │ │ ├── prod.encrypt.public.php
│ │ │ └── prod.list.php
│ │ └── test/
│ │ ├── test.AKISMET_KEY.ca01fb.php
│ │ ├── test.decrypt.private.php
│ │ ├── test.encrypt.public.php
│ │ └── test.list.php
│ └── services.yaml
├── docker-compose.yaml
├── package.json
├── php.ini
├── phpunit.xml.dist
├── public/
│ └── index.php
├── spa/
│ ├── .gitignore
│ ├── .symfony.cloud.yaml
│ ├── assets/
│ │ └── css/
│ │ ├── _variables.scss
│ │ └── app.scss
│ ├── package.json
│ ├── src/
│ │ ├── api/
│ │ │ └── api.js
│ │ ├── app.js
│ │ ├── index.ejs
│ │ └── pages/
│ │ ├── conference.js
│ │ └── home.js
│ └── webpack.config.js
├── src/
│ ├── Api/
│ │ └── FilterPublishedCommentQueryExtension.php
│ ├── Command/
│ │ ├── CommentCleanupCommand.php
│ │ └── StepInfoCommand.php
│ ├── Controller/
│ │ ├── .gitignore
│ │ ├── AdminController.php
│ │ ├── ConferenceController.php
│ │ └── SecurityController.php
│ ├── DataFixtures/
│ │ └── AppFixtures.php
│ ├── Entity/
│ │ ├── .gitignore
│ │ ├── Admin.php
│ │ ├── Comment.php
│ │ └── Conference.php
│ ├── EntityListener/
│ │ └── ConferenceEntityListener.php
│ ├── Form/
│ │ └── CommentFormType.php
│ ├── ImageOptimizer.php
│ ├── Kernel.php
│ ├── Message/
│ │ └── CommentMessage.php
│ ├── MessageHandler/
│ │ └── CommentMessageHandler.php
│ ├── Migrations/
│ │ ├── .gitignore
│ │ ├── Version20200107080917.php
│ │ ├── Version20200107081222.php
│ │ ├── Version20200107081238.php
│ │ ├── Version20200107081419.php
│ │ └── Version20200107081708.php
│ ├── Notification/
│ │ └── CommentReviewNotification.php
│ ├── Repository/
│ │ ├── .gitignore
│ │ ├── AdminRepository.php
│ │ ├── CommentRepository.php
│ │ └── ConferenceRepository.php
│ ├── Security/
│ │ └── AppAuthenticator.php
│ └── SpamChecker.php
├── templates/
│ ├── admin/
│ │ └── review.html.twig
│ ├── base.html.twig
│ ├── conference/
│ │ ├── header.html.twig
│ │ ├── index.html.twig
│ │ └── show.html.twig
│ ├── emails/
│ │ └── comment_notification.html.twig
│ └── security/
│ └── login.html.twig
├── tests/
│ ├── .gitignore
│ ├── Controller/
│ │ └── ConferenceControllerTest.php
│ └── SpamCheckerTest.php
├── translations/
│ ├── .gitignore
│ ├── messages+intl-icu.en.xlf
│ └── messages+intl-icu.fr.xlf
└── webpack.config.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .blackfire.yaml
================================================
scenarios: |
#!blackfire-player
group login
visit url('/login')
submit button("Sign in")
param username "admin"
param password "admin"
expect status_code() == 302
scenario
name "Submit a comment on the Amsterdam conference page"
include login
visit url('/fr/conference/amsterdam-2019')
expect status_code() == 200
submit button("Submit")
param comment_form[author] 'Fabien'
param comment_form[email] 'me@example.com'
param comment_form[text] 'Such a good conference!'
param comment_form[photo] file(fake('image', '/tmp', 400, 300, 'cats'), 'awesome-cat.jpg')
expect status_code() == 302
follow
expect status_code() == 200
expect not(body() matches "/Such a good conference/")
# Wait for the workflow to validate the submissions
wait 5000
when env != "prod"
visit url(webmail_url ~ '/messages')
expect status_code() == 200
set message_ids json("[*].id")
with message_id in message_ids
visit url(webmail_url ~ '/messages/' ~ message_id ~ '.html')
expect status_code() == 200
set accept_url css("table a").first().attr("href")
visit url(accept_url)
# we don't check the status code as we can deal
# with "old" messages which do not exist anymore
# in the DB (would be a 404 then)
when env == "prod"
visit url('/admin/?entity=Comment&action=list')
expect status_code() == 200
set comment_ids css('table.table tbody tr').extract('data-id')
with id in comment_ids
visit url('/admin/comment/review/' ~ id)
# we don't check the status code as we scan all comments,
# including the ones already reviewed
visit url('/fr/')
wait 5000
visit url('/fr/conference/amsterdam-2019')
expect body() matches "/Such a good conference/"
================================================
FILE: .gitignore
================================================
/public/uploads
###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/var/
/vendor/
###< symfony/framework-bundle ###
###> symfony/phpunit-bridge ###
.phpunit
.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###
###> symfony/webpack-encore-bundle ###
/node_modules/
/public/build/
npm-debug.log
yarn-error.log
###< symfony/webpack-encore-bundle ###
================================================
FILE: .symfony/config.vcl
================================================
acl profile {
# Authorize the local IP address (replace with the IP found above)
"a.b.c.d";
# Authorize Blackfire servers
"46.51.168.2";
"54.75.240.245";
}
sub vcl_recv {
set req.backend_hint = application.backend();
set req.http.Surrogate-Capability = "abc=ESI/1.0";
if (req.method == "PURGE") {
if (req.http.x-purge-token != "PURGE_NOW") {
return(synth(405));
}
return (purge);
}
# Don't profile ESI requests
if (req.esi_level > 0) {
unset req.http.X-Blackfire-Query;
}
# Bypass Varnish when the profile request comes from a known IP
if (req.http.X-Blackfire-Query && client.ip ~ profile) {
return (pass);
}
}
sub vcl_backend_response {
if (beresp.http.Surrogate-Control ~ "ESI/1.0") {
unset beresp.http.Surrogate-Control;
set beresp.do_esi = true;
}
}
================================================
FILE: .symfony/routes.yaml
================================================
"https://spa.{all}/": { type: upstream, upstream: "spa:http" }
"http://spa.{all}/": { type: redirect, to: "https://spa.{all}/" }
"https://{all}/": { type: upstream, upstream: "varnish:http", cache: { enabled: false } }
"http://{all}/": { type: redirect, to: "https://{all}/" }
================================================
FILE: .symfony/services.yaml
================================================
db:
type: postgresql:11
disk: 1024
size: S
rediscache:
type: redis:5.0
queue:
type: rabbitmq:3.7
disk: 1024
size: S
varnish:
type: varnish:6.0
relationships:
application: 'app:http'
configuration:
vcl: !include
type: string
path: config.vcl
files:
type: network-storage:1.0
disk: 256
================================================
FILE: .symfony.cloud.yaml
================================================
name: app
type: php:7.3
runtime:
extensions:
- blackfire
- xsl
- amqp
- redis
- pdo_pgsql
- apcu
- mbstring
- sodium
- ctype
- iconv
build:
flavor: none
relationships:
database: "db:postgresql"
redis: "rediscache:redis"
rabbitmq: "queue:rabbitmq"
web:
locations:
"/":
root: "public"
expires: 1h
passthru: "/index.php"
disk: 512
mounts:
"/var": { source: local, source_path: var }
"/public/uploads": { source: service, service: files, source_path: uploads }
hooks:
build: |
set -x -e
curl -s https://get.symfony.com/cloud/configurator | (>&2 bash)
(>&2 symfony-build)
deploy: |
set -x -e
(>&2 symfony-deploy)
crons:
comment_cleanup:
# Cleanup every night at 11.50 pm (UTC).
spec: '50 23 * * *'
cmd: |
if [ "$SYMFONY_BRANCH" = "master" ]; then
croncape symfony console app:comment:cleanup
fi
workers:
messages:
commands:
start: |
set -x -e
(>&2 symfony-deploy)
php bin/console messenger:consume async -vv --time-limit 3600 --memory-limit=128M
================================================
FILE: Makefile
================================================
SHELL := /bin/bash
tests:
symfony console doctrine:fixtures:load -n
symfony run bin/phpunit
.PHONY: tests
================================================
FILE: assets/css/_variables.scss
================================================
// Colors
$white: #fff;
$gray-100: #f5f5f5;
$gray-200: #e9ecef;
$gray-300: #ddd;
$gray-400: #ced4da;
$gray-500: #adb5bd;
$gray-600: #868e96;
$gray-700: #495057;
$gray-800: #343a40;
$gray-900: #212529;
$black: #000;
$blue: #175fc9;
$pink: #ff737c;
$red: #d9534f;
$yellow: #fcee60;
$orange: #ffae73;
$green: #02B875;
$teal: #55e7cc;
$cyan: #8ce6ff;
$primary: $blue;
$secondary: #666;
$success: $green;
$info: $cyan;
$warning: $yellow;
$danger: $red;
$light: $gray-100;
$dark: $gray-800;
$theme-colors: (
"blue": $blue,
"soft-blue": rgba(23, 95, 201, 0.15),
"pink": $pink,
"yellow": $yellow,
"orange": $orange,
"soft-orange": rgba(255, 174, 115, 0.15),
"teal": $teal,
"cyan": $cyan,
);
$yiq-contrasted-threshold: 190;
$text-muted: #999;
// Shadow
$box-shadow: 0 15px 30px 0 rgba(0, 0, 0, 0.1);
// Grid
$spacer: 1rem;
$spacers: (
0: 0,
1: ($spacer * .25),
2: ($spacer * .5),
3: $spacer,
4: ($spacer * 1.5),
5: ($spacer * 3),
6: ($spacer * 4.5),
7: ($spacer * 6)
);
// Body
$body-bg: $white;
$body-color: $black;
// Fonts
$font-family-base: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
$font-family-title: Georgia, Times, 'New Roman', serif;
$font-size-base: 1rem;
$font-weight-normal: 400;
$font-weight-medium: 500;
$font-weight-bold: 600;
// Headings
$headings-font-family: $font-family-title;
$headings-font-weight: $font-weight-normal;
$headings-color: $gray-900;
// Navbar
$navbar-light-brand-color: $black;
$navbar-light-brand-hover-color: $primary;
$navbar-light-hover-color: $primary;
// Dropdown
$dropdown-link-hover-bg: $gray-200;
// Tables
$table-border-color: rgba(0, 0, 0, 0.1);
// Forms and buttons
$input-border-color: rgba(0, 0, 0, .1);
$input-group-addon-bg: $gray-200;
$btn-font-weight: $font-weight-bold;
$custom-control-indicator-size: 1.3rem;
// Tooltips
$tooltip-font-size: 11px;
// Badges
$badge-font-weight: normal;
$badge-padding-y: 0.6em;
$badge-padding-x: 1.2em;
// Alerts
$alert-border-width: 0;
// Cards
$card-border-width: 0;
================================================
FILE: assets/css/app.scss
================================================
@import './variables';
@import '~bootstrap/scss/bootstrap';
body {
display: flex;
flex-direction: column;
height: 100vh;
}
main {
flex: 1;
}
// Darken buttons
@each $color, $value in $theme-colors {
.btn-#{$color} {
@include button-variant($value, $value, darken($value, 10%));
}
}
.navbar-brand {
font-family: $font-family-title;
font-weight: $font-weight-normal;
font-size: 1.8rem;
}
.navbar-brand, .nav-link {
transition: all .15s;
}
.nav-conference {
display: inline-block;
padding: 5px 10px;
color: #666;
text-transform: uppercase;
font-weight: bold;
font-size: 0.8rem;
}
.lift {
transition: box-shadow .25s ease,transform .25s ease;
&:focus, &:hover {
box-shadow: 0 1rem 2.5rem rgba(22,28,45,.1),0 .5rem 1rem -.75rem rgba(22,28,45,.1)!important;
transform: translate3d(0, -4px, 0);
}
}
.comment-img {
width: 250px;
height: 150px;
img {
max-width: 250px;
max-height: 150px;
}
}
.comment-text {
font-size: 12px;
line-height: 15px;
}
footer {
background: #18171b;
}
================================================
FILE: assets/js/app.js
================================================
/*
* Welcome to your app's main JavaScript file!
*
* We recommend including the built version of this JavaScript file
* (and its CSS file) in your base layout (base.html.twig).
*/
// any CSS you require will output into a single css file (app.css in this case)
import '../css/app.scss';
import 'bootstrap';
import bsCustomFileInput from 'bs-custom-file-input';
bsCustomFileInput.init();
================================================
FILE: bin/console
================================================
#!/usr/bin/env php
getParameterOption(['--env', '-e'], null, true)) {
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
}
if ($input->hasParameterOption('--no-debug', true)) {
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
}
require dirname(__DIR__).'/config/bootstrap.php';
if ($_SERVER['APP_DEBUG']) {
umask(0000);
if (class_exists(Debug::class)) {
Debug::enable();
}
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$application = new Application($kernel);
$application->run($input);
================================================
FILE: bin/phpunit
================================================
#!/usr/bin/env php
=1.2)
if (is_array($env = @include dirname(__DIR__).'/.env.local.php') && ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV']) {
foreach ($env as $k => $v) {
$_ENV[$k] = $_ENV[$k] ?? (isset($_SERVER[$k]) && 0 !== strpos($k, 'HTTP_') ? $_SERVER[$k] : $v);
}
} elseif (!class_exists(Dotenv::class)) {
throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.');
} else {
// load all the .env files
(new Dotenv(false))->loadEnv(dirname(__DIR__).'/.env');
}
$_SERVER += $_ENV;
$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev';
$_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV'];
$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0';
================================================
FILE: config/bundles.php
================================================
['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
EasyCorp\Bundle\EasyAdminBundle\EasyAdminBundle::class => ['all' => true],
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
DAMA\DoctrineTestBundle\DAMADoctrineTestBundle::class => ['test' => true],
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true],
ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
];
================================================
FILE: config/packages/api_platform.yaml
================================================
api_platform:
mapping:
paths: ['%kernel.project_dir%/src/Entity']
patch_formats:
json: ['application/merge-patch+json']
swagger:
versions: [3]
================================================
FILE: config/packages/assets.yaml
================================================
framework:
assets:
json_manifest_path: '%kernel.project_dir%/public/build/manifest.json'
================================================
FILE: config/packages/cache.yaml
================================================
framework:
cache:
# Unique name of your app: used to compute stable namespaces for cache keys.
#prefix_seed: your_vendor_name/app_name
# The "app" cache stores to the filesystem by default.
# The data in this cache should persist between deploys.
# Other options include:
# Redis
#app: cache.adapter.redis
#default_redis_provider: redis://localhost
# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
#app: cache.adapter.apcu
# Namespaced pools use the above "app" backend by default
#pools:
#my.dedicated.cache: null
================================================
FILE: config/packages/dev/debug.yaml
================================================
debug:
# Forwards VarDumper Data clones to a centralized server allowing to inspect dumps on CLI or in your browser.
# See the "server:dump" command to start a new server.
dump_destination: "tcp://%env(VAR_DUMPER_SERVER)%"
================================================
FILE: config/packages/dev/easy_log_handler.yaml
================================================
services:
EasyCorp\EasyLog\EasyLogHandler:
public: false
arguments: ['%kernel.logs_dir%/%kernel.environment%.log']
#// FIXME: How to add this configuration automatically without messing up with the monolog configuration?
#monolog:
# handlers:
# buffered:
# type: buffer
# handler: easylog
# channels: ['!event']
# level: debug
# easylog:
# type: service
# id: EasyCorp\EasyLog\EasyLogHandler
================================================
FILE: config/packages/dev/monolog.yaml
================================================
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: ["!event"]
# uncomment to get logging in your browser
# you may have to allow bigger header sizes in your Web server configuration
#firephp:
# type: firephp
# level: info
#chromephp:
# type: chromephp
# level: info
console:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine", "!console"]
================================================
FILE: config/packages/dev/web_profiler.yaml
================================================
web_profiler:
toolbar: true
intercept_redirects: false
framework:
profiler: { only_exceptions: false }
================================================
FILE: config/packages/doctrine.yaml
================================================
doctrine:
dbal:
url: '%env(resolve:DATABASE_URL)%'
# IMPORTANT: You MUST configure your server version,
# either here or in the DATABASE_URL env var (see .env file)
#server_version: '5.7'
orm:
auto_generate_proxy_classes: true
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
auto_mapping: true
mappings:
App:
is_bundle: false
type: annotation
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App
================================================
FILE: config/packages/doctrine_migrations.yaml
================================================
doctrine_migrations:
dir_name: '%kernel.project_dir%/src/Migrations'
# namespace is arbitrary but should be different from App\Migrations
# as migrations classes should NOT be autoloaded
namespace: DoctrineMigrations
================================================
FILE: config/packages/easy_admin.yaml
================================================
easy_admin:
site_name: Conference Guestbook
design:
menu:
- { route: 'homepage', label: 'Back to the website', icon: 'home' }
- { entity: 'Conference', label: 'Conferences', icon: 'map-marker' }
- { entity: 'Comment', label: 'Comments', icon: 'comments' }
entities:
Conference:
class: App\Entity\Conference
Comment:
class: App\Entity\Comment
list:
fields:
- author
- { property: 'email', type: 'email' }
- { property: 'photoFilename', type: 'image', 'base_path': "/uploads/photos", label: 'Photo' }
- state
- { property: 'createdAt', type: 'datetime' }
sort: ['createdAt', 'ASC']
filters: ['conference']
edit:
fields:
- { property: 'conference' }
- { property: 'createdAt', type: datetime, type_options: { attr: { readonly: true } } }
- 'author'
- { property: 'state' }
- { property: 'email', type: 'email' }
- text
================================================
FILE: config/packages/framework.yaml
================================================
framework:
secret: '%env(APP_SECRET)%'
#csrf_protection: true
#http_method_override: true
# Enables session support. Note that the session will ONLY be started if you read or write from it.
# Remove or comment this section to explicitly disable session support.
session:
handler_id: '%env(REDIS_URL)%'
cookie_secure: auto
cookie_samesite: lax
esi: true
#fragments: true
php_errors:
log: true
ide: vscode
================================================
FILE: config/packages/mailer.yaml
================================================
framework:
mailer:
dsn: '%env(MAILER_DSN)%'
envelope:
sender: "%env(string:default:default_admin_email:ADMIN_EMAIL)%"
================================================
FILE: config/packages/messenger.yaml
================================================
framework:
messenger:
# Uncomment this (and the failed transport below) to send failed messages to this transport for later handling.
# failure_transport: failed
transports:
# https://symfony.com/doc/current/messenger.html#transport-configuration
async:
dsn: '%env(RABBITMQ_DSN)%'
retry_strategy:
max_retries: 3
multiplier: 2
failed: 'doctrine://default?queue_name=failed'
# sync: 'sync://'
failure_transport: failed
routing:
# Route your messages to the transports
App\Message\CommentMessage: async
Symfony\Component\Mailer\Messenger\SendEmailMessage: async
Symfony\Component\Notifier\Message\ChatMessage: async
Symfony\Component\Notifier\Message\SmsMessage: async
================================================
FILE: config/packages/nelmio_cors.yaml
================================================
nelmio_cors:
defaults:
origin_regex: true
allow_origin: ['%env(CORS_ALLOW_ORIGIN)%']
allow_methods: ['GET', 'OPTIONS', 'POST', 'PUT', 'PATCH', 'DELETE']
allow_headers: ['Content-Type', 'Authorization']
expose_headers: ['Link']
max_age: 3600
paths:
'^/': null
================================================
FILE: config/packages/notifier.yaml
================================================
framework:
notifier:
chatter_transports:
slack: '%env(SLACK_DSN)%'
# telegram: '%env(TELEGRAM_DSN)%'
#texter_transports:
# twilio: '%env(TWILIO_DSN)%'
# nexmo: '%env(NEXMO_DSN)%'
channel_policy:
# use chat/slack, chat/telegram, sms/twilio or sms/nexmo
urgent: ['email']
high: ['email']
medium: ['email']
low: ['email']
admin_recipients:
- { email: "%env(string:default:default_admin_email:ADMIN_EMAIL)%" }
================================================
FILE: config/packages/prod/doctrine.yaml
================================================
doctrine:
orm:
auto_generate_proxy_classes: false
metadata_cache_driver:
type: pool
pool: doctrine.system_cache_pool
query_cache_driver:
type: pool
pool: doctrine.system_cache_pool
result_cache_driver:
type: pool
pool: doctrine.result_cache_pool
framework:
cache:
pools:
doctrine.result_cache_pool:
adapter: cache.app
doctrine.system_cache_pool:
adapter: cache.system
================================================
FILE: config/packages/prod/monolog.yaml
================================================
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
excluded_http_codes: [404, 405]
nested:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
console:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine"]
deprecation:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log"
deprecation_filter:
type: filter
handler: deprecation
max_level: info
channels: ["php"]
================================================
FILE: config/packages/prod/routing.yaml
================================================
framework:
router:
strict_requirements: null
================================================
FILE: config/packages/prod/webpack_encore.yaml
================================================
#webpack_encore:
# Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes)
# Available in version 1.2
#cache: true
================================================
FILE: config/packages/routing.yaml
================================================
framework:
router:
utf8: true
================================================
FILE: config/packages/security.yaml
================================================
security:
encoders:
App\Entity\Admin:
algorithm: auto
# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
providers:
# used to reload user from session & other features (e.g. switch_user)
app_user_provider:
entity:
class: App\Entity\Admin
property: username
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
anonymous: lazy
guard:
authenticators:
- App\Security\AppAuthenticator
logout:
path: app_logout
# where to redirect after logout
# target: app_any_route
# activate different ways to authenticate
# https://symfony.com/doc/current/security.html#firewalls-authentication
# https://symfony.com/doc/current/security/impersonating_user.html
# switch_user: true
# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
access_control:
- { path: ^/admin, roles: ROLE_ADMIN }
# - { path: ^/profile, roles: ROLE_USER }
================================================
FILE: config/packages/sensio_framework_extra.yaml
================================================
sensio_framework_extra:
router:
annotations: false
================================================
FILE: config/packages/test/dama_doctrine_test_bundle.yaml
================================================
dama_doctrine_test:
enable_static_connection: true
enable_static_meta_data_cache: true
enable_static_query_cache: true
================================================
FILE: config/packages/test/framework.yaml
================================================
framework:
test: true
session:
storage_id: session.storage.mock_file
================================================
FILE: config/packages/test/monolog.yaml
================================================
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: ["!event"]
================================================
FILE: config/packages/test/twig.yaml
================================================
twig:
strict_variables: true
================================================
FILE: config/packages/test/validator.yaml
================================================
framework:
validation:
not_compromised_password: false
================================================
FILE: config/packages/test/web_profiler.yaml
================================================
web_profiler:
toolbar: false
intercept_redirects: false
framework:
profiler: { collect: false }
================================================
FILE: config/packages/test/webpack_encore.yaml
================================================
#webpack_encore:
# strict_mode: false
================================================
FILE: config/packages/translation.yaml
================================================
framework:
default_locale: en
translator:
default_path: '%kernel.project_dir%/translations'
fallbacks:
- en
================================================
FILE: config/packages/twig.yaml
================================================
twig:
form_themes: ['bootstrap_4_layout.html.twig']
================================================
FILE: config/packages/validator.yaml
================================================
framework:
validation:
email_validation_mode: html5
# Enables validator auto-mapping support.
# For instance, basic validation constraints will be inferred from Doctrine's metadata.
#auto_mapping:
# App\Entity\: []
================================================
FILE: config/packages/webpack_encore.yaml
================================================
webpack_encore:
# The path where Encore is building the assets - i.e. Encore.setOutputPath()
output_path: '%kernel.project_dir%/public/build'
# If multiple builds are defined (as shown below), you can disable the default build:
# output_path: false
# if using Encore.enableIntegrityHashes() and need the crossorigin attribute (default: false, or use 'anonymous' or 'use-credentials')
# crossorigin: 'anonymous'
# preload all rendered script and link tags automatically via the http2 Link header
# preload: true
# Throw an exception if the entrypoints.json file is missing or an entry is missing from the data
# strict_mode: false
# if you have multiple builds:
# builds:
# pass "frontend" as the 3rg arg to the Twig functions
# {{ encore_entry_script_tags('entry1', null, 'frontend') }}
# frontend: '%kernel.project_dir%/public/frontend/build'
# Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes)
# Put in config/packages/prod/webpack_encore.yaml
# cache: true
================================================
FILE: config/packages/workflow.yaml
================================================
framework:
workflows:
comment:
type: state_machine
audit_trail:
enabled: "%kernel.debug%"
marking_store:
type: 'method'
property: 'state'
supports:
- App\Entity\Comment
initial_marking: submitted
places:
- submitted
- ham
- potential_spam
- spam
- rejected
- ready
- published
transitions:
accept:
from: submitted
to: ham
might_be_spam:
from: submitted
to: potential_spam
reject_spam:
from: submitted
to: spam
publish:
from: potential_spam
to: ready
reject:
from: potential_spam
to: rejected
publish_ham:
from: ham
to: ready
reject_ham:
from: ham
to: rejected
optimize:
from: ready
to: published
================================================
FILE: config/routes/annotations.yaml
================================================
controllers:
resource: ../../src/Controller/
type: annotation
================================================
FILE: config/routes/api_platform.yaml
================================================
api_platform:
resource: .
type: api_platform
prefix: /api
================================================
FILE: config/routes/dev/framework.yaml
================================================
_errors:
resource: '@FrameworkBundle/Resources/config/routing/errors.xml'
prefix: /_error
================================================
FILE: config/routes/dev/web_profiler.yaml
================================================
web_profiler_wdt:
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
prefix: /_wdt
web_profiler_profiler:
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
prefix: /_profiler
================================================
FILE: config/routes/easy_admin.yaml
================================================
easy_admin_bundle:
resource: '@EasyAdminBundle/Controller/EasyAdminController.php'
prefix: /admin
type: annotation
================================================
FILE: config/routes.yaml
================================================
#index:
# path: /
# controller: App\Controller\DefaultController::index
================================================
FILE: config/secrets/dev/dev.AKISMET_KEY.ca01fb.php
================================================
NULL,
'SLACK_DSN' => NULL,
);
================================================
FILE: config/secrets/prod/prod.AKISMET_KEY.ca01fb.php
================================================
NULL,
'SLACK_DSN' => NULL,
);
================================================
FILE: config/secrets/test/test.AKISMET_KEY.ca01fb.php
================================================
NULL,
);
================================================
FILE: config/services.yaml
================================================
# This file is the entry point to configure your own services.
# Files in the packages/ subdirectory configure your dependencies.
# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
default_admin_email: admin@example.com
default_domain: '127.0.0.1'
default_scheme: 'http'
app.supported_locales: 'en|fr'
router.request_context.host: '%env(default:default_domain:SYMFONY_DEFAULT_ROUTE_HOST)%'
router.request_context.scheme: '%env(default:default_scheme:SYMFONY_DEFAULT_ROUTE_SCHEME)%'
services:
# default configuration for services in *this* file
_defaults:
autowire: true # Automatically injects dependencies in your services.
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
bind:
$photoDir: "%kernel.project_dir%/public/uploads/photos"
$akismetKey: "%env(AKISMET_KEY)%"
$adminEmail: "%env(string:default:default_admin_email:ADMIN_EMAIL)%"
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
App\:
resource: '../src/*'
exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'
# controllers are imported separately to make sure services can be injected
# as action arguments even if you don't extend any base controller class
App\Controller\:
resource: '../src/Controller'
tags: ['controller.service_arguments']
# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones
App\EntityListener\ConferenceEntityListener:
tags:
- { name: 'doctrine.orm.entity_listener', event: 'prePersist', entity: 'App\Entity\Conference'}
- { name: 'doctrine.orm.entity_listener', event: 'preUpdate', entity: 'App\Entity\Conference'}
================================================
FILE: docker-compose.yaml
================================================
version: '3'
services:
database:
image: postgres:11-alpine
environment:
POSTGRES_USER: main
POSTGRES_PASSWORD: main
POSTGRES_DB: main
ports: [5432]
redis:
image: redis:5-alpine
ports: [6379]
rabbitmq:
image: rabbitmq:3.7-management
ports: [5672, 15672]
mailcatcher:
image: schickling/mailcatcher
ports: [1025, 1080]
blackfire:
image: blackfire/blackfire
env_file: .env.local
ports: [8707]
================================================
FILE: package.json
================================================
{
"devDependencies": {
"@symfony/webpack-encore": "^0.28.2",
"bootstrap": "^4.4.1",
"bs-custom-file-input": "^1.3.2",
"core-js": "^3.0.0",
"jquery": "^3.4.1",
"node-sass": "^4.13.0",
"popper.js": "^1.16.0",
"regenerator-runtime": "^0.13.2",
"sass-loader": "^7.0.1",
"webpack-notifier": "^1.6.0"
},
"license": "UNLICENSED",
"private": true,
"scripts": {
"dev-server": "encore dev-server",
"dev": "encore dev",
"watch": "encore dev --watch",
"build": "encore production --progress"
}
}
================================================
FILE: php.ini
================================================
allow_url_include=off
assert.active=off
display_errors=off
display_startup_errors=off
max_execution_time=30
session.use_strict_mode=On
realpath_cache_ttl=3600
zend.detect_unicode=Off
[blackfire]
# use php_blackfire.dll on Windows
extension=blackfire.so
================================================
FILE: phpunit.xml.dist
================================================
Applied transition: {{ transition }}
New state: {{ comment.state }}
{% endblock %} ================================================ FILE: templates/base.html.twig ================================================{{ comment.text }}
{% endblock %} {% block action %}