Bootstrap
类中的以下函数用于log
在 DB 中添加错误。现在我必须使用 Flashmessenger 和 Redirector helpers 将其重定向到仪表板。但它会引发致命错误。
protected function _initDebug()
{
register_shutdown_function(function () {
if ($e = error_get_last()) {
Zend_Registry::get('logger')->emerg($e['message'] . " in " . $e['file'] . ' line ' . $e['line'], 'error');
$logsDbTable = new Application_Model_DbTable_Logs();
$id = $logsDbTable->getLastInsertId();
$message = sprintf(Zend_Registry::getInstance()->config->ticket_msg,$id,Zend_Registry::getInstance()->config->support_phone_number);
$this->_helper->FlashMessenger(array('error' => $message));
$this->_helper->_redirector->goToSimple('index', 'dashboard');
}
});
}