I have an application that runs on Symfony 4. I use the filesystem cache component. I wanted to create a function that empties it, but unfortunately, my entire application is now broken. All pages will continue to load forever.
Below the script that I have executed:
<?php
namespace App\Controller\Admin;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Cache\Simple\FilesystemCache;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Request;
use App\Entity\Instelling;
class AdminInstellingController extends AbstractController
{
/**
* @Route("/beheer/cache-clear")
*/
public function clearCache()
{
$cache = new FilesystemCache();
$cache->clear();
$this->addFlash("success", "De <strong>CRM DataServer</strong> cache is succesvol geleegd.");
// return $this->redirect('/beheer/dashboard');
}
}
I have deleted my var/cache folder, my temp folder where this cache is stored by default (sys_get_temp_dir), reinstalled my vendors, emptied my cookies and cache and restarted my computer. Nothing works at all and the application keeps loading. What do I have to do to resolve this?