PHPackages                             imj/registry - 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. imj/registry

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

imj/registry
============

A simple and lightweight registry

v1.0.3(9y ago)022MITPHPPHP &gt;=5.4.0

Since Jun 21Pushed 9y agoCompare

[ Source](https://github.com/itsmikej/Registry)[ Packagist](https://packagist.org/packages/imj/registry)[ RSS](/packages/imj-registry/feed)WikiDiscussions master Synced yesterday

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

A simple and lightweight registry
=================================

[](#a-simple-and-lightweight-registry)

[![Build Status](https://camo.githubusercontent.com/ee4a0f7045bbe4b7c870f79e7e27a13707cf20a5728e2539826ad61c4e31fae3/68747470733a2f2f7472617669732d63692e6f72672f6974736d696b656a2f52656769737472792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/itsmikej/Registry)[![Latest Stable Version](https://camo.githubusercontent.com/64b25e644d06d767b8535bfd3867cd86956b7e6589a4c10c2a76f24e493193d9/68747470733a2f2f706f7365722e707567782e6f72672f696d6a2f72656769737472792f762f737461626c65)](https://packagist.org/packages/imj/registry)[![Total Downloads](https://camo.githubusercontent.com/92a4ec739d8fc753785ea43f99a17239c981c123868c3f59240c2bdd83622337/68747470733a2f2f706f7365722e707567782e6f72672f696d6a2f72656769737472792f646f776e6c6f616473)](https://packagist.org/packages/imj/registry)[![License](https://camo.githubusercontent.com/cd7338c1016850dadc2098a5c60571da8ec7d2cd82cfc1539540bcfee9f259b0/68747470733a2f2f706f7365722e707567782e6f72672f696d6a2f72656769737472792f6c6963656e7365)](https://packagist.org/packages/imj/registry)

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

[](#installation)

```
composer require imj/registry
```

Basic Usage
-----------

[](#basic-usage)

```
use Imj\Registry;
$r = new Registry();
$r->set('foo', 'a');
echo $r->get('foo'); // a
echo $r['foo']; // a

$r['bar'] = 'b';
echo $r['bar']; // b
```

lazy load

```
use Imj\Registry;

class Foo
{
  public function sayHi()
  {
    return 'hi';
  }
}

$r->singleton('foo_class', function($c){
  return new Foo();
});
echo $r->get('foo_class')->sayHi(); // hi
echo $r->foo_class->sayHi(); // hi
```

service register

```
use Imj\ServiceProviderInterface;
use Imj\Registry;

class LibraryProvider implements ServiceProviderInterface
{
  public function register(Registry $registry)
  {
    $registry->singleton('bar_class', function($c){
      return new Bar();
    });
  }
}

class Bar
{
  public function sayHey()
  {
    return 'hey';
  }
}

$r->register(new LibraryProvider());
echo $r->bar_class->sayHey(); // hey
```

License
-------

[](#license)

licensed under the MIT License - see the `LICENSE` file for details

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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 ~113 days

Total

4

Last Release

3322d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.3.0

v1.0.3PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f2f9f468a9f96136e78bf56c403a526dcc06e7eed79e627683f2ca73b1142ac8?d=identicon)[itsmikej](/maintainers/itsmikej)

---

Top Contributors

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

---

Tags

php-libraryregistry

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/imj-registry/health.svg)

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

###  Alternatives

[sylius/registry

Services registry.

6111.5M54](/packages/sylius-registry)[bnomei/autoloader-for-kirby

Helper to automatically load various Kirby extensions in a plugin

185.7k2](/packages/bnomei-autoloader-for-kirby)

PHPackages © 2026

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