diff options
Diffstat (limited to 'w/class/modelconfig.php')
-rw-r--r-- | w/class/modelconfig.php | 39 |
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 |