diff options
author | Andreas Gohr <andi@splitbrain.org> | 2008-02-23 19:07:01 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2008-02-23 19:07:01 +0100 |
commit | 73038c47e3312b4c62c4a0a05ecd5cdcd5eb95b7 (patch) | |
tree | 8fe3dd3036ba1dc2208e0b99a69eed268d6156cb /inc/common.php | |
parent | 7b3f8b164b5e7b432cdee1b1332ddd9f943ed8cd (diff) | |
download | rpg-73038c47e3312b4c62c4a0a05ecd5cdcd5eb95b7.tar.gz rpg-73038c47e3312b4c62c4a0a05ecd5cdcd5eb95b7.tar.bz2 |
Check memory settings on ?do
This should help with diagnosing memory related problems
darcs-hash:20080223180701-7ad00-1308829c3d7432b1d0c23c3f1acc8228c0a41e1e.gz
Diffstat (limited to 'inc/common.php')
-rw-r--r-- | inc/common.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/inc/common.php b/inc/common.php index 00cde2e92..ce32e42cb 100644 --- a/inc/common.php +++ b/inc/common.php @@ -1135,4 +1135,31 @@ function unslash($string,$char="'"){ return str_replace('\\'.$char,$char,$string); } +/** + * Convert php.ini shorthands to byte + * + * @author <gilthans dot NO dot SPAM at gmail dot com> + * @link http://de3.php.net/manual/en/ini.core.php#79564 + */ +function php_to_byte($v){ + $l = substr($v, -1); + $ret = substr($v, 0, -1); + switch(strtoupper($l)){ + case 'P': + $ret *= 1024; + case 'T': + $ret *= 1024; + case 'G': + $ret *= 1024; + case 'M': + $ret *= 1024; + case 'K': + $ret *= 1024; + break; + } + return $ret; +} + + + //Setup VIM: ex: et ts=2 enc=utf-8 : |