.env en moins normalement
This commit is contained in:
parent
f1ef53c4ac
commit
c8343faec7
4 changed files with 9 additions and 12 deletions
4
.env
4
.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/
|
||||
|
|
|
|||
|
|
@ -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é ---
|
||||
<FilesMatch ".env">
|
||||
Require all denied
|
||||
</FilesMatch>
|
||||
|
||||
<FilesMatch "(composer\.json|composer\.lock|package\.json|package-lock\.json|\.git)">
|
||||
<FilesMatch "(composer\.json|composer\.lock|package\.json|package-lock\.json|\.git|\.env|\.gitignore|env)">
|
||||
Require all denied
|
||||
</FilesMatch>
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,6 @@
|
|||
}
|
||||
|
||||
if ($boolError) {
|
||||
header("Location: index.php?ctrl=error&action=error_404");
|
||||
exit;
|
||||
$error = new \Controllers\ErrorCtrl();
|
||||
return $error->error_404();
|
||||
}
|
||||
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue