diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..41fbd7c --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/.idea +/.project +/repositories/config.json diff --git a/repositories/StaticRepo.php b/repositories/StaticRepo.php new file mode 100755 index 0000000..cd746e9 --- /dev/null +++ b/repositories/StaticRepo.php @@ -0,0 +1,57 @@ +prepare('SELECT Annee FROM Annees + ORDER BY Annees.Annee DESC + LIMIT 1'); + $req->execute(); + $result = $req->fetch(PDO::FETCH_ASSOC); + static::$annee = $result['Annee']; + } + + return static::$annee; + } + + /** + * @return bool test de la Connexion + */ + public static function testConnexion(){ + return static::getConnexion() instanceof PDO; + } +} + +?> diff --git a/repositories/exemple_config.json b/repositories/exemple_config.json new file mode 100644 index 0000000..6469b2f --- /dev/null +++ b/repositories/exemple_config.json @@ -0,0 +1,6 @@ +{ + "host": "serveurMySql", + "login": "leLogin", + "password": "leMotDePasse", + "database": "nomBaseDeDonnée" +} diff --git a/repositories/index.html b/repositories/index.html new file mode 100755 index 0000000..e69de29