浏览代码

Merge branch 'develop' into features/background

François Drouhard 2 年之前
父节点
当前提交
c6d6e82014

+ 1 - 1
.env

@@ -24,7 +24,7 @@ APP_SECRET=18a6fd80ab9362b2e4df54d6029416da
 #
 # DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
 # DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8&charset=utf8mb4"
-DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=14&charset=utf8"
+DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=15&charset=utf8"
 ###< doctrine/doctrine-bundle ###
 ###> Mattermost/Service ###
 MATTERMOST_URL=https://adresse_du_serveur_mattermost

+ 29 - 29
composer.json

@@ -15,44 +15,44 @@
         "phpdocumentor/reflection-docblock": "^5.3",
         "sensio/framework-extra-bundle": "^6.2",
         "symfony/apache-pack": "^1.0",
-        "symfony/asset": "6.1.*",
-        "symfony/console": "6.1.*",
-        "symfony/dotenv": "6.1.*",
-        "symfony/expression-language": "6.1.*",
+        "symfony/asset": "6.2.*",
+        "symfony/console": "6.2.*",
+        "symfony/dotenv": "6.2.*",
+        "symfony/expression-language": "6.2.*",
         "symfony/flex": "^2.2",
-        "symfony/form": "6.1.*",
-        "symfony/framework-bundle": "6.1.*",
-        "symfony/html-sanitizer": "6.1.*",
-        "symfony/http-client": "6.1.*",
-        "symfony/mailer": "6.1.*",
+        "symfony/form": "6.2.*",
+        "symfony/framework-bundle": "6.2.*",
+        "symfony/html-sanitizer": "6.2.*",
+        "symfony/http-client": "6.2.*",
+        "symfony/mailer": "6.2.*",
         "symfony/monolog-bundle": "^3.1",
-        "symfony/process": "6.1.*",
-        "symfony/property-access": "6.1.*",
-        "symfony/property-info": "6.1.*",
-        "symfony/proxy-manager-bridge": "6.1.*",
-        "symfony/runtime": "6.1.*",
-        "symfony/security-bundle": "6.1.*",
-        "symfony/serializer": "6.1.*",
-        "symfony/translation": "6.1.*",
-        "symfony/twig-bundle": "6.1.*",
-        "symfony/validator": "6.1.*",
-        "symfony/web-link": "6.1.*",
+        "symfony/process": "6.2.*",
+        "symfony/property-access": "6.2.*",
+        "symfony/property-info": "6.2.*",
+        "symfony/proxy-manager-bridge": "6.2.*",
+        "symfony/runtime": "6.2.*",
+        "symfony/security-bundle": "6.2.*",
+        "symfony/serializer": "6.2.*",
+        "symfony/translation": "6.2.*",
+        "symfony/twig-bundle": "6.2.*",
+        "symfony/validator": "6.2.*",
+        "symfony/web-link": "6.2.*",
         "symfony/webpack-encore-bundle": "^1.12",
-        "symfony/yaml": "6.1.*",
+        "symfony/yaml": "6.2.*",
         "twig/extra-bundle": "^3.4",
         "twig/markdown-extra": "^3.4",
         "twig/twig": "^2.12|^3.0"
     },
     "require-dev": {
         "phpunit/phpunit": "^9.5",
-        "symfony/browser-kit": "6.1.*",
-        "symfony/css-selector": "6.1.*",
-        "symfony/debug-bundle": "6.1.*",
+        "symfony/browser-kit": "6.2.*",
+        "symfony/css-selector": "6.2.*",
+        "symfony/debug-bundle": "6.2.*",
         "symfony/maker-bundle": "^1.47",
-        "symfony/phpunit-bridge": "6.1.*",
-        "symfony/stopwatch": "6.1.*",
-        "symfony/var-dumper": "6.1.*",
-        "symfony/web-profiler-bundle": "6.1.*"
+        "symfony/phpunit-bridge": "6.2.*",
+        "symfony/stopwatch": "6.2.*",
+        "symfony/var-dumper": "6.2.*",
+        "symfony/web-profiler-bundle": "6.2.*"
     },
     "config": {
         "platform":{
@@ -103,7 +103,7 @@
     "extra": {
         "symfony": {
             "allow-contrib": false,
-            "require": "6.1.*"
+            "require": "6.2.*"
         }
     }
 }

文件差异内容过多而无法显示
+ 190 - 194
composer.lock


+ 3 - 1
config/packages/doctrine.yaml

@@ -4,9 +4,10 @@ doctrine:
 
         # IMPORTANT: You MUST configure your server version,
         # either here or in the DATABASE_URL env var (see .env file)
-        #server_version: '13'
+        #server_version: '15'
     orm:
         auto_generate_proxy_classes: true
+        enable_lazy_ghost_objects: true
         naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
         auto_mapping: true
         mappings:
@@ -27,6 +28,7 @@ when@prod:
     doctrine:
         orm:
             auto_generate_proxy_classes: false
+            proxy_dir: '%kernel.build_dir%/doctrine/orm/Proxies'
             query_cache_driver:
                 type: pool
                 pool: doctrine.system_cache_pool

+ 1 - 0
config/packages/framework.yaml

@@ -3,6 +3,7 @@ framework:
     secret: '%env(APP_SECRET)%'
     #csrf_protection: true
     http_method_override: false
+    handle_all_throwables: 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.

+ 6 - 2
config/packages/security.yaml

@@ -1,5 +1,5 @@
 security:
-    enable_authenticator_manager: true
+    #enable_authenticator_manager: true
 
     password_hashers:
         App\Entity\User:
@@ -32,10 +32,14 @@ security:
             remember_me:
                 secret: '%kernel.secret%'
                 samesite: 'lax'
+            form_login:
+                login_path: app_login
+                check_path: app_login
+                enable_csrf: true
             logout:
                 path: app_logout
                 target: app_login
-            custom_authenticator: App\Security\LoginFormAuthenticator
+            #custom_authenticator: App\Security\LoginFormAuthenticator
             #lazy: true
             #provider: users_in_memory
 

+ 2 - 6
config/packages/webpack_encore.yaml

@@ -25,14 +25,10 @@ webpack_encore:
 
     # If you have multiple builds:
     # builds:
-        # pass "frontend" as the 3rg arg to the Twig functions
-        # {{ encore_entry_script_tags('entry1', null, 'frontend') }}
-
         # frontend: '%kernel.project_dir%/public/frontend/build'
 
-    # Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes)
-    # Put in config/packages/prod/webpack_encore.yaml
-    # cache: true
+        # pass the build name as the 3rd argument to the Twig functions
+        # {{ encore_entry_script_tags('entry1', null, 'frontend') }}
 
 framework:
     assets:

+ 3 - 1
config/routes.yaml

@@ -1,3 +1,5 @@
 controllers:
-    resource: ../src/Controller/
+    resource:
+        path: ../src/Controller/
+        namespace: App\Controller
     type: attribute

+ 4 - 0
public/.htaccess

@@ -18,6 +18,10 @@ DirectoryIndex index.php
 </IfModule>
 
 <IfModule mod_rewrite.c>
+    # This Option needs to be enabled for RewriteRule, otherwise it will show an error like
+    # 'Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden'
+    Options +FollowSymlinks
+
     RewriteEngine On
 
     # Determine the RewriteBase automatically and set it as environment variable.

+ 3 - 3
src/Controller/GenreController.php

@@ -40,7 +40,7 @@ class GenreController extends AbstractController
 			return $this->redirectToRoute('genre_liste');
 		}
 
-		return $this->renderForm('genre/ajouter.html.twig', array(
+		return $this->render('genre/ajouter.html.twig', array(
 			'form'	=>	$form,
 		));
 	}
@@ -59,7 +59,7 @@ class GenreController extends AbstractController
 			return $this->redirectToRoute('genre_liste');
 		}
 
-		return $this->renderForm('genre/modifier.html.twig', array(
+		return $this->render('genre/modifier.html.twig', array(
 			'form'	=> $form,
             'genre'   =>  $genre,
             'films' => $films
@@ -78,7 +78,7 @@ class GenreController extends AbstractController
             return $this->redirectToRoute('genre_liste');
         }
 
-		return $this->renderForm('genre/supprimer.html.twig', array(
+		return $this->render('genre/supprimer.html.twig', array(
 			'genre'  =>  $genre,
             'form'  =>  $form
 		));

+ 1 - 1
src/Controller/PageController.php

@@ -40,7 +40,7 @@ class PageController extends AbstractController
             return $this->redirectToRoute('app_page_show', ['name' => $page->getName()]);
         }
 
-        return $this->renderForm('page/edit.html.twig', [
+        return $this->render('page/edit.html.twig', [
             'title' => $page->getName(),
             'form'  => $form
         ]);

+ 2 - 2
src/Controller/ProfilController.php

@@ -27,7 +27,7 @@ class ProfilController extends AbstractController
             $this->addFlash('success', "Votre profil a été modifié");
         }
 
-        return $this->renderForm('profil/monprofil.html.twig', array (
+        return $this->render('profil/monprofil.html.twig', array (
             'form'  =>  $form
         ));
     }
@@ -46,7 +46,7 @@ class ProfilController extends AbstractController
             $this->addFlash('success', "Les préférences ont été modifiées");
         }
 
-        return $this->renderForm('profil/mespreferences.html.twig', [
+        return $this->render('profil/mespreferences.html.twig', [
             'form'  =>  $form
         ]);
     }

+ 3 - 3
src/Controller/RealisateurController.php

@@ -40,7 +40,7 @@ class RealisateurController extends AbstractController
 			return $this->redirectToRoute('realisateur_liste');
 		}
 
-		return $this->renderForm('realisateur/ajouter.html.twig', array(
+		return $this->render('realisateur/ajouter.html.twig', array(
 			'form'	=>	$form
 		));
 	}
@@ -59,7 +59,7 @@ class RealisateurController extends AbstractController
 			return $this->redirectToRoute('realisateur_liste');
 		}
 
-		return $this->renderForm('realisateur/modifier.html.twig', array(
+		return $this->render('realisateur/modifier.html.twig', array(
 			'form'	=> $form,
             'realisateur'   =>  $realisateur
 		));
@@ -79,7 +79,7 @@ class RealisateurController extends AbstractController
             return $this->redirectToRoute('realisateur_liste');
         }
 
-		return $this->renderForm('realisateur/supprimer.html.twig', array(
+		return $this->render('realisateur/supprimer.html.twig', array(
 			'realisateur'  =>  $realisateur,
             'form'  =>  $form
 		));

+ 7 - 7
src/Controller/SecurityController.php

@@ -56,7 +56,7 @@ class SecurityController extends AbstractController
             $this->addFlash('success', 'L\'utilisateur a été ajouté');
             return $this->redirectToRoute('admin_index');
         }
-        return $this->renderForm('security/createuser.html.twig', array (
+        return $this->render('security/createuser.html.twig', array (
             'form'  => $form
         ));
     }
@@ -72,7 +72,7 @@ class SecurityController extends AbstractController
             $this->addFlash('success', 'L\'utilisateur a été modifié');
             return $this->redirectToRoute('admin_index');
         }
-        return $this->renderForm('security/createuser.html.twig', array (
+        return $this->render('security/createuser.html.twig', array (
             'form'  => $form
         ));
     }
@@ -90,7 +90,7 @@ class SecurityController extends AbstractController
             return $this->redirectToRoute('admin_index');
         }
         
-        return $this->renderForm('profil/preferences.html.twig', [
+        return $this->render('profil/preferences.html.twig', [
             'user'  => $options->getUser(),
             'form'  => $form
         ]);
@@ -116,7 +116,7 @@ class SecurityController extends AbstractController
             $this->addFlash("success", "L'utilisateur a bien été supprimé");
             return $this->redirectToRoute('admin_index');
         }
-        return $this->renderForm('security/supprimeruser.html.twig', array (
+        return $this->render('security/supprimeruser.html.twig', array (
             'user'  =>  $user,
             'form'  =>  $form
         ));
@@ -142,7 +142,7 @@ class SecurityController extends AbstractController
             return $this->redirectToRoute('security_attente');
         }
 
-        return $this->renderForm('security/register.html.twig', [
+        return $this->render('security/register.html.twig', [
             'form'  => $form
         ]);
     }
@@ -179,7 +179,7 @@ class SecurityController extends AbstractController
                 $this->addFlash('warning', "Cet email n'existe pas");
             }
         }
-        return $this->renderForm('security/chercheruserpourpassword.html.twig', array (
+        return $this->render('security/chercheruserpourpassword.html.twig', array (
             'form'  =>  $form
         ));
     }
@@ -196,7 +196,7 @@ class SecurityController extends AbstractController
                     $this->addFlash('success', 'Mot de passe changé, veuillez vous connecter');
                     return $this->redirectToRoute('videotheque_liste');
                 }
-                return $this->renderForm('security/password.html.twig', array(
+                return $this->render('security/password.html.twig', array(
                     'form' => $form
                 ));
             }

+ 5 - 5
src/Controller/VideothequeController.php

@@ -89,7 +89,7 @@ class VideothequeController extends AbstractController
 			return $this->redirectToRoute('videotheque_voirfilm', array('id'=>$film->getId()));
 		}
 
-		return $this->renderForm('videotheque/ajouter.html.twig', array(
+		return $this->render('videotheque/ajouter.html.twig', array(
 			'form'	=>	$form,
 		));
 	}
@@ -113,7 +113,7 @@ class VideothequeController extends AbstractController
             $films = $tmdbApiService->getFilms();
         }
         
-        return $this->renderForm('videotheque/add_tmdb.html.twig', [
+        return $this->render('videotheque/add_tmdb.html.twig', [
             'titre' => 'Ajouter via TheMovieDB.org',
             'films'  => $films,
             'nbFilms'    => $nbFilms,
@@ -135,7 +135,7 @@ class VideothequeController extends AbstractController
 			return $this->redirectToRoute('videotheque_voirfilm',array('id'=>$film->getId()));
 		}
 
-		return $this->renderForm('videotheque/modifier.html.twig', array(
+		return $this->render('videotheque/modifier.html.twig', array(
 			'form'	=> $form,
 		));
 	}
@@ -153,7 +153,7 @@ class VideothequeController extends AbstractController
             return $this->redirectToRoute('videotheque_liste');
         }
 
-		return $this->renderForm('videotheque/supprimer.html.twig', array(
+		return $this->render('videotheque/supprimer.html.twig', array(
 			'film'  =>  $film,
             'form'  =>  $form
 		));
@@ -181,7 +181,7 @@ class VideothequeController extends AbstractController
             $form = $this->createForm(CommentaireType::class, null);
         }
         
-        return $this->renderForm('videotheque/voirfilm.html.twig', array(
+        return $this->render('videotheque/voirfilm.html.twig', array(
             'film' => $film,
             'form'  =>  $form
         ));

+ 1 - 1
src/Service/ActivityListener.php

@@ -3,8 +3,8 @@ namespace App\Service;
 
 use App\Entity\User;
 use Doctrine\ORM\EntityManagerInterface;
+use Symfony\Bundle\SecurityBundle\Security;
 use Symfony\Component\HttpKernel\Event\ControllerEvent;
-use Symfony\Component\Security\Core\Security;
 
 class ActivityListener
 {

+ 1 - 1
src/Service/CommentaireManager.php

@@ -5,7 +5,7 @@ namespace App\Service;
 use App\Entity\Commentaire;
 use App\Entity\Film;
 use Doctrine\ORM\EntityManagerInterface;
-use Symfony\Component\Security\Core\Security;
+use Symfony\Bundle\SecurityBundle\Security;
 use Symfony\Component\Security\Core\User\UserInterface;
 
 /**

+ 2 - 1
src/Service/FilmManager.php

@@ -5,7 +5,7 @@ namespace App\Service;
 use App\Entity\Film;
 use App\Entity\User;
 use Doctrine\ORM\EntityManagerInterface;
-use Symfony\Component\Security\Core\Security;
+use Symfony\Bundle\SecurityBundle\Security;
 
 /**
  * Class FilmManager
@@ -40,6 +40,7 @@ class FilmManager {
     public function delFilm(Film $film): void
     {
         $commentaires = $film->getCommentaires();
+        /** @var \App\Entity\Commentaire $commentaire */
         foreach($commentaires as $commentaire)
         {
             $this->cm->delCommentaire($commentaire);

+ 1 - 1
src/Service/OptionsManager.php

@@ -4,7 +4,7 @@ namespace App\Service;
 
 use App\Entity\User;
 use App\Entity\Profile;
-use Symfony\Component\Security\Core\Security;
+use Symfony\Bundle\SecurityBundle\Security;
 
 class OptionsManager
 {

+ 16 - 16
symfony.lock

@@ -28,12 +28,12 @@
         "version": "v0.5.3"
     },
     "doctrine/doctrine-bundle": {
-        "version": "2.7",
+        "version": "2.8",
         "recipe": {
             "repo": "github.com/symfony/recipes",
             "branch": "main",
-            "version": "2.4",
-            "ref": "da713d006953b90d1c085c1be480ecdd6c4a95e0"
+            "version": "2.8",
+            "ref": "6b43b7b6ff6bf2551f2933ebeb66721fa3db8fbc"
         },
         "files": [
             "config/packages/doctrine.yaml",
@@ -230,7 +230,7 @@
             "repo": "github.com/symfony/recipes-contrib",
             "branch": "main",
             "version": "1.0",
-            "ref": "9d254a22efca7264203eea98b866f16f944b2f09"
+            "ref": "efb318193e48384eb5c5aadff15396ed698f8ffc"
         },
         "files": [
             "public/.htaccess"
@@ -327,12 +327,12 @@
         "version": "v4.2.8"
     },
     "symfony/framework-bundle": {
-        "version": "5.4",
+        "version": "6.2",
         "recipe": {
             "repo": "github.com/symfony/recipes",
             "branch": "main",
-            "version": "5.4",
-            "ref": "3cd216a4d007b78d8554d44a5b1c0a446dab24fb"
+            "version": "6.2",
+            "ref": "af47254c5e4cd543e6af3e4508298ffebbdaddd3"
         },
         "files": [
             "config/packages/cache.yaml",
@@ -352,12 +352,12 @@
         "version": "v4.2.8"
     },
     "symfony/mailer": {
-        "version": "5.4",
+        "version": "6.2",
         "recipe": {
             "repo": "github.com/symfony/recipes",
             "branch": "main",
             "version": "4.3",
-            "ref": "97a61eabb351d7f6cb7702039bcfe07fe9d7e03c"
+            "ref": "2bf89438209656b85b9a49238c4467bff1b1f939"
         },
         "files": [
             "config/packages/mailer.yaml"
@@ -397,12 +397,12 @@
         "version": "v5.3.3"
     },
     "symfony/phpunit-bridge": {
-        "version": "5.4",
+        "version": "6.2",
         "recipe": {
             "repo": "github.com/symfony/recipes",
             "branch": "main",
             "version": "5.3",
-            "ref": "97cb3dc7b0f39c7cfc4b7553504c9d7b7795de96"
+            "ref": "819d3d2ffa4590eba0b8f4f3e5e89415ee4e45c3"
         },
         "files": [
             ".env.test",
@@ -445,12 +445,12 @@
         "version": "v5.1.11"
     },
     "symfony/routing": {
-        "version": "6.1",
+        "version": "6.2",
         "recipe": {
             "repo": "github.com/symfony/recipes",
             "branch": "main",
-            "version": "6.1",
-            "ref": "a44010c0d06989bd4f154aa07d2542d47caf5b83"
+            "version": "6.2",
+            "ref": "e0a11b4ccb8c9e70b574ff5ad3dfdcd41dec5aa6"
         },
         "files": [
             "config/packages/routing.yaml",
@@ -557,12 +557,12 @@
         ]
     },
     "symfony/webpack-encore-bundle": {
-        "version": "1.15",
+        "version": "1.16",
         "recipe": {
             "repo": "github.com/symfony/recipes",
             "branch": "main",
             "version": "1.10",
-            "ref": "5878c7c28468ca0fdce2497a04cfc66bab0dc3ef"
+            "ref": "f8fc53f1942f76679e9ee3c25fd44865355707b5"
         },
         "files": [
             "assets/app.js",

+ 2 - 2
templates/security/login.html.twig

@@ -12,11 +12,11 @@
                     {% endif %}
                     <label for="inputUsername" class="sr-only">Login</label>
                     <div class="input-group mb-3">
-                        <input type="text" value="{{ last_username }}" name="username" id="inputUsername" class="form-control" placeholder="Login" required autofocus>
+                        <input type="text" value="{{ last_username }}" name="_username" id="inputUsername" class="form-control" placeholder="Login" required autofocus>
                     </div>
                     <label for="inputPassword" class="sr-only">Mot de passe</label>
                     <div class="input-group mb-3">
-                        <input type="password" name="password" id="inputPassword" class="form-control" placeholder="Mot de passe" required>
+                        <input type="password" name="_password" id="inputPassword" class="form-control" placeholder="Mot de passe" required>
                     </div>
                     <input type="hidden" name="_csrf_token"
                         value="{{ csrf_token('authenticate') }}"

+ 4 - 0
tests/bootstrap.php

@@ -9,3 +9,7 @@ if (file_exists(dirname(__DIR__).'/config/bootstrap.php')) {
 } elseif (method_exists(Dotenv::class, 'bootEnv')) {
     (new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
 }
+
+if ($_SERVER['APP_DEBUG']) {
+    umask(0000);
+}

文件差异内容过多而无法显示
+ 264 - 257
yarn.lock


部分文件因为文件数量过多而无法显示