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


PHP sensitiveIO::printBackTrace方法代码示例

本文整理汇总了PHP中sensitiveIO::printBackTrace方法的典型用法代码示例。如果您正苦于以下问题:PHP sensitiveIO::printBackTrace方法的具体用法?PHP sensitiveIO::printBackTrace怎么用?PHP sensitiveIO::printBackTrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sensitiveIO的用法示例。


在下文中一共展示了sensitiveIO::printBackTrace方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _raiseError

 /**
  * Raises an error. Shows it to the screen
  * Deprecated, use raiseError instead
  * @param string $errorMessage the error message.
  * @param boolean $encodeOutput, does the screen output should be encoded (default : false)
  * @return void
  * @access public
  */
 public function _raiseError($errorMessage, $encodeOutput = false, $error = true)
 {
     static $errorNumber;
     $systemDebug = !defined('SYSTEM_DEBUG') ? true : SYSTEM_DEBUG;
     if (isset($this) && isset($this->_debug) && $this->_debug === NULL) {
         $this->_debug = $systemDebug;
     }
     if ($errorMessage) {
         //second condition are for static calls (made by static methods)
         if (!defined('APPLICATION_EXEC_TYPE') || APPLICATION_EXEC_TYPE == 'http' && (!isset($this) && $systemDebug || isset($this) && isset($this->_debug) && $this->_debug)) {
             $backTrace = $backTraceLink = '';
             if (version_compare(phpversion(), "5.2.5", "<")) {
                 $bt = @array_reverse(debug_backtrace());
             } else {
                 $bt = @array_reverse(debug_backtrace(false));
             }
             $backtrace = array('summary' => sensitiveIO::printBackTrace($bt), 'backtrace' => @print_r($bt, true));
             $backtraceName = 'bt_' . md5(rand());
             $backTraceLink = PATH_ADMIN_WR . '/backtrace.php?bt=' . $backtraceName;
             //save backtrace to cache (for 10 min)
             $cache = new CMS_cache($backtraceName, 'atm-backtrace', 600, false);
             if ($cache) {
                 $cache->save($backtrace);
             }
             unset($backtrace, $cache, $bt);
             //append error to current view
             $view = CMS_view::getInstance();
             $outputMessage = $encodeOutput ? io::htmlspecialchars($errorMessage) : $errorMessage;
             $view->addError(array('error' => $outputMessage, 'backtrace' => $backTraceLink));
         }
         //second condition are for static calls (made by static methods)
         if (!isset($this) || !isset($this->_log) || $this->_log) {
             if (@file_put_contents(PATH_MAIN_FS . '/' . self::ERROR_LOG, date("Y-m-d H:i:s", time()) . '|' . APPLICATION_EXEC_TYPE . '|' . $errorMessage . "\n", FILE_APPEND) !== false) {
                 CMS_file::chmodFile(FILES_CHMOD, PATH_MAIN_FS . '/' . self::ERROR_LOG);
             } else {
                 die('<pre><b>' . CMS_view::SYSTEM_LABEL . ' ' . AUTOMNE_VERSION . ' error : /automne dir is not writable' . "</b></pre>\n");
             }
         }
     }
     //must be at the end because it interferes with the static calls conditions above
     if ($error && isset($this)) {
         $this->_errRaised = true;
     }
 }
开发者ID:davidmottet,项目名称:automne,代码行数:52,代码来源:grandfather.php


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