本文整理汇总了PHP中Drupal::kernel方法的典型用法代码示例。如果您正苦于以下问题:PHP Drupal::kernel方法的具体用法?PHP Drupal::kernel怎么用?PHP Drupal::kernel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal
的用法示例。
在下文中一共展示了Drupal::kernel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unsetContainer
/**
* Unset and invalidate the container
*/
public static function unsetContainer()
{
$kernel = self::_getKernel();
// We need to spawn the kernel (if not already) in order to clear the
// cache folder manually, we will then reset it.
if ($kernel instanceof Kernel) {
$kernel->dropCache();
}
// Fully reset the container, and prey for other modules to find the
// right one. In theory, if they didn't referenced their services into
// statics, it should be fine, new one will transparently replace the
// old one in \Drupal::service() calls.
// Please note that as a side effect, it will boot() again the bundles
// if they are registered bundles, they might mess up with globals or
// configuration.
self::$kernel = null;
}