projetAcoBDDv30.03.26

This commit is contained in:
Aco
2026-03-30 16:10:26 +02:00
parent fedbf51c91
commit 455eee67f7
42 changed files with 2018 additions and 0 deletions

53
projetphp/config/BDD.php Normal file
View File

@@ -0,0 +1,53 @@
<?php
class BDD{
private static ?PDO $pdo=null;
public const DB_NAME = 'siterecette';
private static string $db_name=BDD::DB_NAME;
public static function getPDO(){
if(self::$pdo==null){
$db_host = "127.0.0.1" ; $db_port = "3306" ;
// identifiant
$db_user = "admin" ; $db_pwd = "adminpass123" ;
// connection a la database
try{
$dsn = 'mysql:dbname=' . self::$db_name . ';host='. $db_host. ';port=' . $db_port;
$pdoo = new PDO($dsn, $db_user, $db_pwd);
}
//erreur?
catch (\Exception $ex){ ?>
Code : <?= $ex->getCode() ?><br> Message : <?= $ex->getMessage() ?>
<?php
die("message d'arreet connexion stopee") ;}
self::$pdo = $pdoo;
}
return self::$pdo;
}
public function getname(){
return self::$db_name;
}
}
?>

View File

@@ -0,0 +1,8 @@
<?php
return [
'website_url' => 'http://127.0.0.1:8080/',
'website_name' => 'Les recettes des Papis',
'website_path' => APP_ROOT,
];

View File

@@ -0,0 +1,6 @@
<?php
return [
'{int}' => '([0-9]+)',
'{chars}' => '([A-Za-z]+)',
'{string}' => '([0-9A-Za-z]+)',
];

View File

@@ -0,0 +1,4 @@
<?php
return [
'base_view_skeleton' => 'base'
];