You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
796 B
PHTML

12 years ago
<?php
/**
11 years ago
* Write a log entry.
* This should be used to log user's activity.
*
* @param string $message
12 years ago
*/
8 years ago
function engelsystem_log($message)
{
global $user;
8 years ago
8 years ago
$nick = "Guest";
if (isset($user)) {
$nick = User_Nick_render($user);
}
LogEntry_create($nick, $message);
12 years ago
}
11 years ago
/**
* Generates a PHP Stacktrace.
*
* @return string
11 years ago
*/
8 years ago
function debug_string_backtrace()
{
ob_start();
debug_print_backtrace();
$trace = ob_get_contents();
ob_end_clean();
8 years ago
// Remove first item from backtrace as it's this function which
// is redundant.
$trace = preg_replace('/^#0\s+' . __FUNCTION__ . "[^\n]*\n/", '', $trace, 1);
// Renumber backtrace items.
// $trace = preg_replace('/^#(\d+)/me', '\'#\' . ($1 - 1)', $trace);
return $trace;
11 years ago
}