2017 © Pedro Peláez
 

library atlasorm-debugbar-bridge

Library to use PHP DebugBar with Atlas ORM

image

cadre/atlasorm-debugbar-bridge

Library to use PHP DebugBar with Atlas ORM

  • Friday, July 28, 2017
  • by andrewshell
  • Repository
  • 2 Watchers
  • 5 Stars
  • 65 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 3 % Grown

The README.md

AtlasOrm.DebugBar.Bridge

Read the instructions for using Atlas.Orm and PHP Debug Bar. I'll just show you what you need to do to make these work together., (*1)

1. Include Atlas.Orm and PHP Debug Bar in your project

I'm not listing either of these as a dependency of this library because I'll let you define what version and stability you want in your project., (*2)

2. Use Cadre\AtlasOrmDebugBarBridge\AtlasContainer

Instead of using the normal Atlas\Orm\AtlasContainer use Cadre\AtlasOrmDebugBarBridge\AtlasContainer., (*3)

This class functions exactly as the normal Atlas.ORM one only it uses Cadre\AtlasOrmDebugBarBridge\ExtendedPdo instead of Aura\Sql\ExtendedPdo which wraps the inner PDO object in DebugBar\DataCollector\PDO\TraceablePDO., (*4)

3. Use Cadre\AtlasOrmDebugBarBridge\AtlasOrmCollector

I've provided Cadre\AtlasOrmDebugBarBridge\AtlasOrmCollector which takes a Cadre\AtlasOrmDebugBarBridge\AtlasContainer, pulls the DebugBar\DataCollector\PDO\TraceablePDO object out of it and passes it up to its parent DebugBar\DataCollector\PDO\PDOCollector., (*5)

Example

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

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

Multiple Connections

$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);

The Versions

28/07 2017

1.x-dev

1.9999999.9999999.9999999-dev

Library to use PHP DebugBar with Atlas ORM

  Sources   Download

MIT

The Development Requires

by Andrew Shell

17/02 2017

1.1.0

1.1.0.0

Library to use PHP DebugBar with Atlas ORM

  Sources   Download

MIT

The Development Requires

by Andrew Shell

20/10 2016

1.0.2

1.0.2.0

Library to use PHP DebugBar with Atlas ORM

  Sources   Download

MIT

The Development Requires

by Andrew Shell

14/10 2016

1.0.1

1.0.1.0

Library to use PHP DebugBar with Atlas ORM

  Sources   Download

MIT

by Andrew Shell

13/10 2016

1.0.0

1.0.0.0

Library to use PHP DebugBar with Atlas ORM

  Sources   Download

MIT

by Andrew Shell