PHPackages                             gobline/registrar - 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. gobline/registrar

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

gobline/registrar
=================

Registrar component

v1.0.2(10y ago)11171BSD-3-ClausePHPPHP &gt;=5.6.0

Since Aug 27Pushed 9y ago1 watchersCompare

[ Source](https://github.com/gobline/registrar)[ Packagist](https://packagist.org/packages/gobline/registrar)[ Docs](https://github.com/gobline)[ RSS](/packages/gobline-registrar/feed)WikiDiscussions master Synced today

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

Registrar component
===================

[](#registrar-component)

The Registrar component takes a Gobline container and allows you to add services to it defined in one or more configuration files. It loads the right configuration files based on the current environment (dev, prod, ...).

```
$container = new Gobline\Container();

$registrar = new Gobline\Registrar\Registrar($container, 'dev');
$registrar->register(getcwd().'/config/services.php');
```

In the above code, we set the environment to "dev", and the Registrar will attempt to add the services defined in the following files to the container:

- services.php (if exists)
- services.dev.php (if exists)

The services listed in the configuration file are defined in a PHP array, which its structure follows a convention. Below is an example of a configuration file:

```
return [
    Pdo::class => [
        'construct' => [
            'arguments' => ['sqlite:db.sqlite'],
        ],
    ],
    Swift_SmtpTransport::class => [
        'alias' => Swift_Transport::class,
        'construct' => [
            'arguments' => ['smtp.gmail.com', 465, 'ssl'],
        ],
        'configure' => [
            'data' => [
                'username' => 'mdecaffmeyer@gmail.com',
                'password' => '***',
            ],
        ],
    ],
    Gobline\Auth\Authenticator\Db\DbAuthenticator::class => [
        'alias' => Gobline\Auth\Authenticator\AuthenticatorInterface::class,
    ],
    Gobline\Auth\CurrentUser::class => [
        'alias' => Gobline\Auth\CurrentUserInterface::class,
        'configure' => [
            'configurator' => Gobline\Auth\Provider\Gobline\CurrentUserConfigurator::class,
            'data' => [
                'persistence' => 'session',
                'roleUnauthenticated' => 'unauthenticated',
            ],
        ],
    ],
    Doctrine\ORM\EntityManager::class => [
        'construct' => [
            'factory' => App\Provider\EntityManagerFactory::class,
        ],
    ],

];
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Total

4

Last Release

3858d ago

Major Versions

v0.9.0 → v1.0.02015-12-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/1564a230fe2f5125b0504cf6b6fe1e829face1a5d20ec663b3b8d22843312c7d?d=identicon)[mdecaffmeyer](/maintainers/mdecaffmeyer)

---

Tags

dependency-injectionregistrargobline

### Embed Badge

![Health badge](/badges/gobline-registrar/health.svg)

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

###  Alternatives

[php-di/invoker

Generic and extensible callable invoker

26762.3M66](/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.

437773.0k19](/packages/level-2-dice)[matthiasnoback/symfony-service-definition-validator

Library for validating service definitions created with the Symfony Dependency Injection Component

89360.3k7](/packages/matthiasnoback-symfony-service-definition-validator)[arokettu/phpstorm-metadata-export

Export PhpStorm Advanced Metadata from DI containers

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

The dependency injection container for WordPress

314.2k13](/packages/x-wp-di)[acelot/resolver

Dependency auto resolver for PHP 7 and 8

122.7k](/packages/acelot-resolver)

PHPackages © 2026

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