parent
ca79f102cf
commit
7772e9da45
@ -0,0 +1,6 @@
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteBase /php/public/
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^(.*)$ index.php [QSA,L]
|
||||
</IfModule>
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
/** PC IUT - PHP 8.1 */
|
||||
|
||||
/** Chargement config */
|
||||
require_once __DIR__ . '/src/config/config.php';
|
||||
require __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
|
||||
/** Configuration twig */
|
||||
$loader = new \Twig\Loader\FilesystemLoader('vues');
|
||||
$twig = new \Twig\Environment($loader, [
|
||||
'cache' => false,
|
||||
'debug' => true
|
||||
]);
|
||||
|
||||
$cont = new App\controleur\FrontControleur();
|
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/** PC IUT - PHP 8.1 */
|
||||
|
||||
/** Chargement config */
|
||||
require_once __DIR__ . '/../src/config/config.php';
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
|
||||
/** Configuration twig */
|
||||
$loader = new \Twig\Loader\FilesystemLoader(__DIR__ . '/../templates');
|
||||
$twig = new \Twig\Environment($loader, [
|
||||
'cache' => false,
|
||||
'debug' => true
|
||||
]);
|
||||
|
||||
$cont = new \App\controleur\FrontControleur();
|
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
spl_autoload_register(function ($class) {
|
||||
$prefix = 'MyProject\\';
|
||||
$baseDir = __DIR__;
|
||||
|
||||
$class = ltrim($class, '\\');
|
||||
$file = '';
|
||||
|
||||
if (0 === strpos($class, $prefix)) {
|
||||
$class = substr($class, strlen($prefix));
|
||||
$file = $baseDir . '/' . str_replace('\\', '/', $class) . '.php';
|
||||
}
|
||||
|
||||
if (file_exists($file)) {
|
||||
require $file;
|
||||
}
|
||||
});
|
@ -1,26 +1,28 @@
|
||||
<?php
|
||||
namespace App\dal\gateway;
|
||||
namespace App\gateway;
|
||||
use PDO;
|
||||
|
||||
class AlumniGateway
|
||||
{
|
||||
private \App\dal\Connection $con;
|
||||
private \App\gateway\Connection $con;
|
||||
|
||||
/**
|
||||
* @param $con
|
||||
*/
|
||||
public function __construct(\App\dal\Connection $con){
|
||||
public function __construct(\App\gateway\Connection $con){
|
||||
$this->con = $con;
|
||||
}
|
||||
|
||||
public function insert(string $email, string $motDePasse, string $role){
|
||||
$query='INSERT INTO Alumni VALUES (:e, :m, :r)';
|
||||
$query = 'INSERT INTO Alumni (mail, mdp, role) VALUES (:mail, :mdp, :role)';
|
||||
return $this->con->executeQuery($query, array(
|
||||
':e' => array($email, PDO::PARAM_STR),
|
||||
':m' => array($motDePasse, PDO::PARAM_STR),
|
||||
':r' => array($role, PDO::PARAM_STR)
|
||||
':mail' => array($email, PDO::PARAM_STR),
|
||||
':mdp' => array($motDePasse, PDO::PARAM_STR),
|
||||
':role' => array($role, PDO::PARAM_STR)
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
public function updateEmail(int $id, string $newEmail){
|
||||
$query='UPDATE Alumni SET email=:new WHERE id=:i';
|
||||
$this->con->executeQuery($query, array(
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace App\dal;
|
||||
namespace App\gateway;
|
||||
use PDO;
|
||||
|
||||
class Connection extends \PDO {
|
||||
|
||||
/**
|
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
namespace App\dal\gateway;
|
||||
namespace App\gateway;
|
||||
class EvenementGateway
|
||||
{
|
||||
private \App\dal\Connection $con;
|
||||
private \App\gateway\Connection $con;
|
||||
|
||||
/**
|
||||
* @param $con
|
||||
*/
|
||||
public function __construct(\App\dal\Connection $con){
|
||||
public function __construct(\App\gateway\Connection $con){
|
||||
$this->con = $con;
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
namespace App\dal\gateway;
|
||||
namespace App\gateway;
|
||||
class OffreGateway
|
||||
{
|
||||
private \App\dal\Connection $con;
|
||||
private \App\gateway\Connection $con;
|
||||
|
||||
/**
|
||||
* @param $con
|
||||
*/
|
||||
public function __construct(\App\dal\Connection $con){
|
||||
public function __construct(\App\gateway\Connection $con){
|
||||
$this->con = $con;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\metier;
|
||||
namespace App\modele;
|
||||
|
||||
class Alumni{
|
||||
/**
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
namespace App\metier;
|
||||
namespace App\modele;
|
||||
|
||||
class Article
|
||||
{
|
||||
/**
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
namespace App\metier;
|
||||
namespace App\modele;
|
||||
|
||||
class Evenement
|
||||
{
|
||||
/**
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
namespace App\metier;
|
||||
namespace App\modele;
|
||||
|
||||
class Experience
|
||||
{
|
||||
/**
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
namespace App\metier;
|
||||
namespace App\modele;
|
||||
|
||||
class Formation
|
||||
{
|
||||
/**
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\models;
|
||||
namespace App\modele;
|
||||
|
||||
class MembreModele extends UtilisateurModele
|
||||
{
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
namespace App\metier;
|
||||
namespace App\modele;
|
||||
|
||||
class Profil
|
||||
{
|
||||
/**
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
namespace App\metier;
|
||||
namespace App\modele;
|
||||
enum Role
|
||||
{
|
||||
case Admin;
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\models;
|
||||
|
||||
class ModerateurControleur
|
||||
{
|
||||
|
||||
}
|
Binary file not shown.
Loading…
Reference in new issue