Skip to content

Commit 43c466a

Browse files
committed
Merge remote-tracking branch 'ogresce/MAGETWO-20864-cache-profiling' into develop
Conflicts: lib/internal/Magento/Framework/App/ObjectManagerFactory.php
2 parents b10f2fb + df4f503 commit 43c466a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/internal/Magento/Framework/App/ObjectManagerFactory.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,19 @@ public function create(array $arguments)
127127
}
128128
}
129129

130+
// set cache profiler decorator if enabled
131+
if (\Magento\Framework\Profiler::isEnabled()) {
132+
$cacheFactoryArguments = $diConfig->getArguments('Magento\Framework\App\Cache\Frontend\Factory');
133+
$cacheFactoryArguments['decorators'][] = [
134+
'class' => 'Magento\Framework\Cache\Frontend\Decorator\Profiler',
135+
'parameters' => ['backendPrefixes' => ['Zend_Cache_Backend_', 'Cm_Cache_Backend_']],
136+
];
137+
$cacheFactoryConfig = [
138+
'Magento\Framework\App\Cache\Frontend\Factory' => ['arguments' => $cacheFactoryArguments]
139+
];
140+
$diConfig->extend($cacheFactoryConfig);
141+
}
142+
130143
$sharedInstances = [
131144
'Magento\Framework\App\DeploymentConfig' => $deploymentConfig,
132145
'Magento\Framework\App\Filesystem\DirectoryList' => $this->directoryList,

0 commit comments

Comments
 (0)