PHPackages                             srgiz/phalcon-profiler - 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. srgiz/phalcon-profiler

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

srgiz/phalcon-profiler
======================

0.7.0(10mo ago)24MITPHPPHP &gt;=8.0

Since Apr 27Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/srgiz/phalcon-profiler)[ Packagist](https://packagist.org/packages/srgiz/phalcon-profiler)[ RSS](/packages/srgiz-phalcon-profiler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (3)Used By (0)

Phalcon profiler
================

[](#phalcon-profiler)

Supports micro and classic app.

[![coverage](tests/badge/coverage.svg)](tests/badge/coverage.svg)

`composer require --dev srgiz/phalcon-profiler`

- PHP &gt;= 8.0
- Phalcon &gt;= 5.1

[![screenshot.png](screenshot.jpeg)](screenshot.jpeg)

Install
-------

[](#install)

Di:

```
# Phalcon\Mvc\Application

use Phalcon\Di\DiInterface;
use Phalcon\Mvc\Application;
use Srgiz\Phalcon\WebProfiler\WebProfiler;

/** @var DiInterface $di */
if ('dev' === $env) {
    $di->register(new WebProfiler());
}

$application = new Application($di);
$application->setEventsManager($di->getShared('eventsManager'));
```

```
# Phalcon\Mvc\Micro

use Phalcon\Di\DiInterface;
use Phalcon\Mvc\Micro;
use Srgiz\Phalcon\WebProfiler\WebProfiler;

/** @var DiInterface $di */
if ('dev' === $env) {
    $di->register(new WebProfiler());
}

$app = new Micro($di);
$app->setEventsManager($di->getShared('eventsManager'));
```

Configure eventsManager:

```
eventsManager:
  className: Phalcon\Events\Manager
  calls:
    - method: enablePriorities
      arguments:
        - { type: parameter, value: true }
```

Enable events in services:

```
dispatcher:
db:
view:
volt:
  calls:
    - method: setEventsManager
      arguments:
        - { type: service, name: eventsManager }
```

Profiler config
---------------

[](#profiler-config)

```
// ./config/config.php

return [
    'profiler' => [
        'viewsCachePath' => '/var/www/var/cache/volt/',
        'tagsDir' => '/var/www/var/profiler',
        //'routePrefix' => '/_profiler',
        //'collectors' => [ /** @see \Srgiz\Phalcon\WebProfiler\Collector\CollectorInterface */
        //    CustomCollector::class,
        //],
    ],
];
```

Toolbar
-------

[](#toolbar)

```
{# layout.volt #}

content

{% if _profilerTag is defined %}

        document.addEventListener('DOMContentLoaded', function () {
            fetch('{{ url(['for': '_profiler-bar', 'tag': _profilerTag])|escape_js }}')
                .then(function(res) { return res.text() })
                .then(function(data) {
                    document.body.innerHTML += data
                })
                .catch(function(e) {
                    console.error(e)
                })
        })

{% endif %}

```

[![screenshot.bar.png](screenshot.bar.png)](screenshot.bar.png)

Logger
------

[](#logger)

Create a logger adapter:

```
$container->setShared('devLoggerAdapter', function () use ($container) {
    return $container->has('profilerLoggerAdapter')
        ? $container->getShared('profilerLoggerAdapter')
        : new \Phalcon\Logger\Adapter\Noop();
});
```

Usage:

```
logger:
  className: Phalcon\Logger\Logger
  shared: true
  arguments:
    - { type: parameter, value: main }
  calls:
    - method: addAdapter
      arguments:
        - { type: parameter, value: profiler }
        - { type: service, name: devLoggerAdapter }
```

Stopwatch in production
-----------------------

[](#stopwatch-in-production)

Create a stopwatch adapter:

```
use Phalcon\Di\DiInterface;
use Phalcon\Di\ServiceProviderInterface;

class StopwatchProvider implements ServiceProviderInterface
{
    public function register(DiInterface $di): void
    {
        $di->setShared('stopwatch', function () use ($di) {
            return $di->has('profilerStopwatch') ? $di->getShared('profilerStopwatch') : null;
        });
    }
}
```

Usage:

```
$di->get('stopwatch')?->start('test');
// ...
$di->get('stopwatch')?->stop('test');
```

Custom collector
----------------

[](#custom-collector)

```
use Srgiz\Phalcon\WebProfiler\Collector\CollectorInterface;

class CustomCollector implements CollectorInterface
{
    public function templatePath(): string
    {
        return '/var/www/templates/custom'; // .volt
    }

    public function name(): string
    {
        return 'Custom';
    }

    public function collect(): array
    {
        return [
            'message' => 'hello',
        ];
    }
}
```

```
{# custom.volt #}
{% extends '@profiler/data.volt' %}

{% block panel %}
    Message: {{ message|e }}
{% endblock %}
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance56

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 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

Every ~70 days

Total

2

Last Release

307d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2b562ab1752308fda1b8b3cfbe2cc8c97a1f226ca7227ba2c9c8c4e29036f3c3?d=identicon)[Serginho](/maintainers/Serginho)

---

Top Contributors

[![srgiz](https://avatars.githubusercontent.com/u/1897936?v=4)](https://github.com/srgiz "srgiz (11 commits)")

---

Tags

debugprofilerdebugbarwebprofilerphalcon

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/srgiz-phalcon-profiler/health.svg)

```
[![Health](https://phpackages.com/badges/srgiz-phalcon-profiler/health.svg)](https://phpackages.com/packages/srgiz-phalcon-profiler)
```

###  Alternatives

[barryvdh/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k124.3M621](/packages/barryvdh-laravel-debugbar)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k662.9k28](/packages/fruitcake-laravel-debugbar)[fruitcake/laravel-telescope-toolbar

Toolbar for Laravel Telescope based on Symfony Web Profiler

8041.6M3](/packages/fruitcake-laravel-telescope-toolbar)[snowair/phalcon-debugbar

Integrates PHP Debug Bar with Phalcon.

160123.3k1](/packages/snowair-phalcon-debugbar)[recca0120/laravel-tracy

A Laravel Package to integrate Nette Tracy Debugger

388283.0k3](/packages/recca0120-laravel-tracy)

PHPackages © 2026

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