Initial commit - Mini CMS complet (PHP + Docker + MinIO)

This commit is contained in:
Aya Tess tess
2025-11-01 16:42:38 +01:00
commit 9a57013505
3035 changed files with 131442 additions and 0 deletions

41
forum-project/composer.json Executable file
View 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';
?>