PHPackages                             carlosekt/psql\_debug - 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. carlosekt/psql\_debug

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

carlosekt/psql\_debug
=====================

Phalcon SQL Debug Bar for version 3.x.x

0.1.1(7y ago)121MITPHPPHP &gt;=5.6.0

Since Oct 18Pushed 7y ago2 watchersCompare

[ Source](https://github.com/carlosekt/PSQL_Debug)[ Packagist](https://packagist.org/packages/carlosekt/psql_debug)[ Docs](https://github.com/carlosekt/PSQL_Debug)[ RSS](/packages/carlosekt-psql-debug/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

PSQL\_Debug
===========

[](#psql_debug)

Phalcon SQL Debug Bar for version 3.x.x
Support Raw SQL, PHQL, replace phalcon placeholders
It shows queries, queries execution time, highlights long and erroneous queries, plus small system information ...

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

[](#installation)

1. Include packagist repository into your project.

```
composer require carlosekt/psql_debug

```

OR include file into your code

```
include 'path_to_class' . 'PSQL_Debug.php';

```

2. In public/index.php after &lt;?php open tag add:

```
     define('SYSTEM_START_TIME', microtime(true));
```

3. Into your config add variable:

```
    ...
    'sql_debug' => true //false
    ...
```

4. After echo $application-&gt;handle()-&gt;getContent(); add:

```
    if ($di->get('config')->sql_debug) {
        \CarlosEkt\PSQL_Debug::getInstance()->end(microtime(true));
    }
```

5. In loadServices() function, where you set DB connection in DI add:

```
    //Example register a 'db' service in the container
    $di->set('db', function () use ($config) {
        $connection = new \Phalcon\Db\Adapter\Pdo\Mysql([
            'host' => $config->database->host,
            'username' => $config->database->username,
            'password' => $config->database->password,
            'dbname' => $config->database->dbname,
            'charset' => $config->database->charset
        ]);

        if ($config->sql_debug) {
            $eventsManager = new \Phalcon\Events\Manager();

            \CarlosEkt\PSQL_Debug::getInstance()->init(SYSTEM_START_TIME);
            $eventsManager->attach('db', function ($event) {
                /** @var Phalcon\Events\Event $event */
                if ($event->getType() === 'beforeQuery') {
                    \CarlosEkt\PSQL_Debug::getInstance()->queryStart(microtime(true));
                }
                if ($event->getType() === 'afterQuery') {
                    $sql = \CarlosEkt\PSQL_Debug::getInstance()->getLastQuery(true);
                    \CarlosEkt\PSQL_Debug::getInstance()->queryEnd($sql, microtime(true));
                }
            });
            $connection->setEventsManager($eventsManager);
        }
        return $connection;
    }, true);
```

\##At the bottom of the page will appear: [![alt text](https://camo.githubusercontent.com/16d7b25c153f08d983fa16e01bafe6c84a0399e753b898e3d5392d2a6ef21aa5/68747470733a2f2f692e696d6775722e636f6d2f6c6a716f3368632e706e67)](https://camo.githubusercontent.com/16d7b25c153f08d983fa16e01bafe6c84a0399e753b898e3d5392d2a6ef21aa5/68747470733a2f2f692e696d6775722e636f6d2f6c6a716f3368632e706e67)

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

2811d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14162635?v=4)[Igor Shkunov](/maintainers/carlosekt)[@carlosekt](https://github.com/carlosekt)

---

Top Contributors

[![carlosekt](https://avatars.githubusercontent.com/u/14162635?v=4)](https://github.com/carlosekt "carlosekt (7 commits)")

### Embed Badge

![Health badge](/badges/carlosekt-psql-debug/health.svg)

```
[![Health](https://phpackages.com/badges/carlosekt-psql-debug/health.svg)](https://phpackages.com/packages/carlosekt-psql-debug)
```

###  Alternatives

[fjogeleit/prometheus-messenger-middleware

Prometheus Middleware for the Symfony Messenger Component

2255.2k](/packages/fjogeleit-prometheus-messenger-middleware)[spatie/craft-ray

Easily debug CraftCMS projects

1638.4k](/packages/spatie-craft-ray)

PHPackages © 2026

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