diff --git a/.idea/ScienceQuest.iml b/.idea/ScienceQuest.iml index c956989..310f67d 100755 --- a/.idea/ScienceQuest.iml +++ b/.idea/ScienceQuest.iml @@ -1,7 +1,13 @@ - + + + + + + + diff --git a/.idea/deployment.xml b/.idea/deployment.xml new file mode 100644 index 0000000..5c278a3 --- /dev/null +++ b/.idea/deployment.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml index 0e09af4..a1827cd 100755 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -1,6 +1,22 @@ + + + + + + + + + + \ No newline at end of file diff --git a/project/src/config/config.php b/project/src/config/config.php index 65885b1..cd6acdd 100755 --- a/project/src/config/config.php +++ b/project/src/config/config.php @@ -3,13 +3,8 @@ namespace config; $config = [ "rep" => __DIR__.'/../', + "db" => ["dsn" => 'pgsql:host=localhost;dbname=dbrebeuret', "login" => 'rebeuret', - "mdp" => 'achanger'], - "templates" => ["index" => 'vues/index.php', - "pseudo" => 'pseudo.html', - "pendu" => "pendu.html", - "penduScore" => 'penduScore.html'] -]; - -?> \ No newline at end of file + "mdp" => 'achanger'] +]; \ No newline at end of file diff --git a/project/src/controller/FrontController.php b/project/src/controller/FrontController.php index 012275a..ce5e709 100755 --- a/project/src/controller/FrontController.php +++ b/project/src/controller/FrontController.php @@ -13,6 +13,7 @@ class FrontController private Connection $con; public function __construct() { + global $twig, $router; global $basePath; @@ -22,6 +23,7 @@ class FrontController $router->map('GET|POST','/[a:action]?','UserController'); $router->map('GET|POST','/admin/[a:action]','AdminController'); + $router->map('GET|POST', '/validationFormulaire', 'validationFormulaire'); $router->map('GET|POST', '/logout', 'disconnect'); @@ -85,7 +87,6 @@ class FrontController exit(0); } - private function callController(string $cont, array $match) { global $twig; diff --git a/project/src/controller/JouerController.php b/project/src/controller/JouerController.php new file mode 100644 index 0000000..6d544e8 --- /dev/null +++ b/project/src/controller/JouerController.php @@ -0,0 +1,40 @@ +getJeu()->getId(); + switch($idJeu){ + case 3: + new PenduController($role, $configurationJeu); + break; + default: + throw new Exception("Jeu non défini !"); + break; + } + } + }else{ + header("Location: ."); + } + } +} \ No newline at end of file diff --git a/project/src/controller/PseudoController.php b/project/src/controller/PseudoController.php index cf4ad97..9b3c4cf 100755 --- a/project/src/controller/PseudoController.php +++ b/project/src/controller/PseudoController.php @@ -27,6 +27,7 @@ class PseudoController{ }catch(IdSessionDoubleException $e){ try{ $role = $mdlInvite->setPseudo($e->getIdJoueur(), $pseudo); + }catch(PseudoDejaPrisException $e){ $dVueErreur[] = "Pseudo déjà pris"; } diff --git a/project/src/db.sql b/project/src/db.sql index 9cc2a25..d8fef29 100755 --- a/project/src/db.sql +++ b/project/src/db.sql @@ -1,3 +1,4 @@ + -- Testé sous pgsql 15 DROP TABLE IF EXISTS Reponse; @@ -77,7 +78,6 @@ CREATE TABLE Indice( idScientifique integer REFERENCES Scientifique(id) ); - -- QUESTION CREATE TABLE Question( diff --git a/project/src/vendor/composer/installed.json b/project/src/vendor/composer/installed.json index 7f05e85..2db2163 100755 --- a/project/src/vendor/composer/installed.json +++ b/project/src/vendor/composer/installed.json @@ -25,7 +25,7 @@ }, "time": "2020-03-09T08:34:59+00:00", "type": "library", - "installation-source": "dist", + "installation-source": "source", "autoload": { "classmap": [ "AltoRouter.php" @@ -98,7 +98,7 @@ "url": "https://github.com/symfony/polyfill" } }, - "installation-source": "dist", + "installation-source": "source", "autoload": { "files": [ "bootstrap.php" @@ -183,7 +183,7 @@ "url": "https://github.com/symfony/polyfill" } }, - "installation-source": "dist", + "installation-source": "source", "autoload": { "files": [ "bootstrap.php" @@ -254,7 +254,7 @@ }, "time": "2023-09-14T14:19:27+00:00", "type": "library", - "installation-source": "dist", + "installation-source": "source", "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" @@ -313,7 +313,7 @@ }, "time": "2023-08-28T11:09:02+00:00", "type": "library", - "installation-source": "dist", + "installation-source": "source", "autoload": { "psr-4": { "Twig\\": "src/" diff --git a/project/src/vendor/composer/installed.php b/project/src/vendor/composer/installed.php index 8e75056..ddf00b7 100755 --- a/project/src/vendor/composer/installed.php +++ b/project/src/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => '__root__', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '4faf5aeca4c05c9018b964ff1861f0cf14a736b4', + 'reference' => '00bb454e9942b812011d11c9ae30149a30c65d99', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ '__root__' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '4faf5aeca4c05c9018b964ff1861f0cf14a736b4', + 'reference' => '00bb454e9942b812011d11c9ae30149a30c65d99', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(),