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

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

ignaszak/registry
=================

Registry pattern

v1.1.1(10y ago)0191[1 issues](https://github.com/ignaszak/php-registry/issues)MITPHPPHP &gt;=7.0

Since Dec 12Pushed 8y ago1 watchersCompare

[ Source](https://github.com/ignaszak/php-registry)[ Packagist](https://packagist.org/packages/ignaszak/registry)[ RSS](/packages/ignaszak-registry/feed)WikiDiscussions master Synced 3w ago

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

ignaszak/registry
=================

[](#ignaszakregistry)

[![Build Status](https://camo.githubusercontent.com/735b5a2ccf72bec947143ebb61eae7776d83f54ed02d2272e7ed43c89ce6492a/68747470733a2f2f7472617669732d63692e6f72672f69676e61737a616b2f7068702d72656769737472792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ignaszak/php-registry) [![Coverage Status](https://camo.githubusercontent.com/0f91d3bec6f43f267efed5fc9419b1b970609370d3e693be79cc09c25e93b9bd/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f69676e61737a616b2f7068702d72656769737472792f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/ignaszak/php-registry?branch=master)

Registry pattern

Installing
----------

[](#installing)

The package is avilable via [Composer/Packagist](https://packagist.org/packages/ignaszak/registry), so just add following lines to your composer.json file:

```
"require" : {
    "ignaszak/registry" : "*"
}
```

or:

```
composer require ignaszak/registry
```

Running Tests
-------------

[](#running-tests)

Just run phpunit from the working directory

```
phpunit
```

Requirments
-----------

[](#requirments)

php &gt;= 7.0

Example
-------

[](#example)

```
use Ignaszak\Registry\Conf;
use Ignaszak\Registry\RegistryFactory;

include __DIR__ . '/autoload.php';

// Configuration - optional
// Conf::setTmpPath(string $tmpPath);      // default: './src/tmp'
// Conf::setCookieLife(int $cookieLife);   // default: 30 days
// Conf::setCookiePath(string $cookiePath) // default: '/'

// Use start method to begin
// RegistryFactory::start([string $registry = 'request']):
//      'request' - stores objects in variable - DEFAULT OPTION
//      'session' - stores objects in session
//      'cookie'  - stores objects in cookie
//      'file'    - stores objects in files
$registry = RegistryFactory::start();

// Use set and get methods
// The first parameter is a key at witch created object is stored
// Key is used in any other method
$registry->set('key', new AnyClass);
$registry->get('key'); // Returns AnyClass instance

// Returns true if the key is defined
$registry->has('key');

// Reload object
$registry->reload('key');

// Removes from register
$registry->remove('key');

// Use register method
// First use sets and returns instance of Namespace\AnyClass
// Any further use only returns instance of Namespace\AnyClass
$registry->register('Namespace\AnyClass');
// It is possible to use has, reload and remove methods
$registry->has('Namespace\AnyClass');
$registry->reload('Namespace\AnyClass');
$registry->remove('Namespace\AnyClass');
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

Every ~72 days

Total

3

Last Release

3708d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

patternregistry

### Embed Badge

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

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

###  Alternatives

[league/pipeline

A plug and play pipeline implementation.

1.0k16.8M84](/packages/league-pipeline)[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2022.0M321](/packages/drupal-core-dev)[sylius/registry

Services registry.

6111.5M54](/packages/sylius-registry)[redeyeventures/geopattern

Generate beautiful SVG patterns.

11195.0k3](/packages/redeyeventures-geopattern)[getsolaris/laravel-make-service

A MVCS pattern create a service command for Laravel 5+

81169.8k](/packages/getsolaris-laravel-make-service)[functional-php/pattern-matching

Pattern matching for PHP with automatic destructuring.

8268.2k](/packages/functional-php-pattern-matching)

PHPackages © 2026

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