Commit 56945a49 by Julien Jorry

Update

parent e5088df8
[Fri Nov 30 19:54:38.362098 2018] [authz_core:error] [pid 68481] [client 127.0.0.1:55323] AH01630: client denied by server configuration: /Users/julien/Desktop/DOUME/ledellin/public/
[Fri Nov 30 19:54:40.626560 2018] [authz_core:error] [pid 68481] [client 127.0.0.1:55323] AH01630: client denied by server configuration: /Users/julien/Desktop/DOUME/ledellin/public/favicon.ico, referer: http://doume.test/
body {
background-color: lightgray;
}
/*
* 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)
require('../css/app.css');
// Need jQuery? Install it with "yarn add jquery", then uncomment to require it.
// var $ = require('jquery');
console.log('Hello Webpack Encore! Edit me in assets/js/app.js');
#!/usr/bin/env php
<?php
use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Debug\Debug;
set_time_limit(0);
require dirname(__DIR__).'/vendor/autoload.php';
if (!class_exists(Application::class)) {
throw new \RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
}
Kernel::bootstrapCli($_SERVER['argv']);
Kernel::bootstrapEnv();
if ($_SERVER['APP_DEBUG']) {
umask(0000);
if (class_exists(Debug::class)) {
Debug::enable();
}
}
$kernel = new Kernel($_SERVER['APP_ENV'], $_SERVER['APP_DEBUG']);
$application = new Application($kernel);
$application->run();
#!/usr/bin/env php
<?php
if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit')) {
echo "Unable to find the `simple-phpunit` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
exit(1);
}
$classLoader = require dirname(__DIR__).'/vendor/autoload.php';
App\Kernel::bootstrapEnv('test');
$classLoader->unregister();
if (false === getenv('SYMFONY_PHPUNIT_REMOVE')) {
putenv('SYMFONY_PHPUNIT_REMOVE=');
}
if (false === getenv('SYMFONY_PHPUNIT_DIR')) {
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
}
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit';
{
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.1.3",
"ext-ctype": "*",
"ext-iconv": "*",
"friendsofsymfony/rest-bundle": "^2.4",
"friendsofsymfony/user-bundle": "^2.1",
"knplabs/knp-paginator-bundle": "^2.8",
"liip/imagine-bundle": "^2.1",
"nelmio/api-doc-bundle": "^3.3",
"pixassociates/sortable-behavior-bundle": "^1.5",
"sensio/framework-extra-bundle": "^5.1",
"sonata-project/admin-bundle": "^3.40",
"sonata-project/block-bundle": "^3.12",
"sonata-project/doctrine-orm-admin-bundle": "^3.6",
"sonata-project/user-bundle": "^4.2",
"stof/doctrine-extensions-bundle": "^1.3",
"symfony/asset": "4.1.*",
"symfony/console": "4.1.*",
"symfony/expression-language": "4.1.*",
"symfony/flex": "^1.1",
"symfony/form": "4.1.*",
"symfony/framework-bundle": "4.1.*",
"symfony/monolog-bundle": "^3.1",
"symfony/orm-pack": "*",
"symfony/process": "4.1.*",
"symfony/security-bundle": "4.1.*",
"symfony/serializer-pack": "*",
"symfony/swiftmailer-bundle": "^3.1",
"symfony/translation": "4.1.*",
"symfony/twig-bundle": "4.1.*",
"symfony/validator": "4.1.*",
"symfony/web-link": "4.1.*",
"symfony/webpack-encore-bundle": "^1.0",
"symfony/yaml": "4.1.*",
"vich/uploader-bundle": "^1.8"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.0",
"hautelook/alice-bundle": "^2.3",
"sensiolabs/security-checker": "^5.0",
"symfony/debug-pack": "*",
"symfony/dotenv": "4.1.*",
"symfony/maker-bundle": "^1.0",
"symfony/profiler-pack": "*",
"symfony/test-pack": "*",
"symfony/var-dumper": "4.1.*",
"symfony/web-server-bundle": "4.1.*"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"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"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.1.*"
}
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
<?php
return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => 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],
Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle::class => ['all' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['dev' => true],
FOS\UserBundle\FOSUserBundle::class => ['all' => true],
Sonata\DatagridBundle\SonataDatagridBundle::class => ['all' => true],
Sonata\CoreBundle\SonataCoreBundle::class => ['all' => true],
Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true],
Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true],
Sonata\AdminBundle\SonataAdminBundle::class => ['all' => true],
Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true],
Sonata\EasyExtendsBundle\SonataEasyExtendsBundle::class => ['all' => true],
Sonata\UserBundle\SonataUserBundle::class => ['all' => true],
Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle::class => ['all' => true],
Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
Vich\UploaderBundle\VichUploaderBundle::class => ['all' => true],
Pix\SortableBehaviorBundle\PixSortableBehaviorBundle::class => ['all' => true],
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
Nelmio\ApiDocBundle\NelmioApiDocBundle::class => ['all' => true],
Knp\Bundle\PaginatorBundle\KnpPaginatorBundle::class => ['all' => true],
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
FOS\RestBundle\FOSRestBundle::class => ['all' => true],
Nelmio\Alice\Bridge\Symfony\NelmioAliceBundle::class => ['dev' => true, 'test' => true],
Fidry\AliceDataFixtures\Bridge\Symfony\FidryAliceDataFixturesBundle::class => ['dev' => true, 'test' => true],
Hautelook\AliceBundle\HautelookAliceBundle::class => ['dev' => true, 'test' => true],
];
framework:
assets:
json_manifest_path: '%kernel.project_dir%/public/build/manifest.json'
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)%"
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
hautelook_alice:
fixtures_path: fixtures
root_dirs:
- '%kernel.root_dir%'
- '%kernel.project_dir%'
\ No newline at end of file
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"]
nelmio_alice:
locale: 'fr_FR'
functions_blacklist:
- 'current'
framework:
router:
strict_requirements: true
# See https://symfony.com/doc/current/email/dev_environment.html
swiftmailer:
# send all emails to a specific address
#delivery_addresses: ['me@example.com']
web_profiler:
toolbar: true
intercept_redirects: false
framework:
profiler: { only_exceptions: false }
parameters:
# Adds a fallback DATABASE_URL if the env var is not set.
# This allows you to run cache:warmup even if your
# environment variables are not available yet.
# You should not need to change this value.
env(DATABASE_URL): ''
doctrine:
dbal:
# configure these for your database server
driver: 'pdo_mysql'
server_version: '5.7'
charset: utf8mb4
default_table_options:
charset: utf8mb4
collate: utf8mb4_unicode_ci
url: '%env(resolve:DATABASE_URL)%'
types:
json: Sonata\Doctrine\Types\JsonType
orm:
auto_generate_proxy_classes: '%kernel.debug%'
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: true
mappings:
App:
is_bundle: false
type: annotation
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App
dql:
string_functions:
str_to_date: App\DQL\StrToDate
filters:
softdeleteable:
class: Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter
enabled: true
\ No newline at end of file
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
# Read the documentation: https://symfony.com/doc/master/bundles/FOSRestBundle/index.html
fos_rest: ~
# param_fetcher_listener: true
# allowed_methods_listener: true
# routing_loader: true
# view:
# view_response_listener: true
# exception:
# codes:
# App\Exception\MyException: 403
# messages:
# App\Exception\MyException: Forbidden area.
# format_listener:
# rules:
# - { path: ^/api, prefer_extension: true, fallback_format: json, priorities: [ json, html ] }
fos_user:
db_driver: orm
firewall_name: main
user_class: App\Entity\User
from_email:
address: noreply@doume.org
sender_name: Doume
service:
mailer: fos_user.mailer.twig_swift
user_manager: sonata.user.orm.user_manager
group:
group_class: App\Entity\Usergroup
group_manager: sonata.user.orm.group_manager # If you're using doctrine orm (use sonata.user.mongodb.group_manager for mongodb)
# registration:
# form:
# type: osp_person_registration
# confirmation:
# enabled: true
# template: OSPUserBundle:Registration:email.txt.twig
\ No newline at end of file
framework:
secret: '%env(APP_SECRET)%'
#default_locale: en
#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: ~
#esi: true
#fragments: true
php_errors:
log: true
cache:
# Put the unique name of your app here: the prefix seed
# is used to compute stable namespaces for cache keys.
#prefix_seed: your_vendor_name/app_name
# The app cache caches to the filesystem by default.
# 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
liip_imagine:
# valid drivers options include "gd" or "gmagick" or "imagick"
driver: "gd"
# resolvers:
# default:
# web_path:
# web_root: "%kernel.project_dir%/public"
# cache_prefix: "images/cache"
# loaders:
# default:
# filesystem:
# data_root: "%kernel.project_dir%/public/"
# define your filter sets under this option
filter_sets:
# an example thumbnail transformation definition
# https://symfony.com/doc/current/bundles/LiipImagineBundle/basic-usage.html#create-thumbnails
squared_thumbnail:
# set your image quality defaults
jpeg_quality: 85
png_compression_level: 8
# setup the filter steps to apply for this transformation
filters:
# auto rotate the image using EXIF metadata
auto_rotate: ~
# strip the image of all metadata
strip: ~
# scale and square the image to the given dimensions
thumbnail:
size: [250, 250]
mode: outbound
allow_upscale: true
# create border by placing image on larger black background
# background:
# size: [256, 256]
# position: center
# color: '#fff'
# nelmio_api_doc:
# areas:
# path_patterns: # an array of regexps
# - ^/api(?!/doc$)
# host_patterns:
# - ^api\.
# documentation:
# host: api.example.com
# schemes: [http, https]
# info:
# title: My App
# description: This is an awesome app!
# version: 1.0.0
# securityDefinitions:
# Bearer:
# type: apiKey
# description: 'Value: Bearer {jwt}'
# name: Authorization
# in: header
# security:
# - Bearer: []
nelmio_api_doc:
documentation:
info:
title: Ledellin
description: Application de gesiton de Monnaie Locale Complémentaire
version: 1.0.0
areas: # to filter documented areas
path_patterns:
- ^/api(?!/doc$) # Accepts routes under /api except /api/doc
\ No newline at end of file
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
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
excluded_404s:
# regex: exclude all 404 errors from the logs
- ^/
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"]
framework:
router:
strict_requirements: ~
# security:
# # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
# providers:
# in_memory: { memory: ~ }
# firewalls:
# dev:
# pattern: ^/(_(profiler|wdt)|css|images|js)/
# security: false
# main:
# anonymous: true
# # activate different ways to authenticate
# # http_basic: true
# # https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
# # form_login: true
# # https://symfony.com/doc/current/security/form_login_setup.html
# # 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 }
security:
# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
providers:
fos_userbundle:
id: fos_user.user_provider.username_email
in_memory: { memory: ~ }
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
# -> custom firewall for the admin area of the URL
admin:
pattern: /admin(.*)
context: user
form_login:
provider: fos_userbundle
login_path: /admin/login
check_path: /admin/login_check
use_forward: false
failure_path: null
success_handler: redirect.after.login
logout:
path: /admin/logout
target: /admin/login
anonymous: true
# -> end custom configuration
main:
pattern: ^/
form_login:
provider: fos_userbundle
login_path: fos_user_security_login
check_path: fos_user_security_check
csrf_token_generator: security.csrf.token_manager
success_handler: redirect.after.login
logout:
path: fos_user_security_logout
target: fos_user_security_login
anonymous: true
remember_me:
secret: "%kernel.secret%"
lifetime: 31536000
path: /
domain: ~
user_provider: fos_userbundle
always_remember_me: true
encoders:
FOS\UserBundle\Model\UserInterface: bcrypt
role_hierarchy:
ROLE_ADHERENT: ROLE_USER
ROLE_PRESTATAIRE: ROLE_USER
ROLE_ADMIN_SIEGE: ROLE_USER
ROLE_REDACTEUR: ROLE_USER
ROLE_TRESORIER: ROLE_USER
ROLE_GESTION_GROUPE: ROLE_USER
ROLE_COMPTOIR: ROLE_USER
ROLE_CONTACT: ROLE_USER
ROLE_ADMIN: [ROLE_USER, ROLE_SONATA_ADMIN]
ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
access_control:
# Admin login page needs to be accessed without credential
- { path: ^/admin/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin/logout$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin/login_check$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
# Secured part of the site
# This config requires being logged for the whole site and having the admin role for the admin part.
# Change these rules to adapt them to your needs
- { path: ^/admin/, role: [ROLE_ADMIN, ROLE_SUPER_ADMIN, ROLE_SONATA_ADMIN] }
- { path: ^/.*, role: IS_AUTHENTICATED_ANONYMOUSLY }
services:
SensioLabs\Security\SecurityChecker:
public: false
SensioLabs\Security\Command\SecurityCheckerCommand:
arguments: ['@SensioLabs\Security\SecurityChecker']
public: false
tags:
- { name: console.command, command: 'security:check' }
sensio_framework_extra:
router:
annotations: false
sonata_user:
# security_acl: true
manager_type: orm # can be orm or mongodb
class:
user: App\Entity\User
group: App\Entity\Usergroup
profile:
default_avatar: 'images/admin/default_avatar.png' # Default avatar displayed if the user doesn't have one
sonata_block:
default_contexts: [sonata_page_bundle]
blocks:
sonata.admin.block.admin_list:
contexts: [admin]
#sonata.admin_doctrine_orm.block.audit:
# contexts: [admin]
sonata.block.service.text:
\ No newline at end of file
sonata_admin:
security:
handler: sonata.admin.security.handler.role
role_admin: ROLE_ADMIN
role_super_admin: ROLE_SUPER_ADMIN
title: 'MLC Admin'
title_logo: /images/admin/logo.png
dashboard:
# DASHBOARD de l'admin
#
# Layout :
#
# TOP TOP TOP
# LEFT CENTER RIGHT
# LEFT CENTER RIGHT
# LEFT CENTER RIGHT
# BOTTOM BOTTOM BOTTOM
blocks:
- { type: sonata.admin.block.admin_list, position: left }
-
type: sonata.block.service.text
position: right
settings:
content: >
<h2>Bienvenue sur l'administration de votre Monnaie Locale Complémentaire !</h2>
:
# Exemple de block de stats
# -
# class: col-lg-3 col-xs-6 # twitter bootstrap responsive code
# position: top # zone in the dashboard
# type: sonata.admin.block.stats # block id
# settings:
# code: sonata.page.admin.page # admin code - service id
# icon: fa-magic # font awesome icon
# text: Edited Pages
# color: bg-yellow # colors: bg-green, bg-red and bg-aqua
# filters: # filter values
# edited: { value: 1 } # filtre on admin (settings:code)
# Gérer l'affichage du menu de l'admin en fonction des roles
# groups:
# app.admin.group.content:
# label: app.admin.group.content
# label_catalogue: App
# items:
# - app.admin.post
# roles: [ ROLE_ONE, ROLE_TWO ]
sonata_block:
blocks:
sonata.admin.block.admin_list:
contexts: [admin]
sonata_core:
form:
mapping:
enabled: false
# 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: en_US
orm:
default:
sortable: true
timestampable: true
sluggable: true
softdeleteable: true
\ No newline at end of file
swiftmailer:
url: '%env(MAILER_URL)%'
spool: { type: 'memory' }
framework:
test: true
session:
storage_id: session.storage.mock_file
imports:
- { resource: ../dev/hautelook_alice.yaml }
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: ["!event"]
imports:
- { resource: ../dev/nelmio_alice.yaml }
framework:
router:
strict_requirements: true
swiftmailer:
disable_delivery: true
web_profiler:
toolbar: false
intercept_redirects: false
framework:
profiler: { collect: false }
framework:
# default_locale: '%locale%'
default_locale: 'fr'
translator:
default_path: '%kernel.project_dir%/translations'
fallbacks:
# - '%locale%'
- 'fr'
- 'en'
twig:
default_path: '%kernel.project_dir%/templates'
debug: '%kernel.debug%'
strict_variables: '%kernel.debug%'
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: ~
framework:
validation:
email_validation_mode: html5
vich_uploader:
db_driver: orm
mappings:
annonce:
uri_prefix: /images/annonces
upload_destination: '%kernel.project_dir%/public/images/annonces'
# delete_on_update: true
# delete_on_remove: true
\ No newline at end of file
webpack_encore:
# The path where Encore is building the assets.
# This should match Encore.setOutputPath() in webpack.config.js.
output_path: '%kernel.project_dir%/public/build'
# This file is the entry point to configure your own HTTP routes.
# Files in the routes/ subdirectory configure the routes for your dependencies.
#index:
# path: /
# controller: App\Controller\DefaultController::index
sonata_user_admin_security:
resource: '@SonataUserBundle/Resources/config/routing/admin_security.xml'
prefix: /admin
sonata_user_admin_resetting:
resource: '@SonataUserBundle/Resources/config/routing/admin_resetting.xml'
prefix: /admin/resetting
fos_user:
resource: "@FOSUserBundle/Resources/config/routing/all.xml"
\ No newline at end of file
controllers:
resource: ../../src/Controller/
type: annotation
_errors:
resource: '@TwigBundle/Resources/config/routing/errors.xml'
prefix: /_error
web_profiler_wdt:
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
prefix: /_wdt
web_profiler_profiler:
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
prefix: /_profiler
_liip_imagine:
resource: "@LiipImagineBundle/Resources/config/routing.yaml"
# Expose your documentation as JSON swagger compliant
app.swagger:
path: /api/doc.json
methods: GET
defaults: { _controller: nelmio_api_doc.controller.swagger }
## Requires the Asset component and the Twig bundle
## $ composer require twig asset
#app.swagger_ui:
# path: /api/doc
# methods: GET
# defaults: { _controller: nelmio_api_doc.controller.swagger_ui }
admin_area:
resource: "@SonataAdminBundle/Resources/config/routing/sonata_admin.xml"
prefix: /admin
_sonata_admin:
resource: .
type: sonata_admin
prefix: /admin
# 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:
locale: 'en'
sonata.user.admin.user.class: 'App\Admin\UserAdmin'
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.
public: false # Allows optimizing the container by removing unused services; this also means
# fetching services directly from the container via $container->get() won't work.
# The best practice is to be explicit about your dependencies anyway.
# 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,Listener,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
# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones
redirect.after.login:
class: App\Listener\AfterLoginRedirection
autowire: false
arguments: ['@router']
App\Controller\RegistrationController:
autowire: false
# Configuration de l'admin
admin.adherent.gerer:
class: App\Admin\AdherentAdmin
# arguments: [~, App\Entity\OBJECT, 'PixSortableBehaviorBundle:SortableAdmin']
arguments: [~, App\Entity\Adherent, ~]
tags:
- name: sonata.admin
manager_type: orm
group: "Adherent"
label: "Gérer"
# - group: "Contenu"
# - label: "Adhérents"
# - label_catalogue: "App"
public: true
admin.adherent.cotisations:
class: App\Admin\CotisationAdherentAdmin
arguments: [~, App\Entity\Cotisation, ~]
tags:
- name: sonata.admin
manager_type: orm
group: "Adherent"
label: "Cotisation"
public: true
admin.prestataire.gerer:
class: App\Admin\PrestataireAdmin
arguments: [~, App\Entity\Prestataire, ~]
tags:
- name: sonata.admin
manager_type: orm
group: "Prestataire"
label: "Gérer"
public: true
admin.prestataire.cotisations:
class: App\Admin\CotisationPrestataireAdmin
arguments: [~, App\Entity\Cotisation, ~]
tags:
- name: sonata.admin
manager_type: orm
group: "Prestataire"
label: "Cotisation"
public: true
admin.groupe.gerer:
class: App\Admin\GroupeAdmin
arguments: [~, App\Entity\Groupe, ~]
tags:
- name: sonata.admin
manager_type: orm
group: "Groupe"
label: "Gérer"
public: true
admin.groupepresta.gerer:
class: App\Admin\GroupeprestataireAdmin
arguments: [~, App\Entity\Groupeprestataire, ~]
tags:
- name: sonata.admin
manager_type: orm
group: "Amap / Marché"
label: "Gérer"
public: true
App\Entity\Siege:
siege:
name: 'Siege MLC'
content: 'MLC'
App\Entity\Groupe:
groupe{1..10}:
name: <text(10)>
content: <text(10)>
siege: '@siege'
App\Entity\Geoloc:
geoloc{1..70}:
adresse: <address()>
# cpostal: <postcode()>
ville: <city()>
lat: <randomFloat(6, 45, 46)>
lon: <randomFloat(6, 2, 5)>
enabled: true
App\Entity\Comptoir:
comptoir{1..50}:
name: <text(10)>
enabled: true
tel: '<phoneNumber()>'
email: <email()>
groupe: '@groupe*'
geoloc (unique): '@geoloc*'
App\Entity\Groupeprestataire:
amap{1..10}:
__construct: []
type: 'amap'
name: <text(10)>
horaires: "<dayOfWeek()> de <time('H')>h à <time('H')>h"
enabled: true
geoloc: '@geoloc*'
tel: '<phoneNumber()>'
email: <email()>
prestataires: '5x @prestataire*'
marche{1..10}:
__construct: []
type: 'marche'
name: <text(10)>
horaires: "<dayOfWeek()> de time('H')h à time('H')h"
enabled: true
geoloc: '@geoloc*'
tel: '<phoneNumber()>'
email: <email()>
prestataires: '5x @prestataire*'
App\Entity\TypePrestataire:
typepresta_prestataire:
name: 'Prestataire'
typepresta_partenaire:
name: 'Partenaire'
typepresta_amap:
name: 'Amap'
typepresta_marche:
name: 'Marché'
App\Entity\Usergroup:
usergroup_adherent:
__construct: ['Adherent', 'ROLE_ADHERENT']
usergroup_prestataire:
__construct: ['Prestataire', 'ROLE_PRESTATAIRE']
usergroup_adminsiege:
__construct: ['Administrateur du Siege', 'ROLE_ADMIN_SIEGE']
usergroup_redacteur:
__construct: ['Rédacteur', 'ROLE_REDACTEUR']
usergroup_tresorier:
__construct: ['Trésorier', 'ROLE_TRESORIER']
usergroup_gestiongroupe:
__construct: ['Gestionnaire de Groupe', 'ROLE_GESTION_GROUPE']
usergroup_comptoir:
__construct: ['Comptoir', 'ROLE_COMPTOIR']
usergroup_contact:
__construct: ['Contact', 'ROLE_CONTACT']
usergroup_admin:
__construct: ['Admin', 'ROLE_ADMIN']
usergroup_superadmin:
__construct: ['Super Admin', 'ROLE_SUPER_ADMIN']
App\Entity\User:
usersuperadmin:
username: 'adminuser'
email: 'julien.jorry@gmail.com'
plainPassword: 'Fyeevuio22'
enabled: true
groups: ['@usergroup_superadmin']
roles: ['ROLE_SUPER_ADMIN']
useradmin:
username: 'user_admin'
email: <email()>
plainPassword: 'test'
enabled: true
groups: ['@usergroup_admin']
roles: ['ROLE_ADMIN']
usercontact:
username: 'user_contact'
email: <email()>
plainPassword: 'test'
enabled: true
groups: ['@usergroup_contact']
roles: ['ROLE_CONTACT']
usercomptoir:
username: 'user_comptoir'
email: <email()>
plainPassword: 'test'
enabled: true
groups: ['@usergroup_comptoir']
roles: ['ROLE_COMPTOIR']
usergestiongroupe:
username: 'user_gestiongroupe'
email: <email()>
plainPassword: 'test'
enabled: true
groups: ['@usergroup_gestiongroupe']
roles: ['ROLE_GESTION_GROUPE']
usertresorier:
username: 'user_tresorier'
email: <email()>
plainPassword: 'test'
enabled: true
groups: ['@usergroup_tresorier']
roles: ['ROLE_TRESORIER']
userredacteur:
username: 'user_redacteur'
email: <email()>
plainPassword: 'test'
enabled: true
groups: ['@usergroup_redacteur']
roles: ['ROLE_REDACTEUR']
useradminsiege:
username: 'user_adminsiege'
email: <email()>
plainPassword: 'test'
enabled: true
groups: ['@usergroup_adminsiege']
roles: ['ROLE_ADMIN_SIEGE']
userprestataire:
username: 'user_prestataire'
email: <email()>
plainPassword: 'test'
enabled: true
groups: ['@usergroup_prestataire']
roles: ['ROLE_PRESTATAIRE']
useradherent:
username: 'user_adherent'
email: <email()>
plainPassword: 'test'
enabled: true
groups: ['@usergroup_adherent']
roles: ['ROLE_ADHERENT']
App\Entity\User:
user{1..15}:
username: <userName()>
email: <email()>
plainPassword: 'test'
enabled: true
groups: ['@usergroup_adherent']
App\Entity\Adherent:
adherent{1..15}:
ecompte: '0'
user: '@user<current()>'
App\Entity\User:
user{1..15}:
username: <userName()>
email: <email()>
plainPassword: 'test'
enabled: true
groups: ['@usergroup_prestataire']
App\Entity\Prestataire:
prestataire{1..15}:
raison: <text(10)>
metier: <text(10)>
iban: <text(10)>
statut: <text(10)>
siret: <text(10)>
user: '@user<current()>'
typeprestataire: '@typepresta_prestataire'
App\Entity\User:
user{1..15}:
username: <userName()>
email: <email()>
plainPassword: 'test'
enabled: true
groups: ['@usergroup_prestataire']
App\Entity\Prestataire:
prestataire{1..15}:
raison: <text(10)>
metier: <text(10)>
iban: <text(10)>
statut: <text(10)>
siret: <text(10)>
user: '@user<current()>'
typeprestataire: '@typepresta_partenaire'
{
"devDependencies": {
"@symfony/webpack-encore": "^0.21.0",
"node-sass": "^4.10.0",
"sass-loader": "^7.1.0",
"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"
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
>
<php>
<ini name="error_reporting" value="-1" />
</php>
<testsuites>
<testsuite name="Project Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>src</directory>
</whitelist>
</filter>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>
</phpunit>
<?php
use App\Kernel;
use Symfony\Component\Debug\Debug;
use Symfony\Component\HttpFoundation\Request;
require dirname(__DIR__).'/vendor/autoload.php';
Kernel::bootstrapEnv();
if ($_SERVER['APP_DEBUG']) {
umask(0000);
Debug::enable();
}
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
}
if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {
Request::setTrustedHosts(explode(',', $trustedHosts));
}
$kernel = new Kernel($_SERVER['APP_ENV'], $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
<?php
namespace App\Admin;
use App\Admin\UserAdmin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
class AdherentAdmin extends UserAdmin
{
public function configure()
{
parent::configure();
// $this->classnameLabel = "Utilisateurs";
}
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper): void
{
parent::configureFormFields($formMapper);
$user = $this->getSubject();
}
protected function configureListFields(ListMapper $listMapper): void
{
parent::configureListFields($listMapper);
}
}
<?php
namespace App\Admin;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;
class ComptoirAdmin extends AbstractAdmin
{
/**
* {@inheritdoc}
*/
protected function configureShowFields(ShowMapper $showMapper)
{
}
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper)
{
$comptoir = $this->getSubject();
}
/**
* {@inheritdoc}
*/
protected function configureListFields(ListMapper $listMapper)
{
}
}
<?php
namespace App\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;
class CotisationAdherentAdmin extends CotisationAdmin
{
/**
* {@inheritdoc}
*/
public function createQuery($context = 'list')
{
$query = parent::createQuery($context);
// $query->leftJoin($query->getRootAliases()[0] . '.user', 'u')
// ->andWhere(
// $query->expr()->eq($query->getRootAliases()[0] . '.my_field', ':my_param')
// );
// $query->setParameter('my_param', 'my_value');
return $query;
}
/**
* {@inheritdoc}
*/
protected function configureShowFields(ShowMapper $showMapper)
{
parent::configureShowFields($showMapper);
}
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper): void
{
parent::configureFormFields($formMapper);
$cotisation = $this->getSubject();
}
/**
* {@inheritdoc}
*/
protected function configureListFields(ListMapper $listMapper): void
{
parent::configureListFields($listMapper);
}
}
<?php
namespace App\Admin;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;
class CotisationAdmin extends AbstractAdmin
{
/**
* {@inheritdoc}
*/
protected function configureShowFields(ShowMapper $showMapper)
{
}
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper)
{
$cotisation = $this->getSubject();
}
/**
* {@inheritdoc}
*/
protected function configureListFields(ListMapper $listMapper)
{
}
}
<?php
namespace App\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;
class CotisationPrestataireAdmin extends CotisationAdmin
{
public function createQuery($context = 'list')
{
$query = parent::createQuery($context);
// $query->andWhere(
// $query->expr()->eq($query->getRootAliases()[0] . '.my_field', ':my_param')
// );
// $query->setParameter('my_param', 'my_value');
return $query;
}
/**
* {@inheritdoc}
*/
protected function configureShowFields(ShowMapper $showMapper)
{
parent::configureShowFields($showMapper);
}
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper): void
{
parent::configureFormFields($formMapper);
$cotisation = $this->getSubject();
}
/**
* {@inheritdoc}
*/
protected function configureListFields(ListMapper $listMapper): void
{
parent::configureListFields($listMapper);
}
}
<?php
namespace App\Admin;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;
class DocumentAdmin extends AbstractAdmin
{
/**
* {@inheritdoc}
*/
protected function configureShowFields(ShowMapper $showMapper)
{
}
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper)
{
$document = $this->getSubject();
}
/**
* {@inheritdoc}
*/
protected function configureListFields(ListMapper $listMapper)
{
}
}
<?php
namespace App\Admin;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;
class GroupeAdmin extends AbstractAdmin
{
/**
* {@inheritdoc}
*/
protected function configureShowFields(ShowMapper $showMapper)
{
}
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper)
{
$groupe = $this->getSubject();
$formMapper
->add('siege')
->add('comptoir')
;
}
/**
* {@inheritdoc}
*/
protected function configureListFields(ListMapper $listMapper)
{
}
}
<?php
namespace App\Admin;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;
class GroupeprestataireAdmin extends AbstractAdmin
{
protected $datagridValues = [
// reverse order (default = 'ASC')
'_sort_order' => 'DESC',
// name of the ordered field (default = the model's id field, if any)
'_sort_by' => 'updatedAt',
];
/**
* {@inheritdoc}
*/
protected function configureShowFields(ShowMapper $showMapper)
{
}
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper)
{
$comptoir = $this->getSubject();
}
/**
* {@inheritdoc}
*/
protected function configureListFields(ListMapper $listMapper)
{
}
}
<?php
namespace App\Admin;
use App\Admin\UserAdmin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
class PrestataireAdmin extends UserAdmin
{
public function configure()
{
parent::configure();
// $this->classnameLabel = "Utilisateurs";
}
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper): void
{
parent::configureFormFields($formMapper);
$user = $this->getSubject();
}
protected function configureListFields(ListMapper $listMapper): void
{
parent::configureListFields($listMapper);
}
}
<?php
namespace App\Admin;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Route\RouteCollection;
use Sonata\AdminBundle\Show\ShowMapper;
use Sonata\UserBundle\Admin\Model\UserAdmin as SonataUserAdmin;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
class UserAdmin extends SonataUserAdmin
{
protected $datagridValues = [
// reverse order (default = 'ASC')
'_sort_order' => 'DESC',
// name of the ordered field (default = the model's id field, if any)
'_sort_by' => 'updatedAt',
];
public function configure()
{
parent::configure();
// $this->classnameLabel = "Utilisateurs";
}
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper): void
{
parent::configureFormFields($formMapper);
$user = $this->getSubject();
}
/**
* {@inheritdoc}
*/
protected function configureListFields(ListMapper $listMapper): void
{
parent::configureListFields($listMapper);
// unset($this->listModes['mosaic']);
}
/**
* {@inheritdoc}
*/
// protected function configureDatagridFilters(DatagridMapper $datagridMapper)
// {
// $datagridMapper
// ->add('phone')
// ->add('email', null, [
// 'show_filter' => true
// ])
// ;
// }
/**
* {@inheritdoc}
*/
protected function configureRoutes(RouteCollection $collection)
{
// $collection->remove('create');
// if (!$this->isGranted('ROLE_SUPER_ADMIN')) {
// $collection->clearExcept([]);
// }
}
}
<?php
namespace App\Application\Sonata\UserBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
/**
* This file has been generated by the SonataEasyExtendsBundle.
*
* @link https://sonata-project.org/easy-extends
*
* References:
* @link http://symfony.com/doc/current/book/bundles.html
*/
class ApplicationSonataUserBundle extends Bundle
{
/**
* {@inheritdoc}
*/
public function getParent()
{
return 'SonataUserBundle';
}
}
\ No newline at end of file
<?php
namespace App\Application\Sonata\UserBundle\Document;
use Sonata\UserBundle\Document\BaseGroup as BaseGroup;
/**
* This file has been generated by the SonataEasyExtendsBundle.
*
* @link https://sonata-project.org/easy-extends
*
* References:
* @link http://www.doctrine-project.org/docs/mongodb_odm/1.0/en/reference/working-with-objects.html
*/
class Group extends BaseGroup
{
/**
* @var int $id
*/
protected $id;
/**
* Get id.
*
* @return int $id
*/
public function getId()
{
return $this->id;
}
}
\ No newline at end of file
<?php
namespace App\Application\Sonata\UserBundle\Document;
use Sonata\UserBundle\Document\BaseUser as BaseUser;
/**
* This file has been generated by the SonataEasyExtendsBundle.
*
* @link https://sonata-project.org/easy-extends
*
* References:
* @link http://www.doctrine-project.org/docs/mongodb_odm/1.0/en/reference/working-with-objects.html
*/
class User extends BaseUser
{
/**
* @var int $id
*/
protected $id;
/**
* Get id.
*
* @return int $id
*/
public function getId()
{
return $this->id;
}
}
\ No newline at end of file
<?php
namespace App\Application\Sonata\UserBundle\Entity;
use Sonata\UserBundle\Entity\BaseGroup as BaseGroup;
/**
* This file has been generated by the SonataEasyExtendsBundle.
*
* @link https://sonata-project.org/easy-extends
*
* References:
* @link http://www.doctrine-project.org/projects/orm/2.0/docs/reference/working-with-objects/en
*/
class Group extends BaseGroup
{
/**
* @var int $id
*/
protected $id;
/**
* Get id.
*
* @return int $id
*/
public function getId()
{
return $this->id;
}
}
<?php
namespace App\Application\Sonata\UserBundle\Entity;
use Sonata\UserBundle\Entity\BaseUser as BaseUser;
/**
* This file has been generated by the SonataEasyExtendsBundle.
*
* @link https://sonata-project.org/easy-extends
*
* References:
* @link http://www.doctrine-project.org/projects/orm/2.0/docs/reference/working-with-objects/en
*/
class User extends BaseUser
{
/**
* @var int $id
*/
protected $id;
/**
* Get id.
*
* @return int $id
*/
public function getId()
{
return $this->id;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mongo-mapping xmlns="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping
http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd">
<document name="App\Application\Sonata\UserBundle\Document\Group" collection="fos_user_group">
<field fieldName="id" id="true" strategy="INCREMENT" />
</document>
</doctrine-mongo-mapping>
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<entity name="App\Application\Sonata\UserBundle\Entity\Group" table="fos_user_group">
<id name="id" column="id" type="integer">
<generator strategy="AUTO" />
</id>
</entity>
</doctrine-mapping>
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mongo-mapping xmlns="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping
http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd">
<document name="App\Application\Sonata\UserBundle\Document\User" collection="fos_user_user" customId="true">
<field fieldName="id" id="true" strategy="INCREMENT" />
</document>
</doctrine-mongo-mapping>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<entity name="App\Application\Sonata\UserBundle\Entity\User" table="fos_user_user">
<id name="id" column="id" type="integer">
<generator strategy="AUTO" />
</id>
</entity>
</doctrine-mapping>
<?xml version="1.0" encoding="UTF-8"?>
<serializer>
<!-- This file has been generated by the SonataEasyExtendsBundle: https://sonata-project.org/bundles/easy-extends -->
<class name="App\Application\Sonata\UserBundle\Document\Group" exclusion-policy="all" xml-root-name="_group">
<property xml-attribute-map="true" name="id" type="integer" expose="true" since-version="1.0" groups="sonata_api_read,sonata_api_write,sonata_search"/>
</class>
</serializer>
<?xml version="1.0" encoding="UTF-8"?>
<serializer>
<!-- This file has been generated by the SonataEasyExtendsBundle: https://sonata-project.org/bundles/easy-extends -->
<class name="App\Application\Sonata\UserBundle\Document\User" exclusion-policy="all" xml-root-name="_user">
<property xml-attribute-map="true" name="id" type="integer" expose="true" since-version="1.0" groups="sonata_api_read,sonata_api_write,sonata_search"/>
</class>
</serializer>
<?xml version="1.0" encoding="UTF-8"?>
<serializer>
<!-- This file has been generated by the SonataEasyExtendsBundle: https://sonata-project.org/bundles/easy-extends -->
<class name="App\Application\Sonata\UserBundle\Entity\Group" exclusion-policy="all" xml-root-name="_group">
<property xml-attribute-map="true" name="id" type="integer" expose="true" since-version="1.0" groups="sonata_api_read,sonata_api_write,sonata_search"/>
</class>
</serializer>
<?xml version="1.0" encoding="UTF-8"?>
<serializer>
<!-- This file has been generated by the SonataEasyExtendsBundle: https://sonata-project.org/bundles/easy-extends -->
<class name="App\Application\Sonata\UserBundle\Entity\User" exclusion-policy="all" xml-root-name="_user">
<property xml-attribute-map="true" name="id" type="integer" expose="true" since-version="1.0" groups="sonata_api_read,sonata_api_write,sonata_search"/>
</class>
</serializer>
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
/** @Route("/admina", name="admina_") */
class AdminController extends AbstractController
{
/**
* Voir tous les dashboards
* Route admin_index
* @Route("/", name="settings")
*/
public function settings()
{
return $this->render('admin/settings.html.twig', [
'controller_name' => 'AdminController',
]);
}
}
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
class IndexController extends AbstractController
{
/**
* @Route("/index", name="index")
*/
// public function index(TranslatorInterface $translator)
public function index()
{
// Exemple pour la traduction :
// $translated = $translator->trans('Symfony is great');
// $translator->transChoice(
// 'Hurry up %name%! There is one apple left.|There are %count% apples left.',
// 10,
// // no need to include %count% here; Symfony does that for you
// array('%name%' => $user->getName())
// );
return $this->render('index/index.html.twig', [
'controller_name' => 'IndexController',
]);
}
}
<?php
namespace App\Controller;
use FOS\UserBundle\Controller\RegistrationController as BaseController;
use FOS\UserBundle\Event\FilterUserResponseEvent;
use FOS\UserBundle\Event\FormEvent;
use FOS\UserBundle\Event\GetResponseUserEvent;
use FOS\UserBundle\FOSUserEvents;
use FOS\UserBundle\Form\Factory\FactoryInterface;
use FOS\UserBundle\Model\UserManagerInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
class RegistrationController extends BaseController
{
/**
* @param Request $request
*
* @return Response
*/
public function registerAction(Request $request)
{
$user = $this->userManager->createUser();
$user->setEnabled(true);
$event = new GetResponseUserEvent($user, $request);
$this->eventDispatcher->dispatch(FOSUserEvents::REGISTRATION_INITIALIZE, $event);
if (null !== $event->getResponse()) {
return $event->getResponse();
}
$form = $this->formFactory->createForm();
$form->setData($user);
$form->handleRequest($request);
if ($form->isSubmitted()) {
if ($form->isValid()) {
$event = new FormEvent($form, $request);
$this->eventDispatcher->dispatch(FOSUserEvents::REGISTRATION_SUCCESS, $event);
$this->userManager->updateUser($user);
if (null === $response = $event->getResponse()) {
$url = $this->generateUrl('fos_user_registration_confirmed');
$response = new RedirectResponse($url);
}
$this->eventDispatcher->dispatch(FOSUserEvents::REGISTRATION_COMPLETED, new FilterUserResponseEvent($user, $request, $response));
return $response;
}
$event = new FormEvent($form, $request);
$this->eventDispatcher->dispatch(FOSUserEvents::REGISTRATION_FAILURE, $event);
if (null !== $response = $event->getResponse()) {
return $response;
}
}
return $this->render('@FOSUser/Registration/register.html.twig', array(
'form' => $form->createView(),
));
}
}
<?php
namespace App\DQL
;
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
class StrToDate extends FunctionNode
{
public $dateString = null;
public $dateFormat = null;
public function parse(\Doctrine\ORM\Query\Parser $parser)
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$this->dateString = $parser->ArithmeticPrimary();
$parser->match(Lexer::T_COMMA);
$this->dateFormat = $parser->ArithmeticPrimary();
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
}
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
{
return 'STR_TO_DATE(' .
$this->dateString->dispatch($sqlWalker) . ', ' .
$this->dateFormat->dispatch($sqlWalker) .
')';
}
}
<?php
namespace App\DataFixtures;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\Persistence\ObjectManager;
class AppFixtures extends Fixture
{
public function load(ObjectManager $manager)
{
// $manager->flush();
}
}
<?php
namespace AppBundle\DataFixtures\ORM;
use Hautelook\AliceBundle\Alice\DataFixtureLoader;
use Nelmio\Alice\Fixtures;
class AppFixtures extends DataFixtureLoader
{
/**
* {@inheritDoc}
*/
protected function getFixtures()
{
return array(
__DIR__ . '/user.yaml',
);
}
}
App\Entity\User:
user{1..30}:
username: <userName()>
email: <email()>
plainPassword: 'test'
enabled: true
App\Entity\Prestataire:
prestataire{1..5}:
raison: <text(10)>
metier: <text(10)>
iban: <randomNumber(20)>
statut: <text(10)>
siret: <randomNumber(10)>
user: '@user<current()>'
typeprestataire: 'prestataire'
App\Entity\Prestataire:
prestataire{1..5}:
raison: <text(10)>
metier: <text(10)>
iban: <randomNumber(20)>
statut: <text(10)>
siret: <randomNumber(10)>
user: '@user<current()>'
typeprestataire: 'partenaire'
App\Entity\Comptoir:
comptoir{1..15}:
name: <text(10)>
user: '@user<current()>'
App\Entity\Groupe:
groupe{1..3}:
__construct: [<text(10)>]
users: '10x @user*'
gestionnaires: '2x @user*'
redacteurs: '2x @user*'
tresoriers: '1x @user*'
contacts: '2x @user*'
prestataires: '5x @prestataire*'
comptoirs: '5x @comptoir*'
\ No newline at end of file
<?php
namespace App\Entity;
use App\Entity\User;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\AdherentRepository")
*/
class Adherent
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="decimal", precision=7, scale=2)
*/
private $ecompte;
/**
* @var User
*
* @ORM\OneToOne(targetEntity="User", cascade={"persist"}, inversedBy="adherent")
*/
protected $user;
public function getId(): ?int
{
return $this->id;
}
public function getEcompte()
{
return $this->ecompte;
}
public function setEcompte($ecompte): self
{
$this->ecompte = $ecompte;
return $this;
}
/**
* @return User
*/
public function getUser(): User
{
return $this->user;
}
/**
* @param User $user
* @return Prestataire
*/
public function setUser(User $user): self
{
$this->user = $user;
return $this;
}
}
<?php
namespace App\Entity;
use App\Entity\EntityTrait\NameSlugContentEntityTrait;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\HasLifecycleCallbacks()
* @ORM\Table(name="charte")
*/
class Charte
{
use NameSlugContentEntityTrait;
const UPLOAD_DIR = "charte";
/**
* @var int
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue
*/
protected $id;
/**
* @var null|Image
*
* @Assert\Valid()
* @ORM\OneToOne(targetEntity="Image", cascade={"all"}, orphanRemoval=true, fetch="EAGER")
*/
private $image;
/**
* @var null|Fichier
*
* @Assert\Valid()
* @ORM\OneToOne(targetEntity="Fichier", cascade={"all"}, orphanRemoval=true, fetch="EAGER")
*/
protected $fichier;
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @return Image|null
*/
public function getImage(): ?Image
{
return $this->image;
}
/**
* @param Image|null $image
* @return Charte
*/
public function setImage(?Image $image)
{
$image->setType(self::UPLOAD_DIR);
$this->image = $image;
return $this;
}
/**
* @return Fichier|null
*/
public function getFichier(): ?Fichier
{
return $this->fichier;
}
/**
* @param Fichier|null $fichier
* @return Charte
*/
public function setFichier(?Fichier $fichier)
{
$fichier->setType(self::UPLOAD_DIR);
$this->fichier = $fichier;
return $this;
}
}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment