aboutsummaryrefslogtreecommitdiff
path: root/src/controller
diff options
context:
space:
mode:
Diffstat (limited to 'src/controller')
-rw-r--r--src/controller/MaintenanceController.php2
-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;
10use Symfony\Component\HttpFoundation\Request; 10use Symfony\Component\HttpFoundation\Request;
11use Symfony\Component\HttpFoundation\Response; 11use Symfony\Component\HttpFoundation\Response;
12 12
13class ViewController extends AbstractBuilder // ViewController est aussi le premier Builder 13class 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 */