generated from Templates_CodeFirst/templateHtmlCss
parent
8a76b7b64e
commit
8b5d7ccad0
@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class Autoload{
|
||||||
|
private static ?Autoload $_instance = null;
|
||||||
|
|
||||||
|
public static function charger(){
|
||||||
|
if(self::$_instance != null){
|
||||||
|
throw new RuntimeException(sprintf("%s already start", __CLASS__));
|
||||||
|
}
|
||||||
|
|
||||||
|
self::$_instance = new self();
|
||||||
|
|
||||||
|
if(!spl_autoload_register(array(self::$_instance, '_autoload'))){
|
||||||
|
throw new RuntimeException('Could not stop autoload');
|
||||||
|
}
|
||||||
|
|
||||||
|
self::$_instance = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function _autoload($class){
|
||||||
|
global $rep;
|
||||||
|
$filename = $class.'.php';
|
||||||
|
$dir = array('modeles/', 'config', 'controllers');
|
||||||
|
foreach ($dir as $d){
|
||||||
|
$file=$rep.$d.$filename;
|
||||||
|
if($file_exists($file)){
|
||||||
|
include $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$rep = __DIR__ . '/../';
|
||||||
|
|
||||||
|
//$location = "Location : http://londres.uca.local/" Finir le chemin du public_html
|
||||||
|
|
||||||
|
|
||||||
|
$base=""; //nom bdd
|
||||||
|
$login="";
|
||||||
|
$password="";
|
||||||
|
$dsn=""; // chemin vers bd (mysql:host=londres.uca.local;dbname=dblibreton => pour l'iut)
|
||||||
|
|
||||||
|
|
||||||
|
$vues['erreur'] = 'Vues/erreur.php'
|
||||||
|
// A faire pour toutes les vues
|
||||||
|
|
||||||
|
?>
|
Loading…
Reference in new issue