Initial commit - Mini CMS complet (PHP + Docker + MinIO)
This commit is contained in:
41
forum-project/composer.json
Executable file
41
forum-project/composer.json
Executable file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
|
||||
// Connexion à la base de données avec PDO
|
||||
try {
|
||||
$pdo = new PDO(
|
||||
'mysql:host=mysql;dbname=forum_database;charset=utf8mb4',
|
||||
'myuser',
|
||||
'mypassword',
|
||||
[
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC
|
||||
]
|
||||
);
|
||||
} catch (PDOException $e) {
|
||||
die("Erreur de connexion à la base MySQL : " . $e->getMessage());
|
||||
}
|
||||
|
||||
// 🔥 Import du SDK AWS (pour MinIO)
|
||||
require_once __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
use Aws\S3\S3Client;
|
||||
|
||||
// 🔧 Initialisation du client S3 pour MinIO
|
||||
$s3Client = new S3Client([
|
||||
'version' => 'latest',
|
||||
'region' => 'us-east-1',
|
||||
'endpoint' => 'http://minio:9000', // URL interne Docker
|
||||
'use_path_style_endpoint' => true,
|
||||
'credentials' => [
|
||||
'key' => 'minioadmin',
|
||||
'secret' => 'minioadmin'
|
||||
]
|
||||
]);
|
||||
|
||||
// 🔹 Nom du bucket utilisé
|
||||
$bucketName = 'bucketforum';
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user