refresh cache rss après modification (fixes #16)

This commit is contained in:
afornerot 2019-08-22 11:03:01 +02:00
parent ba54065443
commit 5c85fbb034
2 changed files with 13 additions and 0 deletions

View File

@ -128,6 +128,11 @@ class FluxController extends Controller
$em->persist($data); $em->persist($data);
$em->flush(); $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 // Retour à la liste
return $this->redirectToRoute($this->labelroute); return $this->redirectToRoute($this->labelroute);
} }

View File

@ -212,6 +212,14 @@ class PagewidgetController extends Controller
$em->persist($entity); $em->persist($entity);
$em->flush(); $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") if($by=="view")
return $this->redirect($this->generateUrl('cadoles_portal_'.$access.'_page_view',["id"=>$idpage,"usage"=>$usage,"group"=>$group])); return $this->redirect($this->generateUrl('cadoles_portal_'.$access.'_page_view',["id"=>$idpage,"usage"=>$usage,"group"=>$group]));
else else