allow polling to mostly survive minor memory shortages.

This commit is contained in:
Friendika 2011-06-30 21:56:07 -07:00
parent 84ee783a2a
commit 481cd708ac
3 changed files with 49 additions and 5 deletions

View file

@ -2908,3 +2908,15 @@ function get_plugin_info($plugin){
}
return $info;
}}
if(! function_exists('return_bytes')) {
function return_bytes ($size_str) {
switch (substr ($size_str, -1))
{
case 'M': case 'm': return (int)$size_str * 1048576;
case 'K': case 'k': return (int)$size_str * 1024;
case 'G': case 'g': return (int)$size_str * 1073741824;
default: return $size_str;
}
}}