本文整理汇总了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;
}
}