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

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

naucon/registry
===============

This package provides a generic registry class to register any type of data under a identifier (key/value).

1.0.0(8y ago)212.8k—5.6%2MITPHPPHP &gt;=5.5.0

Since May 25Pushed 8y ago1 watchersCompare

[ Source](https://github.com/naucon/Registry)[ Packagist](https://packagist.org/packages/naucon/registry)[ Docs](https://github.com/naucon/Registry)[ RSS](/packages/naucon-registry/feed)WikiDiscussions master Synced 1mo ago

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

naucon Registry Package
=======================

[](#naucon-registry-package)

version 1.0

About
-----

[](#about)

This package provides a generic registry class to register any type of data under an identifier (key/value). The registry can also be restricted to take only objects of a specific class or interface. All registred entries can be returned. A specific entry can be returned or removed by its identifier.

### Features

[](#features)

- key/value storage
- restricting to a specified interface
- fluent interface for register(), unregister()

### Compatibility

[](#compatibility)

- PHP5.5

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

[](#installation)

install the latest version via composer

```
composer require naucon/registry

```

Usage
-----

[](#usage)

create registry instance

```
use Naucon\Registry\Registry;
$registry = new Registry();

```

restrict a registry instance to a specified interface or class

```
use Naucon\Registry\Registry;
$registry = new Registry('Naucon\Foo\AdapterInterface');

```

add entry to registry

```
$registry->register('service_foo', 'foo');
$registry->register('service_bar', 'bar');

```

get entry from registry

```
var_dump($registry->get('service_foo')); // foo
var_dump($registry->get('service_missing')); // null

```

check if an entry is registred in registry

```
var_dump($registry->has('service_foo')); // true
var_dump($registry->has('service_missing')); // false

```

get all entries from registry

```
var_dump($registry->all()); // foo, bar

```

remove entry to registry

```
$registry->unregister('service_foo');
$registry->has('service_foo'); // false

```

Example
-------

[](#example)

Start the build-in webserver to see the examples in action:

```
cd examples
php -S 127.0.0.1:3000

```

open url in browser

```
http://127.0.0.1:3000/index.html

```

License
-------

[](#license)

The MIT License (MIT)

Copyright (c) 2015 Sven Sanzenbacher

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

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

3281d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

registerregistrypriority

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[sylius/registry

Services registry.

6211.0M40](/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)
