【发布时间】:2020-06-22 07:13:06
【问题描述】:
我有一个在 Symfony 4 上运行的应用程序。我使用文件系统缓存组件。我想创建一个清空它的函数,但不幸的是,我的整个应用程序现在都坏了。所有页面将永远继续加载。
在我执行的脚本下面:
<?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');
}
}
我删除了我的 var/cache 文件夹,我的 temp 文件夹,默认情况下存储此缓存 (sys_get_temp_dir),重新安装了我的供应商,清空了我的 cookie 和缓存并重新启动了我的计算机。根本没有任何作用,应用程序一直在加载。我该怎么做才能解决这个问题?
【问题讨论】:
标签: php symfony caching symfony4