aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-06-30 21:56:07 -0700
committerFriendika <info@friendika.com>2011-06-30 21:56:07 -0700
commit481cd708acfd3291eed7eba6af596c541651963c (patch)
tree57419b2e19f2102b4e8580bd0d3071514a962bc0 /boot.php
parent84ee783a2acb3ad0575b8f8cadeda1a009d1bd99 (diff)
downloadvolse-hubzilla-481cd708acfd3291eed7eba6af596c541651963c.tar.gz
volse-hubzilla-481cd708acfd3291eed7eba6af596c541651963c.tar.bz2
volse-hubzilla-481cd708acfd3291eed7eba6af596c541651963c.zip
allow polling to mostly survive minor memory shortages.
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php12
1 files changed, 12 insertions, 0 deletions
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;
+ }
+}}
+