From a90fb036ff67e53a4141bc0cef7f3539d656247f Mon Sep 17 00:00:00 2001 From: Pascal LAFOURCADE Date: Wed, 23 Nov 2022 09:43:43 +0100 Subject: [PATCH 01/12] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'.drone.yml'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index c0b84a9c..faf150b0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -17,7 +17,7 @@ steps: port: 22 host: sancy.iut.uca.fr username: lafourcade - target: public_html/Scripted +# target: public_html/Scripted source: WEB/* key: from_secret: DEPLOY_KEY From 333815b65d66ed88afdbcce4ca2bc3e204602662 Mon Sep 17 00:00:00 2001 From: Pascal LAFOURCADE Date: Wed, 23 Nov 2022 09:45:37 +0100 Subject: [PATCH 02/12] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'.drone.yml'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index faf150b0..389b142b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -17,11 +17,11 @@ steps: port: 22 host: sancy.iut.uca.fr username: lafourcade -# target: public_html/Scripted + target: public_html/Scripted source: WEB/* key: from_secret: DEPLOY_KEY secrets: - source: DEPLOY_KEY - target: scp_key +# target: scp_key rm: true \ No newline at end of file From 1d79fcb28d842c12f6543e276479e1f832c323ba Mon Sep 17 00:00:00 2001 From: Pascal LAFOURCADE Date: Wed, 23 Nov 2022 09:49:38 +0100 Subject: [PATCH 03/12] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'.drone.yml'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 389b142b..4d2ce915 100644 --- a/.drone.yml +++ b/.drone.yml @@ -23,5 +23,4 @@ steps: from_secret: DEPLOY_KEY secrets: - source: DEPLOY_KEY -# target: scp_key rm: true \ No newline at end of file From 5c47917c1eccdf5fb8d7982a36e241b14e76e5aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20GARNIER?= Date: Wed, 23 Nov 2022 12:31:12 +0100 Subject: [PATCH 04/12] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'WEB/Config/C?= =?UTF-8?q?onfig.php'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WEB/Config/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WEB/Config/Config.php b/WEB/Config/Config.php index 1bd68050..abebfce2 100644 --- a/WEB/Config/Config.php +++ b/WEB/Config/Config.php @@ -1,6 +1,6 @@ Date: Wed, 23 Nov 2022 12:45:35 +0100 Subject: [PATCH 05/12] Correction de la classe partie, suppression de la liste de joueur inutile --- WEB/Controller/PartieGateway.php | 4 ++-- WEB/Factory/PartieFactory.php | 4 ++-- WEB/Model/Partie.php | 10 ---------- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/WEB/Controller/PartieGateway.php b/WEB/Controller/PartieGateway.php index ebda73e4..d94368d9 100644 --- a/WEB/Controller/PartieGateway.php +++ b/WEB/Controller/PartieGateway.php @@ -12,7 +12,7 @@ class PartieGateway { $this->con = $con; } - public function creerPartie($listeEmailJoueur){ + public function creerPartie(){ $query = "SELECT * FROM Enigme"; $this->con->executeQuery($query); $results = $this->con->getResults(); @@ -20,7 +20,7 @@ class PartieGateway FROM PARTIE p;"; $this->con->executeQuery($query); $max=$this->con->getResults()[0]; - $partie=PartieFactory::createPartie($max,$results,$listeEmailJoueur); + $partie=PartieFactory::createPartie($max,$results); $query= "INSERT INTO Partie VALUES (:idPartie,:idEnigme)"; $this->con->executeQuery($query, array(':idPartie' => array($partie->getIdPartie(), PDO::PARAM_STR))); foreach($partie->getListeEnigme() as $Enigme){ diff --git a/WEB/Factory/PartieFactory.php b/WEB/Factory/PartieFactory.php index 7db30e91..64f7774b 100644 --- a/WEB/Factory/PartieFactory.php +++ b/WEB/Factory/PartieFactory.php @@ -2,7 +2,7 @@ include_once "EnigmeFactory.php"; include_once "../Model/Partie.php"; class PartieFactory{ - public static function createPartie($idMax,$resultsEnigme,$listeEmailJoueur) : Partie + public static function createPartie($idMax,$resultsEnigme) : Partie { $tempsResolutionPartie=0; $tabEnigme=array(); @@ -15,7 +15,7 @@ class PartieFactory{ $TempsResolutionPartie+=$resultsEnigme[$randomNumber]['tempsDeResolution']; unset($tabIndex[$randomNumber]); } - $partie=new Partie($idMax,$resultsEnigme,$listeEmailJoueur); + $partie=new Partie($idMax,$resultsEnigme); return $partie; } //public static function createListePartie() diff --git a/WEB/Model/Partie.php b/WEB/Model/Partie.php index 74354ea7..c2d66e7c 100644 --- a/WEB/Model/Partie.php +++ b/WEB/Model/Partie.php @@ -7,7 +7,6 @@ class Partie private string $idPartie; private $datePartie; private array $listeEnigme; - private array $listeEmailJoueur; /** * @param string $idPartie @@ -18,7 +17,6 @@ class Partie $this->idPartie = $idPartie; $this->datePartie = getdate(); $this->$listeEnigme = $listeEnigme; - $this->$listeEmailJoueur= $listeEmailJoueur; } /** @@ -65,12 +63,4 @@ class Partie { $this->listeEnigme = $listeEnigme; } - public function getListeEmailJoueur(): array - { - return $this->listeEmailJoueur; - } - public function setListeEmailJoueur(array $listeEmailJoueur) - { - $this->listeEmailJoueur=$listeEmailJoueur; - } } \ No newline at end of file From 560129dcf1a22d8b3c75623ab93f7183e290e5c7 Mon Sep 17 00:00:00 2001 From: Noe GARNIER Date: Wed, 23 Nov 2022 12:49:57 +0100 Subject: [PATCH 06/12] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'WEB/Config/C?= =?UTF-8?q?onfig.php'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WEB/Config/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WEB/Config/Config.php b/WEB/Config/Config.php index abebfce2..8b613a6f 100644 --- a/WEB/Config/Config.php +++ b/WEB/Config/Config.php @@ -1,6 +1,6 @@ Date: Wed, 23 Nov 2022 12:53:10 +0100 Subject: [PATCH 07/12] =?UTF-8?q?Test=20de=20d=C3=A9ploiment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WEB/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WEB/index.php b/WEB/index.php index b9c89993..5a10b12d 100644 --- a/WEB/index.php +++ b/WEB/index.php @@ -2,9 +2,10 @@ require_once('./Config/Config.php'); require_once('./Config/Autoload.php'); Autoload::charger(); - +echo "post"; $con = new Connection($dsn, $user, $password); $control = new Controller($con); +echo "after"; session_regenerate_id(true); // session_unset(); From c67f58274bd8fafdc10b02d776f116e001d5d802 Mon Sep 17 00:00:00 2001 From: Noe GARNIER Date: Wed, 23 Nov 2022 12:54:37 +0100 Subject: [PATCH 08/12] =?UTF-8?q?Test=20de=20d=C3=A9ploiment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WEB/Controller/Controller.php | 1 + 1 file changed, 1 insertion(+) diff --git a/WEB/Controller/Controller.php b/WEB/Controller/Controller.php index 39139345..ab1125a6 100644 --- a/WEB/Controller/Controller.php +++ b/WEB/Controller/Controller.php @@ -12,6 +12,7 @@ class Controller $this->con=$con; session_start(); try{ + echo "control"; global $rep, $vues, $error; $action=$_REQUEST['action']; switch($action) { From 720e572baa14aa8f62bb9719537b41b4d470d44b Mon Sep 17 00:00:00 2001 From: Noe GARNIER Date: Wed, 23 Nov 2022 12:56:47 +0100 Subject: [PATCH 09/12] =?UTF-8?q?Test=20de=20d=C3=A9ploiment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WEB/Config/Config.php | 2 +- WEB/Controller/Controller.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/WEB/Config/Config.php b/WEB/Config/Config.php index 8b613a6f..1bd68050 100644 --- a/WEB/Config/Config.php +++ b/WEB/Config/Config.php @@ -1,6 +1,6 @@ con=$con; session_start(); try{ - echo "control"; + echo "controller"; global $rep, $vues, $error; $action=$_REQUEST['action']; switch($action) { From af6bb631c3d3153f4a8b28144ecfc22452c033e0 Mon Sep 17 00:00:00 2001 From: Noe GARNIER Date: Wed, 23 Nov 2022 13:00:44 +0100 Subject: [PATCH 10/12] =?UTF-8?q?Test=20de=20d=C3=A9ploiment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WEB/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/WEB/index.php b/WEB/index.php index 5a10b12d..4101079d 100644 --- a/WEB/index.php +++ b/WEB/index.php @@ -4,6 +4,7 @@ require_once('./Config/Autoload.php'); Autoload::charger(); echo "post"; $con = new Connection($dsn, $user, $password); +echo "con"; $control = new Controller($con); echo "after"; From faec06a43d9096136540d80c46ac39863662ae64 Mon Sep 17 00:00:00 2001 From: Johan LACHENAL Date: Wed, 23 Nov 2022 13:05:31 +0100 Subject: [PATCH 11/12] =?UTF-8?q?Ajout=20d'une=20fonction=20pour=20faire?= =?UTF-8?q?=20un=20historique=20a=20optimis=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WEB/Controller/PartieGateway.php | 21 +++++++++++++++++++++ WEB/Factory/PartieFactory.php | 1 - WEB/Model/Partie.php | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/WEB/Controller/PartieGateway.php b/WEB/Controller/PartieGateway.php index d94368d9..355955c1 100644 --- a/WEB/Controller/PartieGateway.php +++ b/WEB/Controller/PartieGateway.php @@ -35,6 +35,27 @@ class PartieGateway $this->con->executeQuery($query, array(':idPartie' => array($idPartie, PDO::PARAM_STR))); } + public function findOldListePartie() : array{ + $query="SELECT * FROM Partie"; + $this->con->executeQuery($query); + $results = $this->con->getResults(); + $query= "SELECT max(p.id) + FROM PARTIE p;"; + $this->con->executeQuery($query); + $max=$this->con->getResults()[0]; + $listePartie=array(); + foreach($results as $row) + { + $query = "SELECT e.* FROM Enigme e,Contenir c,Partie p + WHERE p.id = c.partie + AND c.enigme = e.id"; + $this->con->executeQuery($query); + $listeEnigme=$this->con->getResults(); + $listePartie=PartieFactory::createPartie($max,$listeEnigme); + } + return $listePartie; + } + public function findOldListeEnigme(string $partie) : array{ $query= "SELECT * FROM Enigme e,Contenir c AND c.partie = :idPartie diff --git a/WEB/Factory/PartieFactory.php b/WEB/Factory/PartieFactory.php index 64f7774b..a581e71a 100644 --- a/WEB/Factory/PartieFactory.php +++ b/WEB/Factory/PartieFactory.php @@ -18,5 +18,4 @@ class PartieFactory{ $partie=new Partie($idMax,$resultsEnigme); return $partie; } - //public static function createListePartie() } \ No newline at end of file diff --git a/WEB/Model/Partie.php b/WEB/Model/Partie.php index c2d66e7c..860f4cf5 100644 --- a/WEB/Model/Partie.php +++ b/WEB/Model/Partie.php @@ -12,7 +12,7 @@ class Partie * @param string $idPartie * @param array $datePartie */ - public function __construct(string $idPartie, array $listeEnigme, array $listeEmailJoueur) + public function __construct(string $idPartie, array $listeEnigme) { $this->idPartie = $idPartie; $this->datePartie = getdate(); From 5892d96c97bf8712c705857fe88cb77f4532b539 Mon Sep 17 00:00:00 2001 From: Noe GARNIER Date: Wed, 23 Nov 2022 13:18:53 +0100 Subject: [PATCH 12/12] =?UTF-8?q?Test=20de=20d=C3=A9ploiment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WEB/Controller/Controller.php | 1 - WEB/index.php | 3 --- 2 files changed, 4 deletions(-) diff --git a/WEB/Controller/Controller.php b/WEB/Controller/Controller.php index 928b9c3f..58da48ec 100644 --- a/WEB/Controller/Controller.php +++ b/WEB/Controller/Controller.php @@ -11,7 +11,6 @@ class Controller $this->con=$con; session_start(); try{ - echo "controller"; global $rep, $vues, $error; $action=$_REQUEST['action']; switch($action) { diff --git a/WEB/index.php b/WEB/index.php index 4101079d..ff27a6bc 100644 --- a/WEB/index.php +++ b/WEB/index.php @@ -2,11 +2,8 @@ require_once('./Config/Config.php'); require_once('./Config/Autoload.php'); Autoload::charger(); -echo "post"; $con = new Connection($dsn, $user, $password); -echo "con"; $control = new Controller($con); -echo "after"; session_regenerate_id(true); // session_unset();