PHP code example of cadre / atlasorm-debugbar-bridge

1. Go to this page and download the library: Download cadre/atlasorm-debugbar-bridge 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/ */

    

cadre / atlasorm-debugbar-bridge example snippets


$atlasContainer = new Cadre\AtlasOrmDebugBarBridge\AtlasContainer(
    'mysql:host=localhost;dbname=testdb',
    'username',
    'password'
);

$debugbar = new DebugBar\StandardDebugBar();
$debugbar->addCollector(
    new Cadre\AtlasOrmDebugBarBridge\AtlasOrmCollector($atlasContainer)
);

$atlasContainer = Cadre\AtlasOrmDebugBarBridge\AtlasContainer(
    'mysql:host=localhost;dbname=testdb',
    'username',
    'password'
);

$factory = new Cadre\AtlasOrmDebugBarBridge\ConnectionFactory(
    'mysql:host=localhost;dbname=slavedb',
    'readonly',
    'password'
);

$atlasContainer->setReadConnection('readonly', $factory);

$collector = new Cadre\AtlasOrmDebugBarBridge\AtlasOrmCollector($container);
$collector->addConnectionFactory($factory, 'readonly');

$debugbar = new DebugBar\StandardDebugBar();
$debugbar->addCollector($collector);