本文整理汇总了PHP中eZExecution::fatalErrorHandlers方法的典型用法代码示例。如果您正苦于以下问题:PHP eZExecution::fatalErrorHandlers方法的具体用法?PHP eZExecution::fatalErrorHandlers怎么用?PHP eZExecution::fatalErrorHandlers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZExecution
的用法示例。
在下文中一共展示了eZExecution::fatalErrorHandlers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: uncleanShutdownHandler
static function uncleanShutdownHandler()
{
// Need to change the current directory, since this information is lost
// when the callbackfunction is called. eZDocumentRoot is set in ::registerShutdownHandler
if ( self::$eZDocumentRoot !== null )
{
chdir( self::$eZDocumentRoot );
}
if ( eZExecution::isCleanExit() )
return;
eZExecution::cleanup();
$handlers = eZExecution::fatalErrorHandlers();
foreach ( $handlers as $handler )
{
if ( is_callable( $handler ) )
call_user_func( $handler );
else
eZDebug::writeError('Could not call fatal error handler, is it a static public function?', __METHOD__ );
}
}
示例2: uncleanShutdownHandler
static function uncleanShutdownHandler()
{
// Need to change the current directory, since this information is lost
// when the callbackfunction is called. eZDocumentRoot is set in ::registerShutdownHandler
// Getting the previous current working directory as we might need to get back there (i.e. Symfony web/ directory).
$previousCwd = getcwd();
if (self::$eZDocumentRoot !== null) {
chdir(self::$eZDocumentRoot);
}
if (eZExecution::isCleanExit()) {
chdir($previousCwd);
return;
}
eZExecution::cleanup();
$handlers = eZExecution::fatalErrorHandlers();
foreach ($handlers as $handler) {
if (is_callable($handler)) {
call_user_func($handler);
} else {
eZDebug::writeError('Could not call fatal error handler, is it a static public function?', __METHOD__);
}
}
chdir($previousCwd);
}