PHPackages                             slam/dbal-debugstack-middleware - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. slam/dbal-debugstack-middleware

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

slam/dbal-debugstack-middleware
===============================

Doctrine\\DBAL middleware for precise query debugging (DebugStack replacement)

v2.3.0(6mo ago)317.9k↓30.1%[2 issues](https://github.com/Slamdunk/dbal-debugstack-middleware/issues)[1 PRs](https://github.com/Slamdunk/dbal-debugstack-middleware/pulls)1MITPHPPHP ~8.4.0 || ~8.5.0CI passing

Since Dec 13Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/Slamdunk/dbal-debugstack-middleware)[ Packagist](https://packagist.org/packages/slam/dbal-debugstack-middleware)[ Fund](https://paypal.me/filippotessarotto)[ GitHub Sponsors](https://github.com/Slamdunk)[ RSS](/packages/slam-dbal-debugstack-middleware/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (6)Versions (8)Used By (1)

Slam\\DbalDebugstackMiddleware
==============================

[](#slamdbaldebugstackmiddleware)

[![Latest Stable Version](https://camo.githubusercontent.com/1927fc1120cdeb07dada96ea6e424f05980ec8c4fe696220e153d4e09923ca57/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736c616d2f6462616c2d6465627567737461636b2d6d6964646c65776172652e737667)](https://packagist.org/packages/slam/dbal-debugstack-middleware)[![Downloads](https://camo.githubusercontent.com/a84b5c410e2c09ce6905583e52d0e3df9413d1ff8407768db48dfac170859378/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736c616d2f6462616c2d6465627567737461636b2d6d6964646c65776172652e737667)](https://packagist.org/packages/slam/dbal-debugstack-middleware)[![Integrate](https://github.com/Slamdunk/dbal-debugstack-middleware/workflows/CI/badge.svg)](https://github.com/Slamdunk/dbal-debugstack-middleware/actions)

Doctrine\\DBAL middleware for precise query debugging (DebugStack replacement). Compared to the [default logging middleware](https://github.com/doctrine/dbal/pull/4967), this one:

1. Tracks the query's execution time
2. Doesn't handle exceptions
3. Doesn't track disconnections

Installation
------------

[](#installation)

`composer require slam/dbal-debugstack-middleware`

Usage
-----

[](#usage)

```
use Doctrine\DBAL\Configuration;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\ParameterType;
use Slam\DbalDebugstackMiddleware\DebugStack;
use Slam\DbalDebugstackMiddleware\Middleware;

$debugStack = new DebugStack();

$conn = DriverManager::getConnection(
    $connectionParams,
    (new Configuration)->setMiddlewares([
        new Middleware($debugStack)
    ])
);

$result = $conn->executeQuery(
    'SELECT * FROM users WHERE active = :active',
    ['active' => true],
    ['active' => ParameterType::BOOLEAN],
);

print_r($debugStack->popQueries());

/*
 * Output:
 *
    Array
    (
        [0] => Slam\DbalDebugstackMiddleware\Query Object
            (
                [sql] => SELECT * FROM users WHERE active = :active
                [params] => Array
                    (
                        [active] => true
                    )
                [types] => Array
                    (
                        [active] => 5
                    )
                [executionMs] => 72.05312
            )
    )
 */
```

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance66

Regular maintenance activity

Popularity30

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 93.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~170 days

Total

5

Last Release

207d ago

Major Versions

v1.0.0 → v2.0.02024-02-06

PHP version history (3 changes)v1.0.0PHP ~8.2.0 || ~8.3.0

v2.1.0PHP ~8.3.0 || ~8.4.0

v2.3.0PHP ~8.4.0 || ~8.5.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/50348?v=4)[Sahn Lam](/maintainers/Slam)[@slam](https://github.com/slam)

---

Top Contributors

[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (188 commits)")[![Slamdunk](https://avatars.githubusercontent.com/u/152236?v=4)](https://github.com/Slamdunk "Slamdunk (13 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/slam-dbal-debugstack-middleware/health.svg)

```
[![Health](https://phpackages.com/badges/slam-dbal-debugstack-middleware/health.svg)](https://phpackages.com/packages/slam-dbal-debugstack-middleware)
```

###  Alternatives

[symfony/stopwatch

Provides a way to profile code

2.8k387.2M918](/packages/symfony-stopwatch)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k662.9k29](/packages/fruitcake-laravel-debugbar)[koriym/printo

An object graph visualizer.

1421.8M2](/packages/koriym-printo)[soloterm/dumps

A Laravel command to intercept dumps from your Laravel application.

125285.7k3](/packages/soloterm-dumps)[steevanb/php-backtrace

Nice debug\_backtrace() dump, with call and code preview

22142.6k5](/packages/steevanb-php-backtrace)[ikkez/f3-falsum

Pretty error handling for Fat-Free Framework

21145.8k3](/packages/ikkez-f3-falsum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
