Skip to content
Snippets Groups Projects
Select Git revision
  • f12db57edc09bfb3f4710da29d46cf0f9092f7d6
  • main default protected
2 results

index.php

Blame
  • index.php 958 B
    <?php
    ini_set('display_errors', 1);
    ini_set('display_startup_errors', 1);
    error_reporting(E_ALL);
    
    require_once("app/helpers/config.php");
    require_once("app/helpers/views.php");
    require_once("app/models/Database.php");
    
    require_once("controller/ControleurAuteur.php");
    require_once("controller/ControleurAdherent.php");
    
    require_once("controller/ControleurLivre.php");
    
    Database::connect();
    
    if (empty($_GET["action"])) {
        echo ControleurAuteur::lireAuteurs();
    } else {
        if (in_array($_GET["action"], get_class_methods('ControleurAuteur'))) {
            $action = $_GET["action"];
            echo ControleurAuteur::$action();
        } elseif (in_array($_GET["action"], get_class_methods('ControleurAdherent'))) {
            $action = $_GET["action"];
            echo ControleurAdherent::$action();
        } elseif (in_array($_GET["action"], get_class_methods('ControleurLivre'))) {
            $action = $_GET["action"];
            echo ControleurLivre::$action();
        }
    }
    
    ?>