forked from mirasvit/module-profiler
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathregistration.php
More file actions
28 lines (24 loc) · 738 Bytes
/
registration.php
File metadata and controls
28 lines (24 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
$_SERVER['MAGE_PROFILER_STAT'] = new \Magento\Framework\Profiler\Driver\Standard\Stat();
$canEnable = true;
if (PHP_SAPI == 'cli') {
global $argv;
if (isset($argv[1]) && substr($argv[1], 0, strlen('setup')) == 'setup') {
$canEnable = false;
}
}
if ($canEnable) {
\Magento\Framework\Profiler::applyConfig([
'drivers' => [
[
'output' => 'Mirasvit\Profiler\Model\Driver\Output\Html',
'stat' => $_SERVER['MAGE_PROFILER_STAT'],
],
],
], 'BP', false);
}
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Mirasvit_Profiler',
__DIR__ . '/src/Profiler'
);