Edition de connexion_sql et ajout de gitignore et gitattributes et env
All checks were successful
Déploiement DEV / deploy (push) Successful in 8s
All checks were successful
Déploiement DEV / deploy (push) Successful in 8s
This commit is contained in:
6
.env.example
Normal file
6
.env.example
Normal 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
21
.gitattributes
vendored
Normal 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
112
.gitignore
vendored
@@ -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/
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
<?php
|
||||
|
||||
// Connexion à la base de données
|
||||
try
|
||||
{
|
||||
$bdd = new PDO('mysql:host=localhost:3306;dbname=ecurie', 'ccbuser', 'HO9A#x@qD6Wl',array(PDO::MYSQL_ATTR_INIT_COMMAND => "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()); }
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user