Conditions | 6 |
Paths | 6 |
Total Lines | 20 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | public function __construct() |
||
24 | { |
||
25 | if (!extension_loaded(config('xhprof.extension_name', 'xhprof'))) { |
||
26 | return; |
||
27 | } |
||
28 | |||
29 | if (!config('xhprof.enabled', false)) { |
||
30 | return; |
||
31 | } |
||
32 | |||
33 | $freq = config('xhprof.freq', 0.01); |
||
34 | if ($freq >= (mt_rand() / mt_getrandmax())) { |
||
35 | switch (config('xhprof.provider', XHProfProvider::class)) { |
||
36 | case TidewaysProvider::class: |
||
37 | $this->provider = new TidewaysProvider(); |
||
38 | break; |
||
39 | default: |
||
40 | case XHProfProvider::class: |
||
41 | $this->provider = new XHProfProvider(); |
||
42 | break; |
||
43 | } |
||
68 |