From 481cd708acfd3291eed7eba6af596c541651963c Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 30 Jun 2011 21:56:07 -0700 Subject: allow polling to mostly survive minor memory shortages. --- boot.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 27c801923..b81bd9cfc 100644 --- a/boot.php +++ b/boot.php @@ -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; + } +}} + -- cgit v1.2.3