PHPackages                             rizalmf/slim-simple-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. [HTTP &amp; Networking](/categories/http)
4. /
5. rizalmf/slim-simple-profiler

ActiveLibrary[HTTP &amp; Networking](/categories/http)

rizalmf/slim-simple-profiler
============================

Simple Middleware For Profiling Slim Framework 3

v1.0.0(4y ago)262[2 issues](https://github.com/rizalmf/slim-simple-profiler/issues)[1 PRs](https://github.com/rizalmf/slim-simple-profiler/pulls)MITTwigPHP &gt;=7.3

Since Jul 6Pushed 4y ago1 watchersCompare

[ Source](https://github.com/rizalmf/slim-simple-profiler)[ Packagist](https://packagist.org/packages/rizalmf/slim-simple-profiler)[ Docs](https://github.com/rizalmf)[ RSS](/packages/rizalmf-slim-simple-profiler/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

Slim Simple Profiler
====================

[](#slim-simple-profiler)

Simple Middleware For Profiling Slim Framework 3. implement awesome library [maximebf/debugbar](http://phpdebugbar.com/). Inspired by Codeigniter profiler

Screenshots
-----------

[](#screenshots)

[![1](example/1.jpeg)](example/1.jpeg)[![2](example/2.jpeg)](example/2.jpeg)

Table of contents
-----------------

[](#table-of-contents)

- [Install](#install)
- [Usage](#usage)
    - [Enable/disable darkmode](#Enable/disable-darkmode)
    - [Eloquent/ORM](#eloquent/orm)
    - [Doctrine/ORM](#doctrine/orm)
    - [GuzzleHttp](#guzzlehttp)
    - [Set response format](#set-response-format)
- [License](#license)

Install
-------

[](#install)

via "composer require"

```
composer require rizalmf/slim-simple-profiler
```

Usage:
------

[](#usage)

```
use Simple\Profiler\Profiler;
use Simple\Profiler\Container;

require_once __DIR__ . '/vendor/autoload.php'; // example path

$app = new \Slim\App();

// add middleware
$app->add(new Profiler(new Container()));
```

### Enable/disable darkmode

[](#enabledisable-darkmode)

Set darkmode html format. default: true

```
// ...
$container = new Container();
$container->setDarkMode(false);

$app->add(new Profiler($container));
```

### Eloquent/ORM

[](#eloquentorm)

Register \\Illuminate\\Database\\Capsule\\Manager to container

```
//-------- OPTION ONE --------//
// in case you use static Manager

// ...
$DB = new \Illuminate\Database\Capsule\Manager();
$DB->addConnection($settings['your_eloquent_cfg']);

$DB->setAsGlobal();
$DB->bootEloquent();

// register to container
$container->setEloquentManager($DB);

// add middleware
$app->add(new Profiler($container));

//-------- OPTION TWO --------//
// in case you set eloquent to slim container

// ...
$settings = require __DIR__.'/../config/settings.php';
$app = new \Slim\App($settings);

$appContainer = $app->getContainer();

$appContainer['capsule'] = function ($c) {
    $capsule = new \Illuminate\Database\Capsule\Manager;
    $capsule->addConnection($c->get('settings')['your_eloquent_cfg']);

    $capsule->setAsGlobal();
    $capsule->bootEloquent();

    return $capsule;
};

// register capsule to container
$container->setEloquentManager($appContainer['capsule']);

// add middleware
$app->add(new Profiler($container));
```

### Doctrine/ORM

[](#doctrineorm)

Register \\Doctrine\\DBAL\\Logging\\DebugStack to container

```
// ...
$settings = require __DIR__.'/../config/settings.php';
$app = new \Slim\App($settings);

$appContainer = $app->getContainer();

$appContainer['dao'] = function ($c) {
    $settings = $c->get('settings');

    $config = \Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration(
        $settings['doctrine']['meta']['entity_path'],
        $settings['doctrine']['meta']['auto_generate_proxies'],
        $settings['doctrine']['meta']['proxy_dir'],
        $settings['doctrine']['meta']['cache'],
        false
    );
    return \Doctrine\ORM\EntityManager::create($settings['doctrine']['connection'], $config);
};

// first.. you have to bind DebugStack to your entityManager
$logger = new \Doctrine\DBAL\Logging\DebugStack();
$appContainer['dao']->getConnection()
    ->getConfiguration()
    ->setSQLLogger($logger);

// register DebugStack to container
$container->setDoctrineStack($logger);

// add middleware
$app->add(new Profiler($container));
```

### GuzzleHttp

[](#guzzlehttp)

Catch guzzlehttp events via Profiler::guzzleStack()

```
// ...

$stack = \GuzzleHttp\HandlerStack::create();
$stack->push(\Simple\Profiler\Profiler::guzzleStack());

// set options \GuzzleHttp\Client
$options['handler'] = $stack;
$client = new \GuzzleHttp\Client($options);
```

### Set response format

[](#set-response-format)

Default: Container::HTTP\_FORMAT

```
// ...
$container = new Container();

// response as text/html
$container->setResponseFormat(Container::HTTP_FORMAT);

// response as application/json content-type
$container->setResponseFormat(Container::JSON_FORMAT);

$app->add(new Profiler($container));
```

LICENSE
-------

[](#license)

The MIT License (MIT) Copyright (c) 2021 Rizal Maulana Fahmi

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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

1768d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8be4465a069b513fa50a37e0667e011c9df567926a844a9d783f267afb296b56?d=identicon)[rizalmf](/maintainers/rizalmf)

---

Top Contributors

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

---

Tags

phpphp-libraryslim-frameworkpsr-7middlewaredebugprofilerslim-frameworkslim 3

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rizalmf-slim-simple-profiler/health.svg)

```
[![Health](https://phpackages.com/badges/rizalmf-slim-simple-profiler/health.svg)](https://phpackages.com/packages/rizalmf-slim-simple-profiler)
```

###  Alternatives

[psr/http-server-middleware

Common interface for HTTP server-side middleware

18091.2M1.5k](/packages/psr-http-server-middleware)[mezzio/mezzio

PSR-15 Middleware Microframework

3883.6M97](/packages/mezzio-mezzio)[tuupola/slim-basic-auth

PSR-7 and PSR-15 HTTP Basic Authentication Middleware

4442.0M25](/packages/tuupola-slim-basic-auth)[relay/relay

A PSR-15 server request handler.

3302.1M85](/packages/relay-relay)[php-middleware/php-debug-bar

PHP Debug Bar PSR-15 middleware with PSR-7

76433.5k2](/packages/php-middleware-php-debug-bar)[tuupola/cors-middleware

PSR-7 and PSR-15 CORS middleware

1331.8M24](/packages/tuupola-cors-middleware)

PHPackages © 2026

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