本文整理汇总了PHP中eZExecution::cleanupHandlers方法的典型用法代码示例。如果您正苦于以下问题:PHP eZExecution::cleanupHandlers方法的具体用法?PHP eZExecution::cleanupHandlers怎么用?PHP eZExecution::cleanupHandlers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZExecution
的用法示例。
在下文中一共展示了eZExecution::cleanupHandlers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cleanup
static function cleanup()
{
$handlers = eZExecution::cleanupHandlers();
foreach ( $handlers as $handler )
{
if ( is_callable( $handler ) )
call_user_func( $handler );
else
eZDebug::writeError('Could not call cleanup handler, is it a static public function?', __METHOD__ );
}
}
示例2: registerShutdownPerfLogger
/**
* Registers the 'cleanup' function as shutdown handler, trying to do it only once
*
* @param bool $onlyIfConfigured when true, the registration only happens subject to an ini setting
* @return bool false if registration is aborted, true if the handler is (or was already) registered
*/
public static function registerShutdownPerfLogger($onlyIfConfigured = false, $eZ5Context = false)
{
if ($onlyIfConfigured && eZPerfLoggerINI::variable('GeneralSettings', 'AlwaysRegisterShutdownPerfLogger') !== 'enabled') {
return false;
}
foreach (eZExecution::cleanupHandlers() as $handler) {
if ($handler == array(__CLASS__, 'cleanup') || $handler == array(__CLASS__, 'cleanupOnCleanExit')) {
return true;
}
}
if ($eZ5Context) {
eZExecution::addCleanupHandler(array(__CLASS__, 'cleanupOnCleanExit'));
} else {
eZExecution::addCleanupHandler(array(__CLASS__, 'cleanup'));
}
return true;
}