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