aboutsummaryrefslogtreecommitdiff
path: root/class/class.app.php
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2018-03-17 12:33:32 +0100
committervincent-peugnet <v.peugnet@free.fr>2018-03-17 12:33:32 +0100
commit6429cb3f90a23fd1aae0d2298c54e8a88d213bcf (patch)
treeec078a915c5bd04446a59893766a4cbdf0b652d7 /class/class.app.php
parent53a5f6b267b1deb8c5f10973c1a238ff74a33e5a (diff)
downloadwcms-6429cb3f90a23fd1aae0d2298c54e8a88d213bcf.tar.gz
wcms-6429cb3f90a23fd1aae0d2298c54e8a88d213bcf.zip
Added app class and reorganisation of the folders
Diffstat (limited to 'class/class.app.php')
-rw-r--r--class/class.app.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/class/class.app.php b/class/class.app.php
new file mode 100644
index 0000000..4078c17
--- /dev/null
+++ b/class/class.app.php
@@ -0,0 +1,30 @@
+<?php
+class App
+{
+ protected $bdd;
+
+ public function __construct($config)
+ {
+ $host = $config['host'];
+ $dbname = $config['dbname'];
+ $user = $config['user'];
+ $password = $config['password'];
+ try {
+ $this->bdd = new PDO('mysql:host=' . $host . ';dbname=' . $dbname . ';charset=utf8', $user, $password);
+ } catch (Exeption $e) {
+ die('Erreur : ' . $e->getMessage());
+ }
+ }
+
+ public function getBdd()
+ {
+ return $this->bdd;
+ }
+
+ public function createfrombdd($id, $bdd)
+ {
+
+ }
+
+}
+?> \ No newline at end of file