本文整理匯總了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;
}