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:
@@ -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()
|
||||
*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user