mirror of
https://github.com/friendica/friendica
synced 2025-04-27 21:50:11 +00:00
Moved functions out of boot.php into class
- z_root() => $a->getBaseURL() - absurl() => removed because no usage - is_ajax() => $a->isAjax() - current_load() => System::currentLoad() - argc() => $a->argc - argv($x) => $a->getArgumentValue($x)
This commit is contained in:
parent
14e7686df4
commit
2c541afd47
8 changed files with 66 additions and 90 deletions
|
@ -216,6 +216,26 @@ class System extends BaseObject
|
|||
return substr($trailer . uniqid('') . mt_rand(), 0, 26);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current Load of the System
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public static function currentLoad()
|
||||
{
|
||||
if (!function_exists('sys_getloadavg')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$load_arr = sys_getloadavg();
|
||||
|
||||
if (!is_array($load_arr)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return max($load_arr[0], $load_arr[1]);
|
||||
}
|
||||
|
||||
/// @todo Move the following functions from boot.php
|
||||
/*
|
||||
function killme()
|
||||
|
@ -232,6 +252,5 @@ class System extends BaseObject
|
|||
function get_cachefile($file, $writemode = true)
|
||||
function get_itemcachepath()
|
||||
function get_spoolpath()
|
||||
function current_load()
|
||||
*/
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue