From 5c85fbb034cd2830bf902fa223683f43e204ad21 Mon Sep 17 00:00:00 2001 From: afornerot Date: Thu, 22 Aug 2019 11:03:01 +0200 Subject: [PATCH] =?UTF-8?q?refresh=20cache=20rss=20apr=C3=A8s=20modificati?= =?UTF-8?q?on=20(fixes=20#16)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Cadoles/PortalBundle/Controller/FluxController.php | 5 +++++ .../PortalBundle/Controller/PagewidgetController.php | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/FluxController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/FluxController.php index 5aab263a..8e8469e0 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/FluxController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/FluxController.php @@ -128,6 +128,11 @@ class FluxController extends Controller $em->persist($data); $em->flush(); + // On supprime le potentiel cache de ce flux + $dir = $this->container->getParameter('kernel.root_dir').'/../web/uploads/flux/'; + $mask = $dir."flux-*".$data->getId().".*"; + array_map( "unlink", glob( $mask ) ); + // Retour à la liste return $this->redirectToRoute($this->labelroute); } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php index 8ae82a71..cdd79860 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/PagewidgetController.php @@ -212,6 +212,14 @@ class PagewidgetController extends Controller $em->persist($entity); $em->flush(); + // Si widget RSS On supprime le potentiel cache de ce flux + if($entity->getWidget()->getId()==-1880) { + $dir = $this->container->getParameter('kernel.root_dir').'/../web/uploads/flux/'; + $mask = $dir."widget-".$entity->getId().".*"; + array_map( "unlink", glob( $mask ) ); + } + + // Retour if($by=="view") return $this->redirect($this->generateUrl('cadoles_portal_'.$access.'_page_view',["id"=>$idpage,"usage"=>$usage,"group"=>$group])); else