From: Raphaël Gertz Date: Tue, 26 Nov 2019 23:26:17 +0000 (+0100) Subject: Add packages and routes default config X-Git-Tag: 0.1.1~78 X-Git-Url: https://git.rapsys.eu/airbundle/commitdiff_plain/85bf92905e55268c73ab7912c4ee137e0c2ef707?ds=inline Add packages and routes default config --- diff --git a/Resources/config/packages/rapsys_air.yaml b/Resources/config/packages/rapsys_air.yaml new file mode 100644 index 0000000..9b0ada5 --- /dev/null +++ b/Resources/config/packages/rapsys_air.yaml @@ -0,0 +1,245 @@ +#RapsysAir configuration +rapsys_air: + #Contact + contact: + name: 'Raphaël Gertz' + mail: 'airlibre@rapsys.eu' + #Copyright + copy: + long: 'Raphaël Gertz all rights reserved' + short: 'Copyright 2019' + +#RapsysUser configuration +rapsys_user: + #Class replacement + class: + group: 'Rapsys\AirBundle\Entity\Group' + title: 'Rapsys\AirBundle\Entity\Title' + user: 'Rapsys\AirBundle\Entity\User' + #Route replacement + route: + index: + name: 'rapsys_air_index' + #Contact replacement + contact: + name: '%rapsys_air.contact.name%' + mail: '%rapsys_air.contact.mail%' + #Login replacement + login: + route: + index: 'site_url' + view: + name: '@RapsysAir/form/login.html.twig' + context: + title: 'Login' + copy_long: '%rapsys_air.copy.long%' + copy_short: '%rapsys_air.copy.short%' + site_ico: '%rapsys_air.site.ico%' + site_logo: '%rapsys_air.site.logo%' + site_png: '%rapsys_air.site.png%' + site_svg: '%rapsys_air.site.svg%' + site_title: '%rapsys_air.site.title%' + #Recover replacement + recover: + route: + index: 'site_url' + recover_mail: 'recover_url' + view: + name: '@RapsysAir/form/recover.html.twig' + context: + title: 'Recover' + copy_long: '%rapsys_air.copy.long%' + copy_short: '%rapsys_air.copy.short%' + site_ico: '%rapsys_air.site.ico%' + site_logo: '%rapsys_air.site.logo%' + site_png: '%rapsys_air.site.png%' + site_svg: '%rapsys_air.site.svg%' + site_title: '%rapsys_air.site.title%' + mail: + subject: '%%recipient_name%% welcome back to %%site_title%%' + html: '@RapsysAir/mail/recover.html.twig' + text: '@RapsysAir/mail/recover.text.twig' + context: + #Mail recover replacement + recover_mail: + route: + index: 'site_url' + recover_mail: 'recover_url' + view: + name: '@RapsysAir/form/recover_mail.html.twig' + context: + title: 'Mail recover' + copy_long: '%rapsys_air.copy.long%' + copy_short: '%rapsys_air.copy.short%' + site_ico: '%rapsys_air.site.ico%' + site_logo: '%rapsys_air.site.logo%' + site_png: '%rapsys_air.site.png%' + site_svg: '%rapsys_air.site.svg%' + site_title: '%rapsys_air.site.title%' + mail: + subject: '%%recipient_name%% welcome back to %%site_title%%' + html: '@RapsysAir/mail/recover_mail.html.twig' + text: '@RapsysAir/mail/recover_mail.text.twig' + context: + #Register replacement + register: + route: + index: 'site_url' + view: + form: 'Rapsys\AirBundle\Form\RegisterType' + name: '@RapsysAir/form/register.html.twig' + context: + title: 'Register' + copy_long: '%rapsys_air.copy.long%' + copy_short: '%rapsys_air.copy.short%' + site_ico: '%rapsys_air.site.ico%' + site_logo: '%rapsys_air.site.logo%' + site_png: '%rapsys_air.site.png%' + site_svg: '%rapsys_air.site.svg%' + site_title: '%rapsys_air.site.title%' + mail: + subject: '%%recipient_name%% welcome to %%site_title%%' + html: '@RapsysAir/mail/register.html.twig' + text: '@RapsysAir/mail/register.text.twig' + context: + +#Doctrine configuration +doctrine: + #Orm configuration + orm: + #Force resolution of UserBundle entities to AirBundle one + #XXX: without these lines, relations are lookup in parent namespace ignoring AirBundle extension + resolve_target_entities: + Rapsys\UserBundle\Entity\Group: Rapsys\AirBundle\Entity\Group + Rapsys\UserBundle\Entity\Title: Rapsys\AirBundle\Entity\Title + Rapsys\UserBundle\Entity\User: Rapsys\AirBundle\Entity\User + +#Security configuration +security: + #Set encoders + encoders: + Rapsys\AirBundle\Entity\User: plaintext + #Rapsys\AirBundle\Entity\User: + # algorithm: 'bcrypt' + + #Set providers + providers: + database: + entity: + class: Rapsys\AirBundle\Entity\User + property: mail + + #Set firewall + firewalls: + #Disables authentication for assets and the profiler, adapt it according to your needs + dev: + pattern: ^/(_(profiler|wdt)|css|images|js)/ + security: false + + main: + #Allow anonymous access + anonymous: ~ + + #Disable logout on user change + logout_on_user_change: true + + #Activate database provider + provider: database + + #XXX: https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate + #http_basic: ~ + + #Set form login + #XXX: https://symfony.com/doc/current/security/form_login_setup.html + form_login: + use_referer: false + login_path: rapsys_user_login + check_path: rapsys_user_login + username_parameter: 'login[mail]' + password_parameter: 'login[password]' + + #Set logout route + logout: + path: /logout + target: / + + #Set custom access denied handler + access_denied_handler: Rapsys\AirBundle\Security\AccessDeniedHandler + + #Set role hierarchy + role_hierarchy: + ROLE_GUEST: [ 'ROLE_USER' ] + ROLE_REGULAR: [ 'ROLE_USER', 'ROLE_GUEST' ] + ROLE_SENIOR: [ 'ROLE_USER', 'ROLE_GUEST', 'ROLE_REGULAR' ] + ROLE_ADMIN: [ 'ROLE_USER', 'ROLE_GUEST', 'ROLE_REGULAR', 'ROLE_SENIOR' ] + +##Framework configuration +#XXX: don't use that shit, it breaks assets._default_package url generation +#framework: +# #Assets configuration +# assets: +# #Set default base path +# #base_path: '/bundles/%%s' +# #Set default version +# version: 'x' +# #Set default format +# version_format: '%%s?v=%%s' +# +# packages: +# pack_package: +# base_path: '/bundles/%%s' + +#Service configuration +services: + #Register twig file_get_contents extension + #XXX: obsolete by email.image twig filter in "twig/extensions" or "twig/html-extra" + rapsys_air.twig.file_get_contents: + class: 'Rapsys\AirBundle\Twig\FileGetContentsExtension' + tags: [ 'twig.extension' ] + #Register twig base64 extension + rapsys_air.twig.base64: + class: 'Rapsys\AirBundle\Twig\Base64Extension' + tags: [ 'twig.extension' ] + #Register twig bb2html extension + rapsys_air.twig.bb2html: + class: 'Rapsys\AirBundle\Twig\Bb2htmlExtension' + tags: [ 'twig.extension' ] + #Register default controller + Rapsys\AirBundle\Controller\DefaultController: + arguments: [ '@service_container', '@translator', '@router' ] + tags: [ 'controller.service_arguments' ] + #Register location controller + Rapsys\AirBundle\Controller\LocationController: + arguments: [ '@service_container', '@translator', '@router' ] + tags: [ 'controller.service_arguments' ] + #Register access denied handler + Rapsys\AirBundle\Security\AccessDeniedHandler: + arguments: [ '@service_container', '@translator', '@twig' ] + #Register air fixtures + Rapsys\AirBundle\DataFixtures\AirFixtures: + tags: [ 'doctrine.fixture.orm' ] + #Replace default package + #XXX: set base path to /bundles/ and disable versioning + assets._default_package: + class: 'Rapsys\PackBundle\Asset\PathPackage' + arguments: [ '/bundles/%%s', '@assets.empty_version_strategy', '@assets.context' ] +# arguments: [ '/', '@assets.static_version_strategy', '@assets.context' ] +# #Set version strategy +# assets.static_version_strategy: +# class: Symfony\Component\Asset\VersionStrategy\StaticVersionStrategy +# arguments: [ 'x', '%%s?v=%%s' ] + +#Twig Configuration +twig: +# #Enforce debug +# debug: true +# auto_reload: ~ +# cache: false + #Fix form layout for css + #XXX: @RapsysAir is a shortcut to vendor/rapsys/airbundle/Resources/views directory here + form_theme: [ '@RapsysAir/form/form_div_layout.html.twig' ] + #Set twig paths + paths: + #Required by email.image(site_logo) directive + #XXX: Allow twig to resolve @RapsysAir/png/logo.png in vendor/rapsys/airbundle/Resources/public/png/logo.png + '%kernel.project_dir%/vendor/rapsys/airbundle/Resources/public': 'RapsysAir' diff --git a/Resources/config/routes/rapsys_air.yaml b/Resources/config/routes/rapsys_air.yaml new file mode 100644 index 0000000..518cc02 --- /dev/null +++ b/Resources/config/routes/rapsys_air.yaml @@ -0,0 +1,34 @@ +rapsys_air_index: + path: / + controller: Rapsys\AirBundle\Controller\DefaultController::index + methods: GET + +rapsys_air_contact: + path: /contact + controller: Rapsys\AirBundle\Controller\DefaultController::contact + methods: GET|POST + +rapsys_air_policy: + path: /policy + controller: Rapsys\AirBundle\Controller\DefaultController::policy + methods: GET + +rapsys_air_location: + path: /locations + controller: Rapsys\AirBundle\Controller\LocationController::index + methods: GET + +rapsys_air_location_show: + path: /location/{id<\d+>} + controller: Rapsys\AirBundle\Controller\LocationController::show + methods: GET + +rapsys_air_user: + path: /users + controller: Rapsys\AirBundle\Controller\UserController::index + methods: GET + +rapsys_air_user_show: + path: /user/{id<\d+>} + controller: Rapsys\AirBundle\Controller\UserController::show + methods: GET