You are here

private function CSSmin::normalize_int in Advanced CSS/JS Aggregation 8.3

Same name and namespace in other branches
  1. 8.2 advagg_css_minify/yui/CSSMin.inc \CSSmin::normalize_int()
  2. 6 advagg_css_compress/yui/CSSMin.inc \CSSmin::normalize_int()

Convert strings like "64M" or "30" to int values

Parameters

mixed $size:

Return value

int

2 calls to CSSmin::normalize_int()
CSSmin::do_raise_php_limits in advagg_css_minify/yui/CSSMin.inc
Try to configure PHP to use at least the suggested minimum settings
CSSmin::set_memory_limit in advagg_css_minify/yui/CSSMin.inc
Sets the memory limit for this script

File

advagg_css_minify/yui/CSSMin.inc, line 779

Class

CSSmin

Code

private function normalize_int($size) {
  if (is_string($size)) {
    switch (substr($size, -1)) {
      case 'M':
      case 'm':
        return (int) $size * 1048576;
      case 'K':
      case 'k':
        return (int) $size * 1024;
      case 'G':
      case 'g':
        return (int) $size * 1073741824;
    }
  }
  return (int) $size;
}