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