Edition de connexion_sql et ajout de gitignore et gitattributes et env
All checks were successful
Déploiement DEV / deploy (push) Successful in 8s

This commit is contained in:
Christian CUNAT-BRULE
2026-08-06 21:34:19 +02:00
parent 8c49242c56
commit 7550bd1a30
8 changed files with 152 additions and 10 deletions

6
.env.example Normal file
View File

@@ -0,0 +1,6 @@
DB_HOST=localhost
DB_PORT=3306
DB_NAME=DB
DB_USER=USER
DB_PASS=PASS
DB_CHARSET=utf8

21
.gitattributes vendored Normal file
View File

@@ -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

112
.gitignore vendored
View File

@@ -1 +1,111 @@
Thumbs.db # ----------------------
# 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/

View File

@@ -1,11 +1,16 @@
<?php <?php
// Connexion à la base de données $env = parse_ini_file(__DIR__ . '/../.env');
try
{ if ($env === false) { die('Impossible de charger le fichier .env'); }
$bdd = new PDO('mysql:host=localhost:3306;dbname=ecurie', 'ccbuser', 'HO9A#x@qD6Wl',array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
} try {
catch(Exception $e) $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'],
die('Erreur : '.$e->getMessage()); [
} 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()); }

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.