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:
Philipp Holzer 2018-10-13 18:57:31 +02:00
parent 14e7686df4
commit 2c541afd47
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
8 changed files with 66 additions and 90 deletions

View file

@ -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()
*/
}