PHP code example of justbetter / magento2-xhprof-profiler
1. Go to this page and download the library: Download justbetter/magento2-xhprof-profiler library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
justbetter / magento2-xhprof-profiler example snippets
namespace JustBetter\XhprofProfiler\Plugin;
use JustBetter\XhprofProfiler\Model\Profiler\XhprofProfiler;
use Magento\Framework\App\ResponseInterface;
use Magento\Framework\AppInterface as Application;
class AppInterfacePlugin
{
public function __construct(
protected XhprofProfiler $profiler
)
{
}
public function aroundLaunch(
Application $subject,
callable $proceed,
) : ResponseInterface {
$this->profiler->handle();
$response = $proceed();
$this->profiler->terminate();
return $response;
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.