jsonDb supprimer init modèle données

This commit is contained in:
Fred Tempez 2020-09-18 04:10:13 +02:00
parent 0c08e387b7
commit c0aaa15ad5
1 changed files with 2 additions and 0 deletions

View File

@ -101,6 +101,7 @@ class JsonDb extends \Prowebcraft\Dot
protected function loadData($reload = false) {
if ($this->data === null || $reload) {
$this->db = $this->config['dir'] . DIRECTORY_SEPARATOR . $this->config['name'];
/*
if (!file_exists($this->db)) {
$templateFile = $this->config['template'];
if (file_exists($templateFile)) {
@ -117,6 +118,7 @@ class JsonDb extends \Prowebcraft\Dot
}
}
}
*/
$this->data = json_decode(file_get_contents($this->db), true);
if (!$this->data === null) {
throw new \InvalidArgumentException('Database file ' . $this->db