1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-30 17:50:12 +02:00

removed some legacy method calls, e107 class cleanup (in progress).

This commit is contained in:
secretr
2012-01-02 13:12:48 +00:00
parent 036013e79f
commit 161bbe4785
4 changed files with 35 additions and 320 deletions

View File

@@ -3929,6 +3929,30 @@ class eHelper
return (number_format($size, $dp).$memunit);
}
/**
* Get the current memory usage of the code
* If $separator argument is null, raw data (array) will be returned
*
* @param null|string $separator
* @return string|array memory usage
*/
public static function getMemoryUsage($separator = '/')
{
$ret = array();
if(function_exists("memory_get_usage"))
{
$ret[] = eHelper::parseMemorySize(memory_get_usage());
// With PHP>=5.2.0, can show peak usage as well
if (function_exists("memory_get_peak_usage")) $ret[] = eHelper::parseMemorySize(memory_get_peak_usage(TRUE));
}
else
{
$ret[] = 'Unknown';
}
return (null !== $separator ? implode($separator, $ret) : $ret);
}
public static function camelize($str, $all = false, $space = '')
{
// clever recursion o.O