当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Log::__destruct方法代码示例

本文整理汇总了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();
     }
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:78,代码来源:NotifyErrorComponent.php


注:本文中的Zend_Log::__destruct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。