summaryrefslogtreecommitdiffstats
path: root/application/helpers/filebin_helper.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-09-14 13:44:47 +0200
committerFlorian Pritz <bluewind@xinu.at>2015-09-14 18:51:42 +0200
commit441f9ceb06c5cbdb9fc258114d2aadb9e71d280a (patch)
tree2d805bdd9ffea6cf85fe4b6bacd9a2a77383411e /application/helpers/filebin_helper.php
parent4dd606db850448c45977ddf5e65a9e0b625a30d4 (diff)
API 1.4: Add more values to file/get_config
These are necessary for clients that want to send lots of fields e.g. in a delete request or upload multiple files in one upload request. Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/helpers/filebin_helper.php')
-rw-r--r--application/helpers/filebin_helper.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/application/helpers/filebin_helper.php b/application/helpers/filebin_helper.php
index c1f302da3..5e37f4b80 100644
--- a/application/helpers/filebin_helper.php
+++ b/application/helpers/filebin_helper.php
@@ -369,4 +369,16 @@ function files_are_equal($a, $b)
return $result;
}
+# Source: http://php.net/manual/en/function.ini-get.php#96996
+function return_bytes($size_str)
+{
+ switch (substr ($size_str, -1))
+ {
+ case 'K': case 'k': return (int)$size_str * 1024;
+ case 'M': case 'm': return (int)$size_str * 1048576;
+ case 'G': case 'g': return (int)$size_str * 1073741824;
+ default: return $size_str;
+ }
+}
+
# vim: set noet: