本文整理汇总了PHP中Closure::runCallback方法的典型用法代码示例。如果您正苦于以下问题:PHP Closure::runCallback方法的具体用法?PHP Closure::runCallback怎么用?PHP Closure::runCallback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Closure
的用法示例。
在下文中一共展示了Closure::runCallback方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: runLegacyKernelCallback
/**
* Executes a legacy kernel callback
*
* Does the callback with both post-reinitialize and formtoken checks disabled.
*
* @param callable $callback
*
* @return mixed
*/
protected function runLegacyKernelCallback($callback)
{
// Initialize legacy kernel if not already done
if ($this->legacyKernel instanceof Closure) {
$legacyKernelClosure = $this->legacyKernel;
$this->legacyKernel = $legacyKernelClosure();
}
return $this->legacyKernel->runCallback($callback, false, false);
}
示例2: runLegacyKernelCallback
/**
* Executes a legacy kernel callback.
*
* Does the callback with both post-reinitialize and formtoken checks disabled.
*
* @param callable $callback
*
* @return mixed
*/
protected function runLegacyKernelCallback($callback)
{
$this->persistenceCacheClearer->switchOff();
$this->httpCacheClearer->switchOff();
// Initialize legacy kernel if not already done
if ($this->legacyKernel instanceof Closure) {
$legacyKernelClosure = $this->legacyKernel;
$this->legacyKernel = $legacyKernelClosure();
}
$return = $this->legacyKernel->runCallback($callback, false, false);
$this->persistenceCacheClearer->switchOn();
$this->httpCacheClearer->switchOn();
return $return;
}