Parcourir la source

Création du projet CaracoleSkeleton

master
Fab il y a 3 ans
révision
71cb1ac4c6
69 fichiers modifiés avec 10960 ajouts et 0 suppressions
  1. +32
    -0
      .env
  2. +29
    -0
      .gitignore
  3. +43
    -0
      bin/console
  4. +13
    -0
      bin/phpunit
  5. +104
    -0
      composer.json
  6. +9079
    -0
      composer.lock
  7. +21
    -0
      config/bundles.php
  8. +5
    -0
      config/packages/artgris_file_manager.yaml
  9. +19
    -0
      config/packages/cache.yaml
  10. +4
    -0
      config/packages/dev/debug.yaml
  11. +19
    -0
      config/packages/dev/monolog.yaml
  12. +6
    -0
      config/packages/dev/web_profiler.yaml
  13. +18
    -0
      config/packages/doctrine.yaml
  14. +6
    -0
      config/packages/doctrine_migrations.yaml
  15. +24
    -0
      config/packages/fos_ckeditor.yaml
  16. +17
    -0
      config/packages/framework.yaml
  17. +2
    -0
      config/packages/liip_imagine.yaml
  18. +18
    -0
      config/packages/liip_imagine/base.yaml
  19. +15
    -0
      config/packages/liip_imagine/specific.yaml
  20. +3
    -0
      config/packages/mailer.yaml
  21. +16
    -0
      config/packages/notifier.yaml
  22. +8
    -0
      config/packages/prod/deprecations.yaml
  23. +20
    -0
      config/packages/prod/doctrine.yaml
  24. +17
    -0
      config/packages/prod/monolog.yaml
  25. +3
    -0
      config/packages/prod/routing.yaml
  26. +7
    -0
      config/packages/routing.yaml
  27. +40
    -0
      config/packages/security.yaml
  28. +3
    -0
      config/packages/sensio_framework_extra.yaml
  29. +13
    -0
      config/packages/stof_doctrine_extensions.yaml
  30. +4
    -0
      config/packages/test/doctrine.yaml
  31. +4
    -0
      config/packages/test/framework.yaml
  32. +12
    -0
      config/packages/test/monolog.yaml
  33. +2
    -0
      config/packages/test/twig.yaml
  34. +3
    -0
      config/packages/test/validator.yaml
  35. +6
    -0
      config/packages/test/web_profiler.yaml
  36. +6
    -0
      config/packages/translation.yaml
  37. +4
    -0
      config/packages/twig.yaml
  38. +8
    -0
      config/packages/validator.yaml
  39. +5
    -0
      config/preload.php
  40. +23
    -0
      config/routes.yaml
  41. +7
    -0
      config/routes/annotations.yaml
  42. +3
    -0
      config/routes/dev/framework.yaml
  43. +7
    -0
      config/routes/dev/web_profiler.yaml
  44. +2
    -0
      config/routes/liip_imagine.yaml
  45. +47
    -0
      config/services.yaml
  46. +0
    -0
      migrations/.gitignore
  47. +53
    -0
      migrations/Version20210510094442.php
  48. +40
    -0
      phpunit.xml.dist
  49. +22
    -0
      public/index.php
  50. +0
    -0
      src/Controller/.gitignore
  51. +13
    -0
      src/Controller/Admin/DashboardController.php
  52. +38
    -0
      src/Controller/Admin/PageCrudController.php
  53. +43
    -0
      src/Controller/IndexController.php
  54. +0
    -0
      src/Entity/.gitignore
  55. +33
    -0
      src/Entity/File.php
  56. +90
    -0
      src/Entity/Page.php
  57. +28
    -0
      src/Entity/User.php
  58. +38
    -0
      src/Kernel.php
  59. +0
    -0
      src/Repository/.gitignore
  60. +21
    -0
      src/Repository/PageRepository.php
  61. +60
    -0
      src/Twig/TwigExtension.php
  62. +591
    -0
      symfony.lock
  63. +56
    -0
      templates/base.html.twig
  64. +17
    -0
      templates/block/nav.html.twig
  65. +6
    -0
      templates/page/index.html.twig
  66. +11
    -0
      templates/page/page.html.twig
  67. +42
    -0
      templates/security/login.html.twig
  68. +11
    -0
      tests/bootstrap.php
  69. +0
    -0
      translations/.gitignore

+ 32
- 0
.env Voir le fichier

@@ -0,0 +1,32 @@
# In all environments, the following files are loaded if they exist,
# the latter taking precedence over the former:
#
# * .env contains default values for the environment variables needed by the app
# * .env.local uncommitted file with local overrides
# * .env.$APP_ENV committed environment-specific defaults
# * .env.$APP_ENV.local uncommitted environment-specific overrides
#
# Real environment variables win over .env files.
#
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
#
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=730296c1ebb1c7bc2a3ba2eeaadb0f6e
###< symfony/framework-bundle ###

###> symfony/mailer ###
MAILER_DSN=smtp://localhost
###< symfony/mailer ###

###> doctrine/doctrine-bundle ###
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
#
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
# DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7"
DATABASE_URL="postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=13&charset=utf8"
###< doctrine/doctrine-bundle ###

+ 29
- 0
.gitignore Voir le fichier

@@ -0,0 +1,29 @@

###> symfony/framework-bundle ###
/.php-version
/.env.local
/.env.local.php
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/public/uploads/
/public/userfiles/*
/public/robots.txt
/public/assets/.sass-cache/
/public/media/cache/
/var/
/vendor/
###< symfony/framework-bundle ###

###> symfony/phpunit-bridge ###
.phpunit
.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###

/Lc/*
/.idea/*

###> liip/imagine-bundle ###
/public/media/cache/
###< liip/imagine-bundle ###

+ 43
- 0
bin/console Voir le fichier

@@ -0,0 +1,43 @@
#!/usr/bin/env php
<?php

use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Dotenv\Dotenv;
use Symfony\Component\ErrorHandler\Debug;

if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.PHP_SAPI.' SAPI'.PHP_EOL;
}

set_time_limit(0);

require dirname(__DIR__).'/vendor/autoload.php';

if (!class_exists(Application::class) || !class_exists(Dotenv::class)) {
throw new LogicException('You need to add "symfony/framework-bundle" and "symfony/dotenv" as Composer dependencies.');
}

$input = new ArgvInput();
if (null !== $env = $input->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');
}

(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');

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);

+ 13
- 0
bin/phpunit Voir le fichier

@@ -0,0 +1,13 @@
#!/usr/bin/env php
<?php

if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
exit(1);
}

if (false === getenv('SYMFONY_PHPUNIT_DIR')) {
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
}

require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';

+ 104
- 0
composer.json Voir le fichier

@@ -0,0 +1,104 @@
{
"type": "project",
"license": "proprietary",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=7.2.5",
"ext-ctype": "*",
"ext-iconv": "*",
"artgris/filemanager-bundle": "^2.2",
"composer/package-versions-deprecated": "1.11.99.1",
"doctrine/annotations": "^1.0",
"doctrine/doctrine-bundle": "^2.3",
"doctrine/doctrine-migrations-bundle": "^3.1",
"doctrine/orm": "^2.8",
"easycorp/easyadmin-bundle": "^3.3",
"friendsofsymfony/ckeditor-bundle": "^2.3",
"liip/imagine-bundle": "^2.6",
"phpdocumentor/reflection-docblock": "^5.2",
"sensio/framework-extra-bundle": "^5.1",
"stof/doctrine-extensions-bundle": "^1.6",
"symfony/asset": "5.2.*",
"symfony/console": "5.2.*",
"symfony/dotenv": "5.2.*",
"symfony/expression-language": "5.2.*",
"symfony/flex": "^1.3.1",
"symfony/form": "5.2.*",
"symfony/framework-bundle": "5.2.*",
"symfony/http-client": "5.2.*",
"symfony/intl": "5.2.*",
"symfony/mailer": "5.2.*",
"symfony/mime": "5.2.*",
"symfony/monolog-bundle": "^3.1",
"symfony/notifier": "5.2.*",
"symfony/process": "5.2.*",
"symfony/property-access": "5.2.*",
"symfony/property-info": "5.2.*",
"symfony/proxy-manager-bridge": "5.2.*",
"symfony/security-bundle": "5.2.*",
"symfony/serializer": "5.2.*",
"symfony/string": "5.2.*",
"symfony/translation": "5.2.*",
"symfony/twig-bundle": "^5.2",
"symfony/validator": "5.2.*",
"symfony/web-link": "5.2.*",
"symfony/yaml": "5.2.*",
"twig/extra-bundle": "^2.12|^3.0",
"twig/twig": "^2.12|^3.0"
},
"require-dev": {
"symfony/browser-kit": "^5.2",
"symfony/css-selector": "^5.2",
"symfony/debug-bundle": "^5.2",
"symfony/maker-bundle": "^1.0",
"symfony/phpunit-bridge": "^5.2",
"symfony/stopwatch": "^5.2",
"symfony/var-dumper": "^5.2",
"symfony/web-profiler-bundle": "^5.2"
},
"config": {
"optimize-autoloader": true,
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/",
"Lc\\": "Lc/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php72": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "5.2.*"
}
}
}

+ 9079
- 0
composer.lock
Fichier diff supprimé car celui-ci est trop grand
Voir le fichier


+ 21
- 0
config/bundles.php Voir le fichier

@@ -0,0 +1,21 @@
<?php

return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['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],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
Lc\SovBundle\SovBundle::class => ['all' => true],
Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true],
Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true],
Artgris\Bundle\FileManagerBundle\ArtgrisFileManagerBundle::class => ['all' => true],
EasyCorp\Bundle\EasyAdminBundle\EasyAdminBundle::class => ['all' => true],
];

+ 5
- 0
config/packages/artgris_file_manager.yaml Voir le fichier

@@ -0,0 +1,5 @@
artgris_file_manager:
conf:
default:
dir: "../public%app.path_uploads%"
type: 'image'

+ 19
- 0
config/packages/cache.yaml Voir le fichier

@@ -0,0 +1,19 @@
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

+ 4
- 0
config/packages/dev/debug.yaml Voir le fichier

@@ -0,0 +1,4 @@
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)%"

+ 19
- 0
config/packages/dev/monolog.yaml Voir le fichier

@@ -0,0 +1,19 @@
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"]

+ 6
- 0
config/packages/dev/web_profiler.yaml Voir le fichier

@@ -0,0 +1,6 @@
web_profiler:
toolbar: true
intercept_redirects: false

framework:
profiler: { only_exceptions: false }

+ 18
- 0
config/packages/doctrine.yaml Voir le fichier

@@ -0,0 +1,18 @@
doctrine:
dbal:
# IMPORTANT: DATABASE_URL *must* define the server version
url: '%env(resolve:DATABASE_URL)%'
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
resolve_target_entities:
Lc\SovBundle\IModel\User\UserInterface: App\Entity\User
Lc\SovBundle\IModel\Cms\FileInterface: App\Entity\File

+ 6
- 0
config/packages/doctrine_migrations.yaml Voir le fichier

@@ -0,0 +1,6 @@
doctrine_migrations:
migrations_paths:
# namespace is arbitrary but should be different from App\Migrations
# as migrations classes should NOT be autoloaded
'DoctrineMigrations': '%kernel.project_dir%/migrations'
enable_profiler: '%kernel.debug%'

+ 24
- 0
config/packages/fos_ckeditor.yaml Voir le fichier

@@ -0,0 +1,24 @@
# Read the documentation: https://symfony.com/doc/current/bundles/FOSCKEditorBundle/index.html

fos_ck_editor:
input_sync: true
default_config: base_config
configs:
base_config:
filebrowserBrowseRoute: file_manager
filebrowserBrowseRouteParameters:
conf: default
module: ckeditor
format_tags: 'p;h2;h3'
toolbar:
- { name: "styles", items: ['Bold', 'Italic','Underline', 'Strike']}
- { name: "paragraph", items: ['Format', 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote'] }
- { name: "link", items: [ 'Link', 'Unlink'] }
- {name: 'insert', items: [ 'Image' ]}
- {name: 'document', items: [ 'Source' ]}
simple_config:
toolbar:
- { items: ['Bold', 'Italic', 'Underline', 'Colors', 'Source'] }
twig:
form_themes:
- '@FOSCKEditor/Form/ckeditor_widget.html.twig'

+ 17
- 0
config/packages/framework.yaml Voir le fichier

@@ -0,0 +1,17 @@
# see https://symfony.com/doc/current/reference/configuration/framework.html
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: null
cookie_secure: auto
cookie_samesite: lax

#esi: true
#fragments: true
php_errors:
log: true

+ 2
- 0
config/packages/liip_imagine.yaml Voir le fichier

@@ -0,0 +1,2 @@
imports:
- { resource: liip_imagine/ }

+ 18
- 0
config/packages/liip_imagine/base.yaml Voir le fichier

@@ -0,0 +1,18 @@
# See dos how to configure the bundle: https://symfony.com/doc/current/bundles/LiipImagineBundle/basic-usage.html
liip_imagine:
# valid drivers options include "gd" or "gmagick" or "imagick"
driver: "gd"
filter_sets:
cache: ~
page:
quality: 90
filters:
thumbnail:
size: [ 240 ]
mode: outbound
mosaic_big:
quality: 90
filters:
thumbnail:
size: [ 600, 400 ]
mode: outbound

+ 15
- 0
config/packages/liip_imagine/specific.yaml Voir le fichier

@@ -0,0 +1,15 @@
liip_imagine:
resolvers:
default:
web_path:
web_root: "%kernel.project_dir%/public"
cache_prefix: "media/cache"
# config sur le serveur d'Alwaysdata chargée lors du déploiement
#web_root: '/home/placedulocal/www/symfony/prod/shared/public/'

loaders:
default:
filesystem:
data_root: "%kernel.project_dir%/public/"
# config sur le serveur d'Alwaysdata chargée lors du déploiement
#data_root: '/home/placedulocal/www/symfony/prod/shared/public/'

+ 3
- 0
config/packages/mailer.yaml Voir le fichier

@@ -0,0 +1,3 @@
framework:
mailer:
dsn: '%env(MAILER_DSN)%'

+ 16
- 0
config/packages/notifier.yaml Voir le fichier

@@ -0,0 +1,16 @@
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: admin@example.com }

+ 8
- 0
config/packages/prod/deprecations.yaml Voir le fichier

@@ -0,0 +1,8 @@
# As of Symfony 5.1, deprecations are logged in the dedicated "deprecation" channel when it exists
#monolog:
# channels: [deprecation]
# handlers:
# deprecation:
# type: stream
# channels: [deprecation]
# path: php://stderr

+ 20
- 0
config/packages/prod/doctrine.yaml Voir le fichier

@@ -0,0 +1,20 @@
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

+ 17
- 0
config/packages/prod/monolog.yaml Voir le fichier

@@ -0,0 +1,17 @@
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
excluded_http_codes: [404, 405]
buffer_size: 50 # How many messages should be saved? Prevent memory leaks
nested:
type: stream
path: php://stderr
level: debug
formatter: monolog.formatter.json
console:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine"]

+ 3
- 0
config/packages/prod/routing.yaml Voir le fichier

@@ -0,0 +1,3 @@
framework:
router:
strict_requirements: null

+ 7
- 0
config/packages/routing.yaml Voir le fichier

@@ -0,0 +1,7 @@
framework:
router:
utf8: true

# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
#default_uri: http://localhost

+ 40
- 0
config/packages/security.yaml Voir le fichier

@@ -0,0 +1,40 @@
security:
encoders:
App\Entity\User:
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\User
property: email
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
anonymous: true
lazy: true
provider: app_user_provider
guard:
authenticators:
- Lc\SovBundle\Authenticator\LoginFormAuthenticator
logout:
path: 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: ^/manager, roles: [ROLE_ADMIN, ROLE_SUPER_ADMIN] }
- { path: ^/admin, roles: [ROLE_ADMIN, ROLE_SUPER_ADMIN] }
- { path: ^/profile, roles: ROLE_USER }

+ 3
- 0
config/packages/sensio_framework_extra.yaml Voir le fichier

@@ -0,0 +1,3 @@
sensio_framework_extra:
router:
annotations: false

+ 13
- 0
config/packages/stof_doctrine_extensions.yaml Voir le fichier

@@ -0,0 +1,13 @@
# 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: '%app.default_locale%'
translation_fallback: true
orm:
default:
tree: true
timestampable: true # not needed: listeners are not enabled by default
sluggable: true
blameable: true
translatable: false


+ 4
- 0
config/packages/test/doctrine.yaml Voir le fichier

@@ -0,0 +1,4 @@
doctrine:
dbal:
# "TEST_TOKEN" is typically set by ParaTest
dbname: 'main_test%env(default::TEST_TOKEN)%'

+ 4
- 0
config/packages/test/framework.yaml Voir le fichier

@@ -0,0 +1,4 @@
framework:
test: true
session:
storage_id: session.storage.mock_file

+ 12
- 0
config/packages/test/monolog.yaml Voir le fichier

@@ -0,0 +1,12 @@
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
excluded_http_codes: [404, 405]
channels: ["!event"]
nested:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug

+ 2
- 0
config/packages/test/twig.yaml Voir le fichier

@@ -0,0 +1,2 @@
twig:
strict_variables: true

+ 3
- 0
config/packages/test/validator.yaml Voir le fichier

@@ -0,0 +1,3 @@
framework:
validation:
not_compromised_password: false

+ 6
- 0
config/packages/test/web_profiler.yaml Voir le fichier

@@ -0,0 +1,6 @@
web_profiler:
toolbar: false
intercept_redirects: false

framework:
profiler: { collect: false }

+ 6
- 0
config/packages/translation.yaml Voir le fichier

@@ -0,0 +1,6 @@
framework:
default_locale: en
translator:
default_path: '%kernel.project_dir%/translations'
fallbacks:
- en

+ 4
- 0
config/packages/twig.yaml Voir le fichier

@@ -0,0 +1,4 @@
twig:
default_path: '%kernel.project_dir%/templates'
globals:
app_locales: "%app.locales%"

+ 8
- 0
config/packages/validator.yaml Voir le fichier

@@ -0,0 +1,8 @@
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\: []

+ 5
- 0
config/preload.php Voir le fichier

@@ -0,0 +1,5 @@
<?php

if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {
require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';
}

+ 23
- 0
config/routes.yaml Voir le fichier

@@ -0,0 +1,23 @@

lc_admin_dashboard:
path: /admin
controller: App\Controller\Admin\DashboardController::index
login:
path: /login
controller: Lc\SovBundle\Controller\Admin\SecurityController::login
logout:
path: /logout
controller: Lc\SovBundle\Admin\SecurityController::logout

artgris_bundle_file_manager:
resource: "@ArtgrisFileManagerBundle/Controller"
type: annotation
prefix: /manager


_homepage:
path: /
defaults: { _controller: App\Controller\IndexController::index , _locale: fr}
_page:
path: /page/{pageSlug}
controller: App\Controller\IndexController::page

+ 7
- 0
config/routes/annotations.yaml Voir le fichier

@@ -0,0 +1,7 @@
controllers:
resource: ../../src/Controller/
type: annotation

kernel:
resource: ../../src/Kernel.php
type: annotation

+ 3
- 0
config/routes/dev/framework.yaml Voir le fichier

@@ -0,0 +1,3 @@
_errors:
resource: '@FrameworkBundle/Resources/config/routing/errors.xml'
prefix: /_error

+ 7
- 0
config/routes/dev/web_profiler.yaml Voir le fichier

@@ -0,0 +1,7 @@
web_profiler_wdt:
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
prefix: /_wdt

web_profiler_profiler:
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
prefix: /_profiler

+ 2
- 0
config/routes/liip_imagine.yaml Voir le fichier

@@ -0,0 +1,2 @@
_liip_imagine:
resource: "@LiipImagineBundle/Resources/config/routing.yaml"

+ 47
- 0
config/services.yaml Voir le fichier

@@ -0,0 +1,47 @@
# 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:
app.locales: ["fr"]
app.default_locale: "fr"
app.path_uploads: '/uploads'

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.

# 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/'
- '../src/Entity/'
- '../src/Kernel.php'
- '../src/Tests/'

# 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']


Lc\SovBundle\:
resource: '../Lc/SovBundle/'
exclude:
- '../Lc/SovBundle/DependencyInjection/'
- '../Lc/SovBundle/Entity/'
- '../Lc/SovBundle/Kernel.php'
- '../Lc/SovBundle/Tests/'

Lc\SovBundle\Controller\:
resource: '../Lc/SovBundle/Controller/'
tags: [ 'controller.service_arguments' ]

# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones

+ 0
- 0
migrations/.gitignore Voir le fichier


+ 53
- 0
migrations/Version20210510094442.php Voir le fichier

@@ -0,0 +1,53 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20210510094442 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE file (id INT AUTO_INCREMENT NOT NULL, created_by_id INT NOT NULL, updated_by_id INT NOT NULL, path VARCHAR(255) DEFAULT NULL, legend VARCHAR(255) DEFAULT NULL, dev_alias VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, locales_enabled LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', position DOUBLE PRECISION NOT NULL, INDEX IDX_8C9F3610B03A8386 (created_by_id), INDEX IDX_8C9F3610896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE lc_translations_entity (id INT AUTO_INCREMENT NOT NULL, locale VARCHAR(8) NOT NULL, object_class VARCHAR(191) NOT NULL, field VARCHAR(32) NOT NULL, foreign_key VARCHAR(64) NOT NULL, content LONGTEXT DEFAULT NULL, INDEX entity_translation_idx (locale, object_class, field, foreign_key), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE page (id INT AUTO_INCREMENT NOT NULL, image_id INT DEFAULT NULL, created_by_id INT NOT NULL, updated_by_id INT NOT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, meta_title VARCHAR(255) DEFAULT NULL, meta_description LONGTEXT DEFAULT NULL, old_urls LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', slug VARCHAR(255) NOT NULL, position DOUBLE PRECISION NOT NULL, status DOUBLE PRECISION NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, locales_enabled LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', INDEX IDX_140AB6203DA5256D (image_id), INDEX IDX_140AB620B03A8386 (created_by_id), INDEX IDX_140AB620896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE page_file (page_id INT NOT NULL, file_id INT NOT NULL, INDEX IDX_B5B2ACAC4663E4 (page_id), INDEX IDX_B5B2ACA93CB796C (file_id), PRIMARY KEY(page_id, file_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NULL, roles LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\', password VARCHAR(255) NOT NULL, lastname VARCHAR(255) DEFAULT NULL, firstname VARCHAR(255) DEFAULT NULL, is_verified TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB6203DA5256D FOREIGN KEY (image_id) REFERENCES file (id)');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE page_file ADD CONSTRAINT FK_B5B2ACAC4663E4 FOREIGN KEY (page_id) REFERENCES page (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE page_file ADD CONSTRAINT FK_B5B2ACA93CB796C FOREIGN KEY (file_id) REFERENCES file (id) ON DELETE CASCADE');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB6203DA5256D');
$this->addSql('ALTER TABLE page_file DROP FOREIGN KEY FK_B5B2ACA93CB796C');
$this->addSql('ALTER TABLE page_file DROP FOREIGN KEY FK_B5B2ACAC4663E4');
$this->addSql('ALTER TABLE file DROP FOREIGN KEY FK_8C9F3610B03A8386');
$this->addSql('ALTER TABLE file DROP FOREIGN KEY FK_8C9F3610896DBBDE');
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB620B03A8386');
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB620896DBBDE');
$this->addSql('DROP TABLE file');
$this->addSql('DROP TABLE lc_translations_entity');
$this->addSql('DROP TABLE page');
$this->addSql('DROP TABLE page_file');
$this->addSql('DROP TABLE user');
}
}

+ 40
- 0
phpunit.xml.dist Voir le fichier

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="bin/.phpunit/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="tests/bootstrap.php"
>
<php>
<ini name="error_reporting" value="-1" />
<server name="APP_ENV" value="test" force="true" />
<server name="SHELL_VERBOSITY" value="-1" />
<server name="SYMFONY_PHPUNIT_REMOVE" value="" />
<server name="SYMFONY_PHPUNIT_VERSION" value="8.5" />
</php>

<testsuites>
<testsuite name="Project Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>

<!-- Run `composer require symfony/panther` before enabling this extension -->
<!--
<extensions>
<extension class="Symfony\Component\Panther\ServerExtension" />
</extensions>
-->
</phpunit>

+ 22
- 0
public/index.php Voir le fichier

@@ -0,0 +1,22 @@
<?php

use App\Kernel;
use Symfony\Component\Dotenv\Dotenv;
use Symfony\Component\ErrorHandler\Debug;
use Symfony\Component\HttpFoundation\Request;

require dirname(__DIR__).'/vendor/autoload.php';

(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');

if ($_SERVER['APP_DEBUG']) {
umask(0000);

Debug::enable();
}

$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);

+ 0
- 0
src/Controller/.gitignore Voir le fichier


+ 13
- 0
src/Controller/Admin/DashboardController.php Voir le fichier

@@ -0,0 +1,13 @@
<?php

namespace App\Controller\Admin;


use Lc\SovBundle\Controller\Admin\DashboardController as LcDashboardController;

class DashboardController extends LcDashboardController
{



}

+ 38
- 0
src/Controller/Admin/PageCrudController.php Voir le fichier

@@ -0,0 +1,38 @@
<?php

namespace App\Controller\Admin;

use App\Entity\Page;
use EasyCorp\Bundle\EasyAdminBundle\Field\ChoiceField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextEditorField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
use Lc\SovBundle\Controller\Admin\AbstractCrudController;
use Lc\SovBundle\Field\CKEditorField;
use Lc\SovBundle\Field\FileManagerField;
use Lc\SovBundle\Field\GalleryManagerField;

class PageCrudController extends AbstractCrudController
{
public static function getEntityFqcn(): string
{
return Page::class;
}


public function configureFields(string $pageName): iterable
{
return [
TextField::new('title'),
CKEditorField::new('description'),
FileManagerField::new('image'),
GalleryManagerField::new('gallery'),
TextField::new('devAlias'),
ChoiceField::new('status')
->setChoices(['En ligne' => 1, 'Hors ligne' => 0])
->setFormTypeOption('expanded', true)
->setFormTypeOption('multiple', false)
->setCustomOption('widget', false)
];
}

}

+ 43
- 0
src/Controller/IndexController.php Voir le fichier

@@ -0,0 +1,43 @@
<?php

namespace App\Controller;

use App\Entity\Page;
use Lc\SovBundle\Manager\EntityManager;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;


class IndexController extends AbstractController
{
protected $em;
protected $mailer;

public function __construct(EntityManager $em)
{
$this->em = $em;
}

public function index(): Response
{
$pageRepository = $this->em->getRepository(Page::class);
$pages = $pageRepository->findAll();

return $this->render('page/index.html.twig', [
'controller_name' => 'IndexController',
'pages' => $pages
]);
}

public function page($pageSlug): Response
{
$pageRepository = $this->em->getRepository(Page::class);
$page = $pageRepository->findOneBySlug($pageSlug);


return $this->render('page/page.html.twig', [
'controller_name' => 'IndexController',
'page' => $page
]);
}
}

+ 0
- 0
src/Entity/.gitignore Voir le fichier


+ 33
- 0
src/Entity/File.php Voir le fichier

@@ -0,0 +1,33 @@
<?php

namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\IModel\Cms\FileInterface;
use Lc\SovBundle\Repository\Cms\FileRepository;
use Lc\SovBundle\Model\Cms\File as LcFileModel;
use Gedmo\Mapping\Annotation as Gedmo;
use Lc\SovBundle\Entity\Translation\EntityTranslation;

/**
* @ORM\Entity(repositoryClass=FileRepository::class)
* @Gedmo\TranslationEntity(class=EntityTranslation::class)
*/
class File extends LcFileModel implements FileInterface
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;



public function getId(): ?int
{
return $this->id;
}


}

+ 90
- 0
src/Entity/Page.php Voir le fichier

@@ -0,0 +1,90 @@
<?php

namespace App\Entity;

use App\Repository\PageRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Lc\SovBundle\Entity\Translation\EntityTranslation;
use Lc\SovBundle\IModel\Translation\TranslatableInterface;
use Lc\SovBundle\Model\Cms\AbstractDocument;
use Lc\SovBundle\Model\Translation\TranslatableTrait;

/**
* @ORM\Entity(repositoryClass=PageRepository::class)
* @Gedmo\TranslationEntity(class=EntityTranslation::class)
*/
class Page extends AbstractDocument implements TranslatableInterface
{
use TranslatableTrait;

/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;

/**
* @ORM\ManyToOne(targetEntity=File::class, cascade={"persist", "remove"})
*/
private $image;

/**
* @ORM\ManyToMany(targetEntity=File::class, cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"position" = "ASC"})
*/
private $gallery;

public function __construct()
{
$this->gallery = new ArrayCollection();
}



public function getId(): ?int
{
return $this->id;
}

public function getImage(): ?File
{
return $this->image;
}

public function setImage(?File $image): self
{
$this->image = $image;

return $this;
}

/**
* @return Collection|File[]
*/
public function getGallery(): Collection
{
return $this->gallery;
}

public function addGallery(File $gallery): self
{
if (!$this->gallery->contains($gallery)) {
$this->gallery[] = $gallery;
}

return $this;
}

public function removeGallery(File $gallery): self
{
$this->gallery->removeElement($gallery);

return $this;
}


}

+ 28
- 0
src/Entity/User.php Voir le fichier

@@ -0,0 +1,28 @@
<?php

namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\IModel\User\UserInterface;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Lc\SovBundle\Model\User\User as LcUserModel;

/**
* @ORM\Entity(repositoryClass="Lc\SovBundle\Repository\User\UserRepository")
* @UniqueEntity(fields={"email"}, message="There is already an account with this email")
*/
class User extends LcUserModel implements UserInterface
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;

public function getId(): ?int
{
return $this->id;
}

}

+ 38
- 0
src/Kernel.php Voir le fichier

@@ -0,0 +1,38 @@
<?php

namespace App;

use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;

class Kernel extends BaseKernel
{
use MicroKernelTrait;

protected function configureContainer(ContainerConfigurator $container): void
{
$container->import('../config/{packages}/*.yaml');
$container->import('../config/{packages}/'.$this->environment.'/*.yaml');

if (is_file(\dirname(__DIR__).'/config/services.yaml')) {
$container->import('../config/services.yaml');
$container->import('../config/{services}_'.$this->environment.'.yaml');
} elseif (is_file($path = \dirname(__DIR__).'/config/services.php')) {
(require $path)($container->withPath($path), $this);
}
}

protected function configureRoutes(RoutingConfigurator $routes): void
{
$routes->import('../config/{routes}/'.$this->environment.'/*.yaml');
$routes->import('../config/{routes}/*.yaml');

if (is_file(\dirname(__DIR__).'/config/routes.yaml')) {
$routes->import('../config/routes.yaml');
} elseif (is_file($path = \dirname(__DIR__).'/config/routes.php')) {
(require $path)($routes->withPath($path), $this);
}
}
}

+ 0
- 0
src/Repository/.gitignore Voir le fichier


+ 21
- 0
src/Repository/PageRepository.php Voir le fichier

@@ -0,0 +1,21 @@
<?php

namespace App\Repository;

use App\Entity\Page;
use Lc\SovBundle\Repository\BaseRepository;

/**
* @method Page|null find($id, $lockMode = null, $lockVersion = null)
* @method Page|null findOneBy(array $criteria, array $orderBy = null)
* @method Page[] findAll()
* @method Page[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class PageRepository extends BaseRepository
{
public function getInterfaceClass()
{
return Page::class;
}

}

+ 60
- 0
src/Twig/TwigExtension.php Voir le fichier

@@ -0,0 +1,60 @@
<?php

namespace App\Twig;

use App\Entity\Page;
use Lc\SovBundle\Manager\EntityManager;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
use Twig\TwigFunction;

/**
*
*
* @author Fab
*/
class TwigExtension extends AbstractExtension
{
private $container;
private $vichHelper;
private $liipCacheHelper;
private $requestStack = false;
private $em;
private $mwCache;
public function __construct(EntityManager $em)
{
$this->em = $em;
}

public function getFilters()
{
return array(

);
}

public function getFunctions()
{
return array(

new TwigFunction('getPagesNav', array($this, 'getPagesNav'))
);

}


public function getPagesNav()
{
$pageRepository = $this->em->getRepository(Page::class);

//return $pageRepository->findByShowInMenu(1, array('position' => 'asc'));
return $pageRepository->findBy(array(), array('position' => 'asc'));

}


}

+ 591
- 0
symfony.lock Voir le fichier

@@ -0,0 +1,591 @@
{
"artgris/filemanager-bundle": {
"version": "2.2.3"
},
"behat/transliterator": {
"version": "v1.3.0"
},
"composer/installers": {
"version": "v1.11.0"
},
"composer/package-versions-deprecated": {
"version": "1.11.99.1"
},
"doctrine/annotations": {
"version": "1.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "1.0",
"ref": "a2759dd6123694c8d901d0ec80006e044c2e6457"
},
"files": [
"config/routes/annotations.yaml"
]
},
"doctrine/cache": {
"version": "1.11.0"
},
"doctrine/collections": {
"version": "1.6.7"
},
"doctrine/common": {
"version": "3.1.2"
},
"doctrine/dbal": {
"version": "2.13.1"
},
"doctrine/deprecations": {
"version": "v0.5.3"
},
"doctrine/doctrine-bundle": {
"version": "2.3",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "2.3",
"ref": "8a111cea2eeca8b427ae227bbbf35f368327a664"
},
"files": [
"config/packages/doctrine.yaml",
"config/packages/prod/doctrine.yaml",
"config/packages/test/doctrine.yaml",
"src/Entity/.gitignore",
"src/Repository/.gitignore"
]
},
"doctrine/doctrine-migrations-bundle": {
"version": "3.1",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "3.1",
"ref": "ee609429c9ee23e22d6fa5728211768f51ed2818"
},
"files": [
"config/packages/doctrine_migrations.yaml",
"migrations/.gitignore"
]
},
"doctrine/event-manager": {
"version": "1.1.1"
},
"doctrine/inflector": {
"version": "2.0.3"
},
"doctrine/instantiator": {
"version": "1.4.0"
},
"doctrine/lexer": {
"version": "1.2.1"
},
"doctrine/migrations": {
"version": "3.1.2"
},
"doctrine/orm": {
"version": "2.8.4"
},
"doctrine/persistence": {
"version": "2.1.0"
},
"doctrine/sql-formatter": {
"version": "1.1.1"
},
"easycorp/easyadmin-bundle": {
"version": "3.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "3.0",
"ref": "b131e6cbfe1b898a508987851963fff485986285"
}
},
"egulias/email-validator": {
"version": "3.1.1"
},
"friendsofphp/proxy-manager-lts": {
"version": "v1.0.3"
},
"friendsofsymfony/ckeditor-bundle": {
"version": "2.0",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "master",
"version": "2.0",
"ref": "8eb1cd0962ded6a6d6e1e5a9b6d3e888f9f94ff6"
},
"files": [
"config/packages/fos_ckeditor.yaml"
]
},
"gedmo/doctrine-extensions": {
"version": "v3.0.5"
},
"imagine/imagine": {
"version": "1.2.4"
},
"laminas/laminas-code": {
"version": "4.2.2"
},
"laminas/laminas-eventmanager": {
"version": "3.3.1"
},
"laminas/laminas-zendframework-bridge": {
"version": "1.2.0"
},
"liip/imagine-bundle": {
"version": "1.8",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "master",
"version": "1.8",
"ref": "5a5bdc2d0e2533ed6935d5ae562f2b318a8fc1ee"
},
"files": [
"config/packages/liip_imagine.yaml",
"config/routes/liip_imagine.yaml"
]
},
"monolog/monolog": {
"version": "2.2.0"
},
"nikic/php-parser": {
"version": "v4.10.5"
},
"oomphinc/composer-installers-extender": {
"version": "2.0.0"
},
"phpdocumentor/reflection-common": {
"version": "2.2.0"
},
"phpdocumentor/reflection-docblock": {
"version": "5.2.2"
},
"phpdocumentor/type-resolver": {
"version": "1.4.0"
},
"psr/cache": {
"version": "1.0.1"
},
"psr/container": {
"version": "1.1.1"
},
"psr/event-dispatcher": {
"version": "1.0.0"
},
"psr/link": {
"version": "1.0.0"
},
"psr/log": {
"version": "1.1.4"
},
"sensio/framework-extra-bundle": {
"version": "5.2",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "5.2",
"ref": "fb7e19da7f013d0d422fa9bce16f5c510e27609b"
},
"files": [
"config/packages/sensio_framework_extra.yaml"
]
},
"stof/doctrine-extensions-bundle": {
"version": "1.2",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "master",
"version": "1.2",
"ref": "6c1ceb662f8997085f739cd089bfbef67f245983"
},
"files": [
"config/packages/stof_doctrine_extensions.yaml"
]
},
"symfony/asset": {
"version": "v5.2.7"
},
"symfony/browser-kit": {
"version": "v5.2.7"
},
"symfony/cache": {
"version": "v5.2.7"
},
"symfony/cache-contracts": {
"version": "v2.4.0"
},
"symfony/config": {
"version": "v5.2.7"
},
"symfony/console": {
"version": "5.1",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "5.1",
"ref": "c6d02bdfba9da13c22157520e32a602dbee8a75c"
},
"files": [
"bin/console"
]
},
"symfony/css-selector": {
"version": "v5.2.7"
},
"symfony/debug-bundle": {
"version": "4.1",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "4.1",
"ref": "0ce7a032d344fb7b661cd25d31914cd703ad445b"
},
"files": [
"config/packages/dev/debug.yaml"
]
},
"symfony/debug-pack": {
"version": "v1.0.9"
},
"symfony/dependency-injection": {
"version": "v5.2.7"
},
"symfony/deprecation-contracts": {
"version": "v2.4.0"
},
"symfony/doctrine-bridge": {
"version": "v5.2.7"
},
"symfony/dom-crawler": {
"version": "v5.2.4"
},
"symfony/dotenv": {
"version": "v5.2.4"
},
"symfony/error-handler": {
"version": "v5.2.7"
},
"symfony/event-dispatcher": {
"version": "v5.2.4"
},
"symfony/event-dispatcher-contracts": {
"version": "v2.4.0"
},
"symfony/expression-language": {
"version": "v5.2.7"
},
"symfony/filesystem": {
"version": "v5.2.7"
},
"symfony/finder": {
"version": "v5.2.4"
},
"symfony/flex": {
"version": "1.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "1.0",
"ref": "c0eeb50665f0f77226616b6038a9b06c03752d8e"
},
"files": [
".env"
]
},
"symfony/form": {
"version": "v5.2.7"
},
"symfony/framework-bundle": {
"version": "5.2",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "5.2",
"ref": "6ec87563dcc85cd0c48856dcfbfc29610506d250"
},
"files": [
"config/packages/cache.yaml",
"config/packages/framework.yaml",
"config/packages/test/framework.yaml",
"config/preload.php",
"config/routes/dev/framework.yaml",
"config/services.yaml",
"public/index.php",
"src/Controller/.gitignore",
"src/Kernel.php"
]
},
"symfony/http-client": {
"version": "v5.2.7"
},
"symfony/http-client-contracts": {
"version": "v2.4.0"
},
"symfony/http-foundation": {
"version": "v5.2.7"
},
"symfony/http-kernel": {
"version": "v5.2.7"
},
"symfony/intl": {
"version": "v5.2.7"
},
"symfony/mailer": {
"version": "4.3",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "4.3",
"ref": "15658c2a0176cda2e7dba66276a2030b52bd81b2"
},
"files": [
"config/packages/mailer.yaml"
]
},
"symfony/maker-bundle": {
"version": "1.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "1.0",
"ref": "fadbfe33303a76e25cb63401050439aa9b1a9c7f"
}
},
"symfony/mime": {
"version": "v5.2.7"
},
"symfony/monolog-bridge": {
"version": "v5.2.7"
},
"symfony/monolog-bundle": {
"version": "3.7",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "3.7",
"ref": "329f6a5ef2e7aa033f802be833ef8d1268dd0848"
},
"files": [
"config/packages/dev/monolog.yaml",
"config/packages/prod/deprecations.yaml",
"config/packages/prod/monolog.yaml",
"config/packages/test/monolog.yaml"
]
},
"symfony/notifier": {
"version": "5.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "5.0",
"ref": "c31585e252b32fe0e1f30b1f256af553f4a06eb9"
},
"files": [
"config/packages/notifier.yaml"
]
},
"symfony/options-resolver": {
"version": "v5.2.4"
},
"symfony/orm-pack": {
"version": "v2.1.0"
},
"symfony/phpunit-bridge": {
"version": "5.1",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "5.1",
"ref": "bf16921ef8309a81d9f046e9b6369c46bcbd031f"
},
"files": [
".env.test",
"bin/phpunit",
"phpunit.xml.dist",
"tests/bootstrap.php"
]
},
"symfony/polyfill-intl-grapheme": {
"version": "v1.22.1"
},
"symfony/polyfill-intl-icu": {
"version": "v1.22.1"
},
"symfony/polyfill-intl-idn": {
"version": "v1.22.1"
},
"symfony/polyfill-intl-normalizer": {
"version": "v1.22.1"
},
"symfony/polyfill-mbstring": {
"version": "v1.22.1"
},
"symfony/polyfill-php73": {
"version": "v1.22.1"
},
"symfony/polyfill-php80": {
"version": "v1.22.1"
},
"symfony/polyfill-uuid": {
"version": "v1.22.1"
},
"symfony/process": {
"version": "v5.2.7"
},
"symfony/profiler-pack": {
"version": "v1.0.5"
},
"symfony/property-access": {
"version": "v5.2.4"
},
"symfony/property-info": {
"version": "v5.2.7"
},
"symfony/proxy-manager-bridge": {
"version": "v5.2.4"
},
"symfony/routing": {
"version": "5.1",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "5.1",
"ref": "b4f3e7c95e38b606eef467e8a42a8408fc460c43"
},
"files": [
"config/packages/prod/routing.yaml",
"config/packages/routing.yaml",
"config/routes.yaml"
]
},
"symfony/security-bundle": {
"version": "5.1",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "5.1",
"ref": "0a4bae19389d3b9cba1ca0102e3b2bccea724603"
},
"files": [
"config/packages/security.yaml"
]
},
"symfony/security-core": {
"version": "v5.2.7"
},
"symfony/security-csrf": {
"version": "v5.2.7"
},
"symfony/security-guard": {
"version": "v5.2.4"
},
"symfony/security-http": {
"version": "v5.2.7"
},
"symfony/serializer": {
"version": "v5.2.7"
},
"symfony/serializer-pack": {
"version": "v1.0.4"
},
"symfony/service-contracts": {
"version": "v2.4.0"
},
"symfony/stopwatch": {
"version": "v5.2.7"
},
"symfony/string": {
"version": "v5.2.6"
},
"symfony/test-pack": {
"version": "v1.0.7"
},
"symfony/translation": {
"version": "3.3",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "3.3",
"ref": "2ad9d2545bce8ca1a863e50e92141f0b9d87ffcd"
},
"files": [
"config/packages/translation.yaml",
"translations/.gitignore"
]
},
"symfony/translation-contracts": {
"version": "v2.4.0"
},
"symfony/twig-bridge": {
"version": "v5.2.7"
},
"symfony/twig-bundle": {
"version": "5.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "5.0",
"ref": "fab9149bbaa4d5eca054ed93f9e1b66cc500895d"
},
"files": [
"config/packages/test/twig.yaml",
"config/packages/twig.yaml",
"templates/base.html.twig"
]
},
"symfony/twig-pack": {
"version": "v1.0.1"
},
"symfony/uid": {
"version": "v5.2.6"
},
"symfony/validator": {
"version": "4.3",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "4.3",
"ref": "d902da3e4952f18d3bf05aab29512eb61cabd869"
},
"files": [
"config/packages/test/validator.yaml",
"config/packages/validator.yaml"
]
},
"symfony/var-dumper": {
"version": "v5.2.7"
},
"symfony/var-exporter": {
"version": "v5.2.7"
},
"symfony/web-link": {
"version": "v5.2.5"
},
"symfony/web-profiler-bundle": {
"version": "3.3",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "3.3",
"ref": "6bdfa1a95f6b2e677ab985cd1af2eae35d62e0f6"
},
"files": [
"config/packages/dev/web_profiler.yaml",
"config/packages/test/web_profiler.yaml",
"config/routes/dev/web_profiler.yaml"
]
},
"symfony/yaml": {
"version": "v5.2.7"
},
"twig/extra-bundle": {
"version": "v3.3.0"
},
"twig/twig": {
"version": "v3.3.0"
},
"webmozart/assert": {
"version": "1.10.0"
}
}

+ 56
- 0
templates/base.html.twig Voir le fichier

@@ -0,0 +1,56 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>{% block title %}Welcome!{% endblock %}</title>

{% if block('meta_title') is defined %}
{% set block_meta_title = block('meta_title') %}
{% if block_meta_title is not empty %}
<meta name="title" content="{{ block_meta_title|raw }}"/>
{% endif %}
{% endif %}
{% if block('meta_description') is defined %}
{% set block_meta_description = block('meta_description') %}
{% if block_meta_description is not empty %}
<meta name="description" content="{{ block_meta_description|raw }}"/>
{% endif %}
{% endif %}

<meta property="og:title" content="{% block ogTitle %}{{ 'meta.title'|trans }}{% endblock %}"/>
<meta property="og:type" content="{% block ogType %}website{% endblock %}"/>
<meta property="og:image"
content="{% block ogImage %}{{ asset('bundles/mwebcore/img/facebook-banner.jpg', null, true) }}{% endblock %}"/>
<meta property="og:description" content="{% block ogDesciption %}{{ 'meta.description'|trans }}{% endblock %}"/>
<meta property="og:url" content="{{ app.request.uri }}"/>

<link rel="icon" type="image/png" href="{{ asset('assets/img/favicon.png') }}"/>



{% block stylesheets %}{% endblock %}
</head>
<body>
{% block body %}
<body id="default">
<header>
<h1>Projet par défaut La clic !</h1>
{% include "block/nav.html.twig" %}
</header>

<div class="container">
{% block content %}

{% endblock %}

</div>
<footer></footer>

</body>

{% endblock %}

{% block javascripts %}{% endblock %}
</body>
</html>

+ 17
- 0
templates/block/nav.html.twig Voir le fichier

@@ -0,0 +1,17 @@
<ul id="menu">
<li class="elm-menu">
<a class="{{ app.request.attributes.get('_route') == '_homepage' ? 'selected' : '' }}" href="{{ path('_homepage') }}">{{ 'menu.home'|trans }}</a>
</li>
{% for page in getPagesNav() %}
<li class="elm-menu">
<a class="{{ app.request.get('pageSlug') == page.slug ? 'selected' : '' }}" href="{{ path('_page', {'pageSlug' : page.slug}) }}">{{ page.title }}</a>
</li>
{% endfor %}
</ul>

{% for lg, url in translated_urls() %}
<a class="{{ app.request.locale == lg ? 'selected' : '' }}" title="{{ "misc.switch"|trans({"%lang%": lg}) }}" href="{{ url }}">{{ lg }}</a>
{% if lg == 'fr' %}
<span class="slash">/</span>
{% endif %}
{% endfor %}

+ 6
- 0
templates/page/index.html.twig Voir le fichier

@@ -0,0 +1,6 @@
{% extends 'base.html.twig' %}


{% block content %}
Bienvenue petit pingouin !
{% endblock %}

+ 11
- 0
templates/page/page.html.twig Voir le fichier

@@ -0,0 +1,11 @@
{% extends 'base.html.twig' %}

{% block title %}{{ page.title }}{% endblock %}
{% block ogTitle %}{{ page.title }}{% endblock %}
{% block metaDescription %}{{ page.summary }}{% endblock %}
{% block ogDescription %}{{ page.summary }}{% endblock %}

{% block content %}
{{ page.description|raw }}
<img src="{{ lc_liip(page.image.path, 'page') }}" alt="{{ page.image.legend }}" />
{% endblock %}

+ 42
- 0
templates/security/login.html.twig Voir le fichier

@@ -0,0 +1,42 @@
{% extends 'base.html.twig' %}

{% block title %}Log in!{% endblock %}

{% block body %}
<form method="post">
{% if error %}
<div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
{% endif %}

{% if app.user %}
<div class="mb-3">
You are logged in as {{ app.user.username }}, <a href="{{ path('app_logout') }}">Logout</a>
</div>
{% endif %}

<h1 class="h3 mb-3 font-weight-normal">Please sign in</h1>
<label for="inputEmail">Email</label>
<input type="email" value="{{ last_username }}" name="email" id="inputEmail" class="form-control" required autofocus>
<label for="inputPassword">Password</label>
<input type="password" name="password" id="inputPassword" class="form-control" required>

<input type="hidden" name="_csrf_token"
value="{{ csrf_token('authenticate') }}"
>

{#
Uncomment this section and add a remember_me option below your firewall to activate remember me functionality.
See https://symfony.com/doc/current/security/remember_me.html

<div class="checkbox mb-3">
<label>
<input type="checkbox" name="_remember_me"> Remember me
</label>
</div>
#}

<button class="btn btn-lg btn-primary" type="submit">
Sign in
</button>
</form>
{% endblock %}

+ 11
- 0
tests/bootstrap.php Voir le fichier

@@ -0,0 +1,11 @@
<?php

use Symfony\Component\Dotenv\Dotenv;

require dirname(__DIR__).'/vendor/autoload.php';

if (file_exists(dirname(__DIR__).'/config/bootstrap.php')) {
require dirname(__DIR__).'/config/bootstrap.php';
} elseif (method_exists(Dotenv::class, 'bootEnv')) {
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
}

+ 0
- 0
translations/.gitignore Voir le fichier


Chargement…
Annuler
Enregistrer