diff options
| author | polo <ordipolo@gmx.fr> | 2026-06-25 23:17:35 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2026-06-25 23:41:01 +0200 |
| commit | 0ee622e0adafad3ee7a5afbcdcc519c7cca544d6 (patch) | |
| tree | 7e19a8a9569b98948e9b00a2cde68318e5e10652 /src | |
| parent | 63fb854560c2a437ebd72f3ab8b97349fd3eb61d (diff) | |
| download | cms-0ee622e0adafad3ee7a5afbcdcc519c7cca544d6.tar.gz cms-0ee622e0adafad3ee7a5afbcdcc519c7cca544d6.tar.bz2 cms-0ee622e0adafad3ee7a5afbcdcc519c7cca544d6.zip | |
restauration BDD console bin/restore_db.php
Diffstat (limited to 'src')
| -rw-r--r-- | src/controller/ViewController.php | 2 | ||||
| -rw-r--r-- | src/model/entities/Node.php | 6 | ||||
| -rw-r--r-- | src/service/Backup.php | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/src/controller/ViewController.php b/src/controller/ViewController.php index 1acb19a..43db6a6 100644 --- a/src/controller/ViewController.php +++ b/src/controller/ViewController.php | |||
| @@ -10,7 +10,7 @@ use Symfony\Component\HttpFoundation\RedirectResponse; | |||
| 10 | 10 | ||
| 11 | class ViewController | 11 | class ViewController |
| 12 | { | 12 | { |
| 13 | static function getWebPage(EntityManager $entityManager, Request $request): RedirectResponse | 13 | static function getWebPage(EntityManager $entityManager, Request $request): Response |
| 14 | { | 14 | { |
| 15 | /* 1/ 1er contrôle des paramètres */ | 15 | /* 1/ 1er contrôle des paramètres */ |
| 16 | 16 | ||
diff --git a/src/model/entities/Node.php b/src/model/entities/Node.php index c3e4ec3..fb2d867 100644 --- a/src/model/entities/Node.php +++ b/src/model/entities/Node.php | |||
| @@ -98,6 +98,8 @@ class Node | |||
| 98 | { | 98 | { |
| 99 | $this->page = $page; | 99 | $this->page = $page; |
| 100 | }*/ | 100 | }*/ |
| 101 | |||
| 102 | // utiliser l'interface de NodeData et EmailForm | ||
| 101 | public function getArticle(): Article | 103 | public function getArticle(): Article |
| 102 | { | 104 | { |
| 103 | return $this->article; | 105 | return $this->article; |
| @@ -106,9 +108,13 @@ class Node | |||
| 106 | { | 108 | { |
| 107 | $this->article = $article; | 109 | $this->article = $article; |
| 108 | }*/ | 110 | }*/ |
| 111 | |||
| 109 | // une interface serait cool! | 112 | // une interface serait cool! |
| 113 | // OU possible un "héritage doctrine", faire en sorte que Node soit la mère de NodeData, EmailForm, Article... | ||
| 114 | // une seulle instance est matérialisée par plusieurs tables en même temps | ||
| 110 | public function getNodeData(): NodeData|EmailForm|null | 115 | public function getNodeData(): NodeData|EmailForm|null |
| 111 | { | 116 | { |
| 117 | // limite du polymorphisme avec doctrine => impossible d'avoir une unique variable $node_data | ||
| 112 | return $this->name_node === 'form' ? $this->email_form : $this->node_data; | 118 | return $this->name_node === 'form' ? $this->email_form : $this->node_data; |
| 113 | } | 119 | } |
| 114 | public function getChildren(): array | 120 | public function getChildren(): array |
diff --git a/src/service/Backup.php b/src/service/Backup.php index e29ff64..60d1b23 100644 --- a/src/service/Backup.php +++ b/src/service/Backup.php | |||
| @@ -176,7 +176,7 @@ class Backup | |||
| 176 | } | 176 | } |
| 177 | // sécurité cas pas normal | 177 | // sécurité cas pas normal |
| 178 | if(empty($tables)){ | 178 | if(empty($tables)){ |
| 179 | throw new Exception("Aucune table à supprimer"); | 179 | throw new RuntimeException("Aucune table à supprimer"); |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | $tmp = tempnam('../var', 'tmp_db_codes_'); // crée un fichier avec un nom aléatoire et des droits 600 (concurrence) | 182 | $tmp = tempnam('../var', 'tmp_db_codes_'); // crée un fichier avec un nom aléatoire et des droits 600 (concurrence) |
