本文整理汇总了PHP中eZScript::isInitialized方法的典型用法代码示例。如果您正苦于以下问题:PHP eZScript::isInitialized方法的具体用法?PHP eZScript::isInitialized怎么用?PHP eZScript::isInitialized使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZScript
的用法示例。
在下文中一共展示了eZScript::isInitialized方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: runCallback
/**
* Runs a callback function in the legacy kernel environment.
* This is useful to run eZ Publish 4.x code from a non-related context (like eZ Publish 5)
*
* @param \Closure $callback
* @param boolean $postReinitialize Default is true.
* If set to false, the kernel environment will not be reinitialized.
* This can be useful to optimize several calls to the kernel within the same context.
* @return mixed The result of the callback
*/
public function runCallback(\Closure $callback, $postReinitialize = true)
{
if (!$this->script->isInitialized()) {
$this->script->initialize();
}
$return = $callback();
$this->script->shutdown();
if (!$postReinitialize) {
$this->script->setIsInitialized(true);
}
return $return;
}