PHPackages                             glenjamin/dimple - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. glenjamin/dimple

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

glenjamin/dimple
================

Dirt simple dependency injection container

v0.1.0(12y ago)020MITPHPPHP &gt;= 5.3

Since Jul 27Pushed 12y ago1 watchersCompare

[ Source](https://github.com/glenjamin/dimple)[ Packagist](https://packagist.org/packages/glenjamin/dimple)[ RSS](/packages/glenjamin-dimple/feed)WikiDiscussions master Synced 2mo ago

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

Dimple
======

[](#dimple)

Dirt simple dependency injection container based loosely on Pimple

Install
-------

[](#install)

```
composer require glenjamin/dimple

```

Usage
-----

[](#usage)

```
$di = new \Dimple\Dimple();

$di->setup('app', function($di) {
    return new Application($di->get('db'), $di->get('logger'));
});

$di->setup('db', function($di) {
    return new \PDO($di->get('db-string'));
});

$di->set('dbstring', 'mysql://localhost');
$di->setup('logger', function($di) {
    return new Logger($di->get('logfile', '/dev/null'));
});

$app = $di->get('app');
$app->run();
```

How do I return the same instance on subsequent calls?
------------------------------------------------------

[](#how-do-i-return-the-same-instance-on-subsequent-calls)

You don't.

Is it fast?
-----------

[](#is-it-fast)

Unfortunately not massively, although it's not *too* bad

```
> php benchmark.php
10000000 Iterations
Raw: 4.3745291233063
Dimpled: 14.07391500473

Overhead: 221.724113%

```

It's a little over two times slower than raw object initialisation. If you use it for only your service level objects it should be palatable.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

4675d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/72623f3c7e03752f3e1a5517c3b19451412654bca0e64f0cddbc4a5d08de803d?d=identicon)[glenjamin](/maintainers/glenjamin)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/glenjamin-dimple/health.svg)

```
[![Health](https://phpackages.com/badges/glenjamin-dimple/health.svg)](https://phpackages.com/packages/glenjamin-dimple)
```

###  Alternatives

[phpro/soap-client

A general purpose SoapClient library

8885.6M46](/packages/phpro-soap-client)[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[typo3/cms-reports

TYPO3 CMS Reports - Show status reports and installed services in the (System&gt;Reports) backend module.

137.1M58](/packages/typo3-cms-reports)[lcharette/uf_formgenerator

Form generator for UserFrosting V5

178.7k3](/packages/lcharette-uf-formgenerator)

PHPackages © 2026

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