本文整理汇总了PHP中Zend_Log::__destruct方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Log::__destruct方法的具体用法?PHP Zend_Log::__destruct怎么用?PHP Zend_Log::__destruct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Log
的用法示例。
在下文中一共展示了Zend_Log::__destruct方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fatalError
/**
* Handle fatal errors.
*
* @param Zend_Log $logger
*/
public function fatalError($logger)
{
if (!is_null(error_get_last())) {
$e = error_get_last();
$environment = Zend_Registry::get('configGlobal')->environment;
switch ($environment) {
case 'production':
$message = 'The system has encountered the following error:<br/><h3>';
$message .= htmlspecialchars($e['message'], ENT_QUOTES, 'UTF-8') . '<br/>';
$message .= 'In ' . htmlspecialchars($e['file'], ENT_QUOTES, 'UTF-8') . ', line: ' . htmlspecialchars($e['line'], ENT_QUOTES, 'UTF-8') . '<br/>';
$message .= 'At ' . date('H:i:s Y-m-d') . '</h3><br/>';
$message .= 'Please notify your administrator with this information.<br/>';
if ($e['type'] == E_NOTICE) {
$e['typeText'] = 'E_NOTICE';
} elseif ($e['type'] == E_ERROR) {
$e['typeText'] = 'E_ERROR';
} elseif ($e['type'] == 4) {
$e['typeText'] = '4';
} elseif ($e['type'] == E_WARNING) {
$e['typeText'] = 'E_WARNING';
} elseif ($e['type'] == E_PARSE) {
$e['typeText '] = 'E_PARSE';
} elseif ($e['type'] == E_RECOVERABLE_ERROR) {
$e['typeText '] = 'E_RECOVERABLE_ERROR';
} elseif ($e['type'] == E_COMPILE_ERROR) {
$e['typeText '] = 'E_COMPILE_ERROR';
} else {
return;
}
header('content-type: text/html');
if (count(ob_list_handlers()) > 0) {
ob_clean();
}
echo $message;
$this->_environment = $environment;
break;
default:
$this->_server = $_SERVER;
if ($e['type'] == E_NOTICE) {
$e['typeText'] = 'E_NOTICE';
} elseif ($e['type'] == E_ERROR) {
$e['typeText'] = 'E_ERROR';
} elseif ($e['type'] == 4) {
$e['typeText'] = '4';
} elseif ($e['type'] == E_WARNING) {
$e['typeText'] = 'E_WARNING';
} elseif ($e['type'] == E_PARSE) {
$e['typeText '] = 'E_PARSE';
} elseif ($e['type'] == E_RECOVERABLE_ERROR) {
$e['typeText '] = 'E_RECOVERABLE_ERROR';
} elseif ($e['type'] == E_COMPILE_ERROR) {
$e['typeText '] = 'E_COMPILE_ERROR';
} else {
return;
}
if (count(ob_list_handlers()) > 0) {
ob_clean();
}
$db = Zend_Registry::get('dbAdapter');
$table = $db->listTables();
if (file_exists(LOCAL_CONFIGS_PATH . '/database.local.ini') && empty($table)) {
$fc = Zend_Controller_Front::getInstance();
$webroot = $fc->getBaseUrl();
echo "Midas Server is not installed. <a href='" . $webroot . "/install?reset=true'>Click here to reset Midas Server and go to the installation page.</a>";
return;
}
header('content-type: text/plain');
echo $this->getFatalErrorMessage($e);
}
$logger->crit($this->getFatalErrorMessage($e));
$logger->__destruct();
}
}