diff --git a/CHANGES.md b/CHANGES.md index a8183c40..3e8871ab 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,6 +7,7 @@ - Thème : import d'un thème, nettoyage du dossier tmp. - Thème administration : modification de l'appel du code CSS permettant une mise à jour du thème sans vider le cache. - Thème du menu : alignement inopérant ; arrière-plan semi-transparent non uniforme. + - Supprime les warning lors d'une primo installation. - Amélioration : - Thème menu : couleurs du sous menu. - Mise en page du corps des mails de notification. diff --git a/core/class/jsondb/JsonDb.class.php b/core/class/jsondb/JsonDb.class.php index 1dc7cbbd..3e9ce04c 100644 --- a/core/class/jsondb/JsonDb.class.php +++ b/core/class/jsondb/JsonDb.class.php @@ -102,29 +102,16 @@ class JsonDb extends \Prowebcraft\Dot if ($this->data === null || $reload) { // $this->db = $this->config['dir'] . DIRECTORY_SEPARATOR . $this->config['name']; $this->db = $this->config['dir'] . $this->config['name']; - /* - if (!file_exists($this->db)) { - $templateFile = $this->config['template']; - if (file_exists($templateFile)) { - copy($templateFile, $this->db); - } else { - file_put_contents($this->db, '{}'); - } - } else { - if ($this->config['backup']) { - try { - //todo make backup of database - } catch (\Exception $e) { - } + if (!file_exists($this->db)) { + return null; + } else { + $this->data = json_decode(file_get_contents($this->db), true); + if (!$this->data === null) { + throw new \InvalidArgumentException('Database file ' . $this->db + . ' contains invalid json object. Please validate or remove file'); } } - */ - $this->data = json_decode(file_get_contents($this->db), true); - if (!$this->data === null) { - throw new \InvalidArgumentException('Database file ' . $this->db - . ' contains invalid json object. Please validate or remove file'); - } } return $this->data; }