diff options
author | Friendika <info@friendika.com> | 2011-06-30 21:56:07 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-06-30 21:56:07 -0700 |
commit | 481cd708acfd3291eed7eba6af596c541651963c (patch) | |
tree | 57419b2e19f2102b4e8580bd0d3071514a962bc0 /boot.php | |
parent | 84ee783a2acb3ad0575b8f8cadeda1a009d1bd99 (diff) | |
download | volse-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.php | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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; + } +}} + |