diff options
| author | polo <ordipolo@gmx.fr> | 2026-05-10 17:01:21 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2026-05-10 17:01:21 +0200 |
| commit | 895cf7a438929f74c2e11996667685245a571f2a (patch) | |
| tree | 5dfad9d5e0d2f4a802482f5883dd4673ed971238 /src/controller | |
| parent | 2c47085b27253c4ad2d062d15c18c3a8c7591298 (diff) | |
| download | cms-895cf7a438929f74c2e11996667685245a571f2a.tar.gz cms-895cf7a438929f74c2e11996667685245a571f2a.tar.bz2 cms-895cf7a438929f74c2e11996667685245a571f2a.zip | |
partie client de la restauration de BDD, script bin/mysqldump.php, changements permissions dossiers, renommage ViewDirector
Diffstat (limited to 'src/controller')
| -rw-r--r-- | src/controller/MaintenanceController.php | 2 | ||||
| -rw-r--r-- | src/controller/ViewDirector.php (renamed from src/controller/ViewController.php) | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/controller/MaintenanceController.php b/src/controller/MaintenanceController.php index fca45f1..c60ca1c 100644 --- a/src/controller/MaintenanceController.php +++ b/src/controller/MaintenanceController.php | |||
| @@ -52,7 +52,7 @@ class MaintenanceController | |||
| 52 | static public function getLastDump(EntityManager $entityManager): void | 52 | static public function getLastDump(EntityManager $entityManager): void |
| 53 | { | 53 | { |
| 54 | try{ | 54 | try{ |
| 55 | $file_path = Backup::mySQLdump($entityManager); | 55 | $file_path = Backup::getLastBackupName(); |
| 56 | header('Content-Type: application/octet-stream'); // signifie fichier quelconque, du binaire quoi! | 56 | header('Content-Type: application/octet-stream'); // signifie fichier quelconque, du binaire quoi! |
| 57 | header('Content-Disposition: attachment; filename="' . basename($file_path) . '"'); // pour provoquer un téléchargement et non pour afficher | 57 | header('Content-Disposition: attachment; filename="' . basename($file_path) . '"'); // pour provoquer un téléchargement et non pour afficher |
| 58 | header('Content-Length: ' . filesize($file_path)); // peut servir côté client (barre de progression...) | 58 | header('Content-Length: ' . filesize($file_path)); // peut servir côté client (barre de progression...) |
diff --git a/src/controller/ViewController.php b/src/controller/ViewDirector.php index cf3477c..6883b73 100644 --- a/src/controller/ViewController.php +++ b/src/controller/ViewDirector.php | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | <?php | 1 | <?php |
| 2 | // src/view/ViewController.php | 2 | // src/view/ViewDirector.php |
| 3 | // | 3 | // |
| 4 | // génère le HTML avec des Builder | 4 | // génère le HTML avec des Builder |
| 5 | 5 | ||
| @@ -10,7 +10,7 @@ use Doctrine\ORM\EntityManager; | |||
| 10 | use Symfony\Component\HttpFoundation\Request; | 10 | use Symfony\Component\HttpFoundation\Request; |
| 11 | use Symfony\Component\HttpFoundation\Response; | 11 | use Symfony\Component\HttpFoundation\Response; |
| 12 | 12 | ||
| 13 | class ViewController extends AbstractBuilder // ViewController est aussi le premier Builder | 13 | class ViewDirector extends AbstractBuilder // ViewDirector est aussi le premier Builder |
| 14 | { | 14 | { |
| 15 | static public Node $root_node; | 15 | static public Node $root_node; |
| 16 | 16 | ||
| @@ -61,6 +61,9 @@ class ViewController extends AbstractBuilder // ViewController est aussi le prem | |||
| 61 | if(CURRENT_PAGE === 'article' && !IS_ADMIN && self::$root_node->getNodeByName('main')->getAdoptedChild() === null){ | 61 | if(CURRENT_PAGE === 'article' && !IS_ADMIN && self::$root_node->getNodeByName('main')->getAdoptedChild() === null){ |
| 62 | return new Response($this->html, 302); | 62 | return new Response($this->html, 302); |
| 63 | } | 63 | } |
| 64 | elseif(CURRENT_PAGE === 'maintenance'){ | ||
| 65 | Backup::mySQLdump($entityManager); // créer un nouveau backup | ||
| 66 | } | ||
| 64 | 67 | ||
| 65 | 68 | ||
| 66 | /* 4/ construction de la page avec builders et vues */ | 69 | /* 4/ construction de la page avec builders et vues */ |
