You are here

private function CSSmin::normalizeInt in Advanced CSS/JS Aggregation 7.2

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

Parameters

mixed $size:

Return value

int

2 calls to CSSmin::normalizeInt()
CSSmin::doRaisePhpLimits in advagg_css_compress/yui/CSSMin.inc
Tries to configure PHP to use at least the suggested minimum settings
CSSmin::set_memory_limit in advagg_css_compress/yui/CSSMin.inc
Sets the memory limit for this script

File

advagg_css_compress/yui/CSSMin.inc, line 1185

Class

CSSmin

Code

private function normalizeInt($size) {
  if (is_string($size)) {
    $letter = substr($size, -1);
    $size = intval($size);
    switch ($letter) {
      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;
}