forked from ZwiiCMS-Team/ZwiiCMS
Merge branch '10400' into data_engine
This commit is contained in:
commit
0a755dc1fa
@ -21,6 +21,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.
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user