diff options
author | eric <eric> | 2004-07-13 00:12:42 +0200 |
---|---|---|
committer | eric <eric> | 2004-07-13 00:12:42 +0200 |
commit | cbe2050420a65349a5fcf1f4cce6e7c76490f881 (patch) | |
tree | 167ebed2b4b7ab322a2c2492d6b2e688f4ca2fe6 /web/lib | |
parent | 7b9956f225cd885c861db0cb145b16b3b8441ca7 (diff) | |
download | aur-cbe2050420a65349a5fcf1f4cce6e7c76490f881.tar.gz aur-cbe2050420a65349a5fcf1f4cce6e7c76490f881.tar.xz |
started on the package submit script
Diffstat (limited to 'web/lib')
-rw-r--r-- | web/lib/aur.inc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/web/lib/aur.inc b/web/lib/aur.inc index 7ea1e965..686154f5 100644 --- a/web/lib/aur.inc +++ b/web/lib/aur.inc @@ -444,5 +444,28 @@ function dbug($msg) { return; } +# convert an ini_get number to a real integer - stupid PHP! +# +function initeger($inival="0", $isbytes=1) { + $last_char = strtolower(substr($inival, -1)); + if ($isbytes) { + switch ($last_char) { + case 't': $multiplier = 1024 * 1024 * 1024; break; + case 'm': $multiplier = 1024 * 1024; break; + case 'k': $multiplier = 1024; break; + default: $multiplier = 1; break; + } + } else { + switch ($last_char) { + case 't': $multiplier = 1000 * 1000 * 1000; break; + case 'm': $multiplier = 1000 * 1000; break; + case 'k': $multiplier = 1000; break; + default: $multiplier = 1; break; + } + } + + return intval($inival) * $multiplier; +} + # vim: ts=2 sw=2 noet ft=php ?> |