aboutsummaryrefslogtreecommitdiff
path: root/app/class/Modelconfig.php
blob: 518f64e119e926f863eb511e5d7e73927223dd1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php

namespace Wcms;

abstract class Modelconfig extends Model
{
    public static 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 static function createconfig(array $donnees)
	{
		return new Config($donnees);
	}


	public static function savejson(string $json)
	{
		file_put_contents(self::CONFIG_FILE, $json);
	}




}







?>