ajout des fichiers nécessaire
continuous-integration/drone/push Build is passing Details

pull/130/head
Vincent ASTOLFI 2 years ago
parent 792e42f27b
commit 19f6b56233

@ -0,0 +1,32 @@
<?php
class Autoload{
private static $_instance = null;
public static function charger(){
if(null!==self::$_instance){
throw new RuntimeException(sprintf("%s is already started",__CLASS__));
}
self::$_instance=new self();
if(!spl_autoload_register(array(self::$_instance,'_autoload'),true)){
throw new RuntimeException(sprintf("%s : Could not start the autoload",__CLASS__));
}
}
private static function _autoload($class){
global $rep;
$filename = $class.'.php';
$dir=array("./","config/","controler/");
foreach($dir as $d){
$file=$rep.$d.$filename;
// echo "<p>$file</p>";
if(file_exists($file)){
include $file;
}
}
}
}
?>

@ -0,0 +1,9 @@
<?php
//prefixe
$rep=__DIR__.'/../';
$dsn='mysql:host=10.9.0.67;dbname='.getenv("MARIADB_DATABASE");
$dbname=getenv("MARIADB_DATABASE");
$usr=getenv("MARIADB_USER");
$mdp=getenv("MARIADB_PASSWORD");
?>
Loading…
Cancel
Save