aboutsummaryrefslogtreecommitdiff
path: root/w/class/modelconfig.php
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2018-10-25 20:25:05 +0200
committervincent-peugnet <v.peugnet@free.fr>2018-10-25 20:25:05 +0200
commita91c916248f967da2d4218b575e665242b7c975b (patch)
tree3c767e9b7b62161253aef2d93030f4b38fd47d49 /w/class/modelconfig.php
parent7b2e48276b2a3ceff83c906d38077f8d0479c3df (diff)
downloadwcms-a91c916248f967da2d4218b575e665242b7c975b.tar.gz
wcms-a91c916248f967da2d4218b575e665242b7c975b.zip
phoenixreborn\'NWY
Diffstat (limited to 'w/class/modelconfig.php')
-rw-r--r--w/class/modelconfig.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/w/class/modelconfig.php b/w/class/modelconfig.php
new file mode 100644
index 0000000..748edb1
--- /dev/null
+++ b/w/class/modelconfig.php
@@ -0,0 +1,39 @@
+<?php
+
+class Modelconfig extends Model
+{
+ public function readconfig()
+ {
+ if (file_exists(self::CONFIG_FILE)) {
+ $current = file_get_contents(self::CONFIG_FILE);
+ $donnees = json_decode($current, true);
+ return new Config($donnees);
+ } else {
+ return 0;
+ }
+
+ }
+
+ public function createconfig(array $donnees)
+ {
+ return new Config($donnees);
+ }
+
+
+ public function savejson(string $json)
+ {
+ file_put_contents(self::CONFIG_FILE, $json);
+ }
+
+
+
+
+}
+
+
+
+
+
+
+
+?> \ No newline at end of file