From 7b0dd06b37fdc03bef69bd7cd6561b5e39eaf737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Garnier?= Date: Sat, 26 Nov 2022 15:54:57 +0100 Subject: [PATCH] =?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/UserController.php | 13 ++++++++----- WEB/index.php | 3 +-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/WEB/Controller/UserController.php b/WEB/Controller/UserController.php index f85d4941..29dd807d 100644 --- a/WEB/Controller/UserController.php +++ b/WEB/Controller/UserController.php @@ -5,12 +5,11 @@ class UserController private Connection $con; function __construct() { - global $dsn; - echo "userController"; - $this->con=new Connection ($dsn); - echo "USconection"; try{ - global $rep, $vues, $error; + global $dsn, $rep, $vues, $error; + echo "userController"; + $this->con=new Connection ($dsn); + echo "USconection"; $action=$_REQUEST['action']; switch($action) { case NULL: @@ -39,6 +38,10 @@ class UserController break; } } catch (PDOException $e) + { + $error = $e->getMessage(); + require ($rep.$vues['erreur']); + }catch (Exception $e) { $error = $e->getMessage(); require ($rep.$vues['erreur']); diff --git a/WEB/index.php b/WEB/index.php index e759681d..a9704cb1 100644 --- a/WEB/index.php +++ b/WEB/index.php @@ -18,8 +18,7 @@ Autoload::charger(); // } echo "test"; -require ($rep.$vues['main']); -// $control = new FrontController(); +$control = new FrontController(); //session_regenerate_id(true);