PHPackages                             erip/ldic - 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. erip/ldic

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

erip/ldic
=========

A lightweight dependency injection container for PHP.

1.0(5y ago)05MITPHPPHP &gt;=7.1CI failing

Since Jun 24Pushed 5y agoCompare

[ Source](https://github.com/serkanerip/ldic)[ Packagist](https://packagist.org/packages/erip/ldic)[ Docs](https://github.com/serkanerip/LDic)[ RSS](/packages/erip-ldic/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

LDic
====

[](#ldic)

[![Latest Version](https://camo.githubusercontent.com/f5840b1a7e6cf81ce84e8baad569e537749f4080957af4a439e0fca9242d15f2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f7468657068706c65616775652f736b656c65746f6e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/serkanerip/ldic/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/edbfd91d13274721ee569e30d83e249acfb5e7aa49077708b5c8349b15d0487c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c65616775652f736b656c65746f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/erip/ldic)

LDic, is a lightweight dependency injection container for php. Just with 3 public functions and less than 130 lines of code.

Install
-------

[](#install)

Via Composer

```
$ composer require erip/ldic
```

Usage
-----

[](#usage)

```
class Foo {}

$container = new Erip\LDic();
$container->register(new Foo());
$productUtils = $container->resolve(Foo::class);

// Lazy Registration

// This dependency will be created only when needed.
$container->lazyRegister(function(){
    return new Foo();
});

$productUtils = $container->resolve(Foo::class);
```

Testing
-------

[](#testing)

```
$ phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/serkanerip/ldic/blob/master/CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [serkanerip](https://github.com/serkanerip)
- [All Contributors](https://github.com/serkanerip/ldic/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

22

—

LowBetter than 23% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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

2144d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0c596323f661e82bfa82896d884843719296bbd9648fbcf7684ca0a5cd01167c?d=identicon)[serkanerip](/maintainers/serkanerip)

---

Top Contributors

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

---

Tags

dependency-injection

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/erip-ldic/health.svg)

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

###  Alternatives

[php-di/invoker

Generic and extensible callable invoker

26857.8M56](/packages/php-di-invoker)[level-2/dice

A minimalist Dependency injection container (DIC) for PHP. Please note: 3.0+ is only compatible with PHP 7.0. The 2.0 branch is compatbile with PHP 5.6.

437730.3k16](/packages/level-2-dice)[respect/config

A powerful, small, deadly simple configurator and dependency injection container made to be easy.

10211.4k1](/packages/respect-config)[arokettu/phpstorm-metadata-export

Export PhpStorm Advanced Metadata from DI containers

1234.0k1](/packages/arokettu-phpstorm-metadata-export)[x-wp/di

The dependency injection container for WordPress

301.1k10](/packages/x-wp-di)[michaels/data-manager

Simple data manager for nested data, dot notation array access, extendability, and container interoperability.

121.9k2](/packages/michaels-data-manager)

PHPackages © 2026

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