mirror of
https://github.com/maximebf/php-debugbar.git
synced 2025-07-18 23:31:24 +02:00
Update the base collectors doc to show how to collect multiple PDO connections
Updating the docs to reflect the changes in the `PDOCollector` class Reference maximebf/php-debugbar#5
This commit is contained in:
@@ -60,6 +60,17 @@ Logs SQL queries. You need to wrap your `PDO` object into a `DebugBar\DataCollec
|
|||||||
$pdo = new DebugBar\DataCollector\PDO\TraceablePDO(new PDO('sqlite::memory:'));
|
$pdo = new DebugBar\DataCollector\PDO\TraceablePDO(new PDO('sqlite::memory:'));
|
||||||
$debugbar->addCollector(new DebugBar\DataCollector\PDO\PDOCollector($pdo));
|
$debugbar->addCollector(new DebugBar\DataCollector\PDO\PDOCollector($pdo));
|
||||||
|
|
||||||
|
You can even log queries from multiple `PDO` connections:
|
||||||
|
|
||||||
|
$pdoRead = new DebugBar\DataCollector\PDO\TraceablePDO(new PDO('sqlite::memory:'));
|
||||||
|
$pdoWrite = new DebugBar\DataCollector\PDO\TraceablePDO(new PDO('sqlite::memory:'));
|
||||||
|
|
||||||
|
$pdoCollector = new DebugBar\DataCollector\PDO\PDOCollector();
|
||||||
|
$pdoCollector->addConnection($pdoRead, 'read-db');
|
||||||
|
$pdoCollector->addConnection($pdoWrite, 'write-db');
|
||||||
|
|
||||||
|
$debugbar->addCollector($pdoCollector);
|
||||||
|
|
||||||
## RequestData
|
## RequestData
|
||||||
|
|
||||||
Collects the data of PHP's global variables
|
Collects the data of PHP's global variables
|
||||||
|
Reference in New Issue
Block a user