You are here

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

Tries to configure PHP to use at least the suggested minimum settings

Return value

void

1 call to CSSmin::doRaisePhpLimits()
CSSmin::run in advagg_css_compress/yui/CSSMin.inc
Minifies a string of CSS

File

advagg_css_compress/yui/CSSMin.inc, line 213

Class

CSSmin

Code

private function doRaisePhpLimits() {
  $phpLimits = array(
    'memory_limit' => $this->memoryLimit,
    'max_execution_time' => $this->maxExecutionTime,
    'pcre.backtrack_limit' => $this->pcreBacktrackLimit,
    'pcre.recursion_limit' => $this->pcreRecursionLimit,
  );

  // If current settings are higher respect them.
  foreach ($phpLimits as $name => $suggested) {
    $current = $this
      ->normalizeInt(ini_get($name));
    if ($current > $suggested) {
      continue;
    }

    // memoryLimit exception: allow -1 for "no memory limit".
    if ($name === 'memory_limit' && $current === -1) {
      continue;
    }

    // maxExecutionTime exception: allow 0 for "no memory limit".
    if ($name === 'max_execution_time' && $current === 0) {
      continue;
    }
    ini_set($name, $suggested);
  }
}