Elgg  Version master
CssCrushProcess.php
Go to the documentation of this file.
1 <?php
2 namespace Elgg\Assets;
3 
5 
11 class CssCrushProcess extends Process {
12 
13  protected $iniOriginal = [];
14 
20  public function preCompile() {
21  if (ini_get('pcre.backtrack_limit') < 1000000) {
22  $this->iniOriginal['pcre.backtrack_limit'] = ini_get('pcre.backtrack_limit');
23  ini_set('pcre.backtrack_limit', 1000000);
24  }
25 
26  if (ini_get('pcre.jit')) {
27  $this->iniOriginal['pcre.jit'] = ini_get('pcre.jit');
28  ini_set('pcre.jit', 0);
29  }
30 
31  $current_limit = elgg_get_ini_setting_in_bytes('memory_limit');
32  if (($current_limit > 0) && ($current_limit < (128 * 1024 * 1024))) {
33  $this->iniOriginal['memory_limit'] = ini_get('memory_limit');
34  ini_set('memory_limit', '128M');
35  }
36 
37  $this->filterPlugins();
38  $this->filterAliases();
39 
40  $this->functions->setPattern(true);
41 
42  $this->stat['compile_start_time'] = microtime(true);
43  }
44 }
elgg_get_ini_setting_in_bytes(string $setting)
Returns a PHP INI setting in bytes.
Definition: elgglib.php:319
Css Crush Processor.