Commit 38e28e88 authored by KarlPineau's avatar KarlPineau

update

parent 2d966a9e
......@@ -17,7 +17,6 @@ class AppKernel extends Kernel
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new AppBundle\AppBundle(),
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
new Jeremyjumeau\ParsedownBundle\JeremyjumeauParsedownBundle(),
new Sensio\Bundle\BuzzBundle\SensioBuzzBundle(),
......
tools_ner:
resource: "@TOOLSNerBundle/Controller/"
type: annotation
prefix: /
tools_layout:
resource: "@TOOLSLayoutBundle/Controller/"
type: annotation
prefix: /
prefix: /tools/name-entity-recognition/
tools_home:
resource: "@TOOLSHomeBundle/Controller/"
type: annotation
prefix: /
prefix: /tools/
tools_administration:
resource: "@TOOLSAdministrationBundle/Controller/"
type: annotation
prefix: /
prefix: /tools/administration/
tb_tested_game:
resource: "@TBTestedGameBundle/Controller/"
type: annotation
prefix: /
prefix: /ConfusArt/testedGame/
tb_player:
resource: "@TBPlayerBundle/Controller/"
type: annotation
prefix: /
prefix: /ConfusArt/player/
tb_personal_place:
resource: "@TBPersonalPlaceBundle/Controller/"
type: annotation
prefix: /
tb_model:
resource: "@TBModelBundle/Controller/"
type: annotation
prefix: /
tb_layout:
resource: "@TBLayoutBundle/Controller/"
type: annotation
prefix: /
prefix: /ConfusArt/profile/
tb_home:
resource: "@TBHomeBundle/Controller/"
type: annotation
prefix: /
prefix: /ConfusArt/
tb_administration:
resource: "@TBAdministrationBundle/Controller/"
type: annotation
prefix: /
home_layout:
resource: "@HOMELayoutBundle/Controller/"
type: annotation
prefix: /
prefix: /ConfusArt/administration/
home_home:
resource: "@HOMEHomeBundle/Controller/"
......@@ -66,108 +46,89 @@ home_home:
data_teaching:
resource: "@DATATeachingBundle/Controller/"
type: annotation
prefix: /
prefix: /data/administration/enseignements/
data_search:
resource: "@DATASearchBundle/Controller/"
type: annotation
prefix: /
prefix: /data/recherche/
data_public:
resource: "@DATAPublicBundle/Controller/"
type: annotation
prefix: /
prefix: /data/
data_personal_place:
resource: "@DATAPersonalPlaceBundle/Controller/"
type: annotation
prefix: /
data_layout:
resource: "@DATALayoutBundle/Controller/"
type: annotation
prefix: /
prefix: /data/profile
data_import:
resource: "@DATAImportBundle/Controller/"
type: annotation
prefix: /
prefix: /data/importation/
data_image:
resource: "@DATAImageBundle/Controller/"
type: annotation
prefix: /
prefix: /data/administration/images/
data_duplicate:
resource: "@DATADuplicateBundle/Controller/"
type: annotation
prefix: /
prefix: /data/administration/duplicate
data_data:
resource: "@DATADataBundle/Controller/"
type: annotation
prefix: /
prefix: /data/administration/item/
data_administration:
resource: "@DATAAdministrationBundle/Controller/"
type: annotation
prefix: /
prefix: /data/administration/
cliches_player:
resource: "@CLICHESPlayerBundle/Controller/"
type: annotation
prefix: /
prefix: /cliches/player/
cliches_personal_place:
resource: "@CLICHESPersonalPlaceBundle/Controller/"
type: annotation
prefix: /
cliches_layout:
resource: "@CLICHESLayoutBundle/Controller/"
type: annotation
prefix: /
prefix: /cliches/profile/
cliches_home:
resource: "@CLICHESHomeBundle/Controller/"
type: annotation
prefix: /
prefix: /cliches/
cliches_administration:
resource: "@CLICHESAdministrationBundle/Controller/"
type: annotation
prefix: /
prefix: /cliches/administration/
cas_user:
resource: "@CASUserBundle/Controller/"
type: annotation
prefix: /
cas_layout:
resource: "@CASLayoutBundle/Controller/"
type: annotation
prefix: /
prefix: /cas/utilisateur/
cas_home:
resource: "@CASHomeBundle/Controller/"
type: annotation
prefix: /
prefix: /cas/
cas_administration:
resource: "@CASAdministrationBundle/Controller/"
type: annotation
prefix: /
prefix: /cas/administration/
api_data:
resource: "@APIDataBundle/Controller/"
type: annotation
prefix: /
prefix: /api/data/
api_cliches:
resource: "@APIClichesBundle/Controller/"
type: annotation
prefix: /
app:
resource: '@AppBundle/Controller/'
type: annotation
prefix: /api/cliches/
......@@ -13,27 +13,3 @@ services:
# this means you cannot fetch services directly from the container via $container->get()
# if you need to do this, you can override this setting on individual services
public: false
# makes classes in src/AppBundle available to be used as services
# this creates a service per class whose id is the fully-qualified class name
AppBundle\:
resource: '../../src/AppBundle/*'
# you can exclude directories or files
# but if a service is unused, it's removed anyway
exclude: '../../src/AppBundle/{Entity,Repository,Tests}'
# controllers are imported separately to make sure they're public
# and have a tag that allows actions to type-hint services
AppBundle\Controller\:
resource: '../../src/AppBundle/Controller'
public: true
tags: ['controller.service_arguments']
# add more services, or override services that need manual wiring
# AppBundle\Service\ExampleService:
# arguments:
# $someArgument: 'some_value'
MailerService:
class: AppBundle\Service\MailerService
public: true
arguments: [ "@doctrine.orm.entity_manager", "@twig", "@mailer"]
\ No newline at end of file
......@@ -62,7 +62,10 @@
],
"post-update-cmd": [
"@symfony-scripts"
]
],
"auto-scripts": {
"security-checker security:check": "script"
}
},
"config": {
"sort-packages": true
......
This diff is collapsed.
<?php
use Symfony\Component\Dotenv\Dotenv;
require dirname(__DIR__).'/vendor/autoload.php';
// Load cached env vars if the .env.local.php file exists
// Run "composer dump-env prod" to create it (requires symfony/flex >=1.2)
if (is_array($env = @include dirname(__DIR__).'/.env.local.php')) {
$_ENV += $env;
} elseif (!class_exists(Dotenv::class)) {
throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.');
} else {
$path = dirname(__DIR__).'/.env';
$dotenv = new Dotenv(false);
// load all the .env files
if (method_exists($dotenv, 'loadEnv')) {
$dotenv->loadEnv($path);
} else {
// fallback code in case your Dotenv component is not 4.2 or higher (when loadEnv() was added)
if (file_exists($path) || !file_exists($p = "$path.dist")) {
$dotenv->load($path);
} else {
$dotenv->load($p);
}
if (null === $env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) {
$dotenv->populate(array('APP_ENV' => $env = 'dev'));
}
if ('test' !== $env && file_exists($p = "$path.local")) {
$dotenv->load($p);
$env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env;
}
if (file_exists($p = "$path.$env")) {
$dotenv->load($p);
}
if (file_exists($p = "$path.$env.local")) {
$dotenv->load($p);
}
}
}
$_SERVER += $_ENV;
$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev';
$_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV'];
$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0';
......@@ -2,4 +2,15 @@
return [
Presta\SitemapBundle\PrestaSitemapBundle::class => ['all' => true],
Sensio\Bundle\BuzzBundle\SensioBuzzBundle::class => ['all' => true],
Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle::class => ['all' => true],
Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle::class => ['dev' => true, 'test' => true],
Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
FOS\UserBundle\FOSUserBundle::class => ['all' => true],
Jeremyjumeau\ParsedownBundle\JeremyjumeauParsedownBundle::class => ['all' => true],
Sensio\Bundle\DistributionBundle\SensioDistributionBundle::class => ['all' => true],
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
];
# Read more about client options at: https://github.com/kriswallsmith/Buzz/blob/master/doc/client.md
services:
_defaults:
public: false
# Tell the auto wire system to use "FileGetContents" client as default client.
# Set this to any of the other clients below (e.g. Curl or MultiCurl) to use a different default client.
Buzz\Client\BuzzClientInterface: '@buzz.client.file_get_contents'
Buzz\Client\BatchClientInterface: '@buzz.client.multi_curl'
# Register alias for PSR-18
Psr\Http\Client\ClientInterface: '@Buzz\Client\BuzzClientInterface'
# Clients
buzz.client.file_get_contents:
class: Buzz\Client\FileGetContents
arguments:
- '@Psr\Http\Message\ResponseFactoryInterface'
-
timeout: 10
allow_redirects: false
buzz.client.curl:
class: Buzz\Client\Curl
arguments:
- '@Psr\Http\Message\ResponseFactoryInterface'
-
timeout: 10
allow_redirects: false
buzz.client.multi_curl:
class: Buzz\Client\MultiCurl
arguments:
- '@Psr\Http\Message\ResponseFactoryInterface'
-
timeout: 10
allow_redirects: false
# Browser
Buzz\Browser:
arguments: ['@Buzz\Client\BuzzClientInterface', '@Psr\Http\Message\RequestFactoryInterface']
calls:
- ['addMiddleware', ['@buzz.middleware.content_length']]
- ['addMiddleware', ['@buzz.middleware.logger']]
# Middleware
buzz.middleware.content_length:
class: Buzz\Middleware\ContentLengthMiddleware
buzz.middleware.logger:
class: Buzz\Middleware\LoggerMiddleware
arguments: ['@?logger']
tags:
- { name: monolog.logger, channel: buzz }
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"]
# See https://symfony.com/doc/current/email/dev_environment.html
swiftmailer:
# send all emails to a specific address
#delivery_addresses: ['me@example.com']
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)%'
orm:
auto_generate_proxy_classes: true
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
doctrine:
orm:
auto_generate_proxy_classes: false
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"]
services:
_defaults:
autowire: true
autoconfigure: true
SensioLabs\Security\SecurityChecker: ~
SensioLabs\Security\Command\SecurityCheckerCommand: ~
sensio_framework_extra:
router:
annotations: 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
swiftmailer:
url: '%env(MAILER_URL)%'
spool: { type: 'memory' }
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: ["!event"]
swiftmailer:
disable_delivery: true
controllers:
resource: ../../src/Controller/
type: annotation
services:
_defaults:
public: true
# If you need to access services in a test, create an alias
# and then fetch that alias from the container. As a convention,
# aliases are prefixed with test. For example:
#
# test.App\Service\MyService: '@App\Service\MyService'
......@@ -10,6 +10,13 @@
<php>
<ini name="error_reporting" value="-1" />
<server name="KERNEL_CLASS" value="AppKernel" />
<!-- ###+ symfony/swiftmailer-bundle ### -->
<!-- For Gmail as a transport, use: "gmail://username:password@localhost" -->
<!-- For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode=" -->
<!-- Delivery is disabled by default via "null://localhost" -->
<env name="MAILER_URL" value="null://localhost"/>
<!-- ###- symfony/swiftmailer-bundle ### -->
</php>
<testsuites>
......
......@@ -5,9 +5,14 @@ namespace API\ClichesBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
class ClichesController extends Controller
{
/**
* @param Request $request
* @return Response
*/
public function indexAction(Request $request)
{
$messages = [
......@@ -34,6 +39,11 @@ class ClichesController extends Controller
return $response;
}
/**
* @param $entity
* @param $oldProperties
* @return null
*/
public function getProperty($entity, $oldProperties) {
foreach($this->get('data_data.entity')->getFields($entity) as $fieldContainer) {
if(!in_array($fieldContainer['field'], $oldProperties)) {
......@@ -43,9 +53,15 @@ class ClichesController extends Controller
return null;
}
// ATTENTION, LES DEUX FONCTIONS CI-DESSOUS SONT TRES PROCHES DE CELLES CONTENUES DANS LE SERVICE playerProposalChoiceAction
// -> A FUSIONNER A TERME
/**
* ATTENTION, LES DEUX FONCTIONS CI-DESSOUS SONT TRES PROCHES DE CELLES CONTENUES DANS LE SERVICE playerProposalChoiceAction
* -> A FUSIONNER A TERME
* @param $teaching
* @param $entity
* @param $field
* @param $choices_number
* @return array
*/
public function getOtherValues($teaching, $entity, $field, $choices_number)
{
$entitiesSetByTeaching = $this->get('data_data.entity')->getByTeaching($teaching, 'restrict');
......@@ -63,6 +79,14 @@ class ClichesController extends Controller
return $values;
}
/**
* @param $values
* @param $field
* @param $entitiesSetByTeaching
* @param $entitiesSizeIndex
* @param $listValues
* @return array
*/
private function getValueForEntity($values, $field, $entitiesSetByTeaching, $entitiesSizeIndex, $listValues)
{
$indexRandom = rand(0, $entitiesSizeIndex);
......@@ -79,6 +103,15 @@ class ClichesController extends Controller
}
}
/**
* @param $teaching
* @param $entity
* @param $view
* @param $propertyContainer
* @param $values
* @param Request $request
* @return Response
*/
public function generateMessengerFormat($teaching, $entity, $view, $propertyContainer, $values, Request $request)
{
$image = $this->get('data_image.image')->getOneByView($view);
......
......@@ -8,6 +8,7 @@ use CLICHES\PlayerBundle\Entity\PlayerProposalChoiceValue;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
class ProposalChoiceController extends Controller
{
......@@ -19,6 +20,9 @@ class ProposalChoiceController extends Controller
* "playerOeuvre_id"="\d+"
* }
* )
* @param $playerOeuvre_id
* @param Request $request
* @return Response
*/
public function indexAction($playerOeuvre_id, Request $request)
{
......@@ -85,6 +89,17 @@ class ProposalChoiceController extends Controller
return $this->generateMessengerFormat($playerProposal, $playerOeuvre->getPlayerSession()->getTeaching(), $this->get('data_data.entity')->getByView($playerOeuvre->getView()), $playerOeuvre->getView(), $fieldContainer, $choicesArray, $difficultyLevel, $request);
}
/**
* @param $playerProposal
* @param $teaching
* @param $entity
* @param $view
* @param $propertyContainer
* @param $values
* @param $difficultyLevel
* @param Request $request
* @return Response
*/
public function generateMessengerFormat($playerProposal, $teaching, $entity, $view, $propertyContainer, $values, $difficultyLevel, Request $request)
{
$image = $this->get('data_image.image')->getOneByView($view);
......
......@@ -8,9 +8,15 @@ use CLICHES\PlayerBundle\Entity\PlayerProposalChoiceValue;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
class ProposalGalleryController extends Controller
{
/**
* @param $playerOeuvre_id
* @param Request $request
* @return Response
*/
public function indexAction($playerOeuvre_id, Request $request)
{
$em = $this->getDoctrine()->getManager();
......@@ -78,6 +84,16 @@ class ProposalGalleryController extends Controller
return $this->generateMessengerFormat($playerProposal, $playerOeuvre->getPlayerSession()->getTeaching(), $this->get('data_data.entity')->getByView($playerOeuvre->getView()), $playerOeuvre->getView(), $fieldContainer, $choicesArray, $request);
}