diff --git a/.env b/.env index 224a3e6..618baab 100644 --- a/.env +++ b/.env @@ -1,9 +1,9 @@ # config BDD DB_CONNECTION=mysql -DB_HOSTNAME=boulayoune.com +DB_HOSTNAME=localhost DB_DATABASE=projet_folliow -DB_USERNAME= +DB_USERNAME=root DB_PASSWORD= IMG_PROJECT_PATH = uploads/projects/ diff --git a/.htaccess b/.htaccess index b0d792e..697ae9f 100644 --- a/.htaccess +++ b/.htaccess @@ -1,14 +1,11 @@ Options -Indexes -# Rediriger les erreurs serveur vers ton contrôleur -# On force le passage par index.php pour que ton routeur reçoive les paramètres -ErrorDocument 404 /index.php?ctrl=error&action=error_404 -ErrorDocument 403 /index.php?ctrl=error&action=error_403 + # --- Sécurité --- Require all denied - + Require all denied diff --git a/index.php b/index.php index 0b6c7b0..0302ebf 100644 --- a/index.php +++ b/index.php @@ -26,6 +26,6 @@ } if ($boolError) { - header("Location: index.php?ctrl=error&action=error_404"); - exit; + $error = new \Controllers\ErrorCtrl(); + return $error->error_404(); } \ No newline at end of file diff --git a/models/MotherModel.php b/models/MotherModel.php index df9f2f7..079d791 100644 --- a/models/MotherModel.php +++ b/models/MotherModel.php @@ -10,9 +10,9 @@ public function __construct(){ try{ $this->_db = new PDO( - "mysql:host=localhost;dbname=projet_folliow", - "projet_user", - "F0lliowRules!", + "mysql:host=".$_ENV['DB_HOSTNAME'].";dbname=".$_ENV['DB_DATABASE'], + $_ENV['DB_USERNAME'], + $_ENV['DB_PASSWORD'], array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC) ); $this->_db->exec("SET CHARACTER SET utf8");