mirror of
https://github.com/friendica/friendica
synced 2025-04-27 21:50:11 +00:00
And some more static warnings removed
This commit is contained in:
parent
94f6f12ba3
commit
a729519de9
8 changed files with 43 additions and 40 deletions
|
@ -46,11 +46,35 @@ class System {
|
|||
*
|
||||
* @return string The cleaned url
|
||||
*/
|
||||
function removedBaseUrl($orig_url) {
|
||||
public static function removedBaseUrl($orig_url) {
|
||||
self::init();
|
||||
return self::$a->remove_baseurl($orig_url);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns a string with a callstack. Can be used for logging.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function callstack($depth = 4) {
|
||||
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, $depth + 2);
|
||||
|
||||
// We remove the first two items from the list since they contain data that we don't need.
|
||||
array_shift($trace);
|
||||
array_shift($trace);
|
||||
|
||||
$callstack = array();
|
||||
foreach ($trace AS $func) {
|
||||
if (!empty($func['class'])) {
|
||||
$callstack[] = $func['class'].'::'.$func['function'];
|
||||
} else {
|
||||
$callstack[] = $func['function'];
|
||||
}
|
||||
}
|
||||
|
||||
return implode(', ', $callstack);
|
||||
}
|
||||
|
||||
/// @todo Move the following functions from boot.php
|
||||
/*
|
||||
function get_guid($size = 16, $prefix = "")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue