PHP code example of pccomponentes / apm-doctrine-dbal
1. Go to this page and download the library: Download pccomponentes/apm-doctrine-dbal 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/ */
pccomponentes / apm-doctrine-dbal example snippets
declare(strict_types=1);
$sqlLogger = new PcComponentes\ElasticAPM\Doctrine\DBAL\Logging\SQLLogger(
$apmTracer, /** \ZoiloMora\ElasticAPM\ElasticApmTracer instance. */
'test',
'mysql',
);
$configuration = new Doctrine\DBAL\Configuration();
$configuration->setSQLLogger($sqlLogger);
$connection = Doctrine\DBAL\DriverManager::getConnection(
[
'url' => 'mysql://user:password@localhost:3306/test',
'driver' => 'pdo_mysql',
'charset' => 'UTF8',
],
$configuration,
);
/** ... Use the connection in your project */