diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..190ace8 --- /dev/null +++ b/.env.example @@ -0,0 +1,6 @@ +DB_HOST=localhost +DB_PORT=3306 +DB_NAME=DB +DB_USER=USER +DB_PASS=PASS +DB_CHARSET=utf8 \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6399526 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,21 @@ +# Forcer LF pour tous les fichiers texte +* text eol=lf + +# Forcer explicitement PHP +*.php text eol=lf + +# Autres fichiers courants +*.js text eol=lf +*.css text eol=lf +*.html text eol=lf +*.yml text eol=lf +*.env text eol=lf + +# Images vectorielles +*.svg text diff eol=lf + +# Forcer WebP en fichier binaire +*.webp binary +*.png binary +*.jpg binary +*.jpeg binary \ No newline at end of file diff --git a/.gitignore b/.gitignore index aafa768..343cafb 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,111 @@ -Thumbs.db \ No newline at end of file +# ---------------------- +# Personnalisé / PHP MVC +# ---------------------- +# **/module/ +**/.env +**/*.local +**/*.config +**/config/database.php +**/documents +**/Libs + +# ---------------------- +# Node.js +# ---------------------- +node_modules/ +npm-debug.log +yarn-error.log +package-lock.json +yarn.lock + +# ---------------------- +# Python +# ---------------------- +__pycache__/ +*.py[cod] +*.pyo +*.pyd +env/ +venv/ +*.egg-info/ + +# ---------------------- +# Java +# ---------------------- +*.class +*.jar +*.war +*.ear +target/ +.idea/ +*.iml + +# ---------------------- +# Visual Studio +# ---------------------- +.vs/ +*.suo +*.user +*.userosscache +*.sln.docstates + +# ---------------------- +# macOS +# ---------------------- +.DS_Store + +# ---------------------- +# Windows +# ---------------------- +Thumbs.db +ehthumbs.db +Desktop.ini +$RECYCLE.BIN/ + +# ---------------------- +# Logs +# ---------------------- +*.log + +# ---------------------- +# IDE-specific files +# ---------------------- +.idea/ +.vscode/ +*.sublime-project +*.sublime-workspace + +# ---------------------- +# Other temporary / backup files +# ---------------------- +*.bak +*.tmp +*.swp +*.orig +*.diff +*.patch +*.sqlite +*.db +*.tar.gz +*.zip + +# ---------------------- +# Documentation +# ---------------------- +*.pdf +*.docx + +# ---------------------- +# Images +# ---------------------- +# *.png +# *.jpg +# *.jpeg +*.gif + +# ---------------------- +# Output / build directories +# ---------------------- +# dist/ +build/ +out/ diff --git a/config/connexion_sql.php b/config/connexion_sql.php index 99a8a53..1561a67 100644 --- a/config/connexion_sql.php +++ b/config/connexion_sql.php @@ -1,11 +1,16 @@ "SET NAMES utf8")); -} -catch(Exception $e) -{ - die('Erreur : '.$e->getMessage()); -} +$env = parse_ini_file(__DIR__ . '/../.env'); + +if ($env === false) { die('Impossible de charger le fichier .env'); } + +try { + $dsn = sprintf('mysql:host=%s;port=%s;dbname=%s;charset=%s', $env['DB_HOST'], $env['DB_PORT'], $env['DB_NAME'], $env['DB_CHARSET']); + $bdd = new PDO( $dsn, $env['DB_USER'], $env['DB_PASS'], + [ + PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, + PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, + PDO::ATTR_EMULATE_PREPARES => false, + ] + ); +} catch (PDOException $e) { die('Erreur : ' . $e->getMessage()); } \ No newline at end of file diff --git a/images/autres/Thumbs.db b/images/autres/Thumbs.db deleted file mode 100644 index db35106..0000000 Binary files a/images/autres/Thumbs.db and /dev/null differ diff --git a/images/avatars/Thumbs.db b/images/avatars/Thumbs.db deleted file mode 100644 index 49e10bf..0000000 Binary files a/images/avatars/Thumbs.db and /dev/null differ diff --git a/images/centre/Thumbs.db b/images/centre/Thumbs.db deleted file mode 100644 index ac281ad..0000000 Binary files a/images/centre/Thumbs.db and /dev/null differ diff --git a/images/sponsors/Thumbs.db b/images/sponsors/Thumbs.db deleted file mode 100644 index a8e7bee..0000000 Binary files a/images/sponsors/Thumbs.db and /dev/null differ