caching - 如何在 Drupal 8 中以编程方式清除缓存?

标签 caching drupal drupal-8

我正在开发 Drupal 8 网站。该网站正在运行。我最近搬到了另一台机器。

它显示错误,例如:

Recoverable fatal error: Argument 1 passed to 

Drupal\Component\DependencyInjection\Container::__construct() must be of

 the type array, boolean given, called in [DRUPAL-

PATH]/core/lib/Drupal/Core/DrupalKernel.php on line 883 and defined in 

[DRUPAL-PATH]/core/lib/Drupal/Component/DependencyInjection/Container.php

 on line 119 #0 [DRUPAL-PATH]/core/includes/bootstrap.inc(550): 

_drupal_error_handler_real(4096, 'Argument 1 pass...', 

'/Applications/M...', 119, Array)

我需要以编程方式清除缓存。

最佳答案

尝试以下。

cache_clear_all() // For Drupal-7

drupal_flush_all_caches() // For Drupal-8

关于caching - 如何在 Drupal 8 中以编程方式清除缓存?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43608217/

相关文章:

c# - 有人可以向我解释这段 ASP.NET MVC 代码吗?

php - 无法打开所需的database.inc(尝试使用drupal)

Drupal 公开 View 过滤器自定义日期

rest - Drupal 8 资源 : No route found

java - 查询 Terracotta

java - 扩展java整数缓存

php - 使用 PHP 缓存

Drupal 分类 block 、词汇表

caching - Drupal 8 cookie 缓存问题

rest - 如何使用 Drupal 8 REST 获取带有评论的文章?