PHPackages                             drinky78/silex-service-register-provider - 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. drinky78/silex-service-register-provider

ActiveLibrary

drinky78/silex-service-register-provider
========================================

Silex provider for registering other providers

1.1.1(11y ago)020MITPHP

Since Sep 25Pushed 11y ago1 watchersCompare

[ Source](https://github.com/drinky78/silex-service-register-provider)[ Packagist](https://packagist.org/packages/drinky78/silex-service-register-provider)[ RSS](/packages/drinky78-silex-service-register-provider/feed)WikiDiscussions master Synced today

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

ServiceRegisterProvider
=======================

[](#serviceregisterprovider)

---

[![Build Status](https://camo.githubusercontent.com/f5df9d496b6f170fc665d9f12536caeace4b0b6b8f61064aaf55ff1874668a0e/68747470733a2f2f6170692e7472617669732d63692e6f72672f6d6172636f6a616e7373656e2f73696c65782d736572766963652d72656769737465722d70726f76696465722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/marcojanssen/silex-service-register-provider)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/c99564914d2a356a30554e74befa8b7cca79155a9dad9b2ada559d810206b84f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d6172636f6a616e7373656e2f73696c65782d736572766963652d72656769737465722d70726f76696465722f6261646765732f7175616c6974792d73636f72652e706e673f733d30323164653463373862323465396434666236383130346466653933643062376239356461306538)](https://scrutinizer-ci.com/g/marcojanssen/silex-service-register-provider/)[![Code Coverage](https://camo.githubusercontent.com/d59feed96f180cb0a9b5eb256c1d066e42a725ee7fc69ba07b6266ceedf1dfcc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d6172636f6a616e7373656e2f73696c65782d736572766963652d72656769737465722d70726f76696465722f6261646765732f636f7665726167652e706e673f733d61643536616163623035333232376164626139336436363562643562336361316265613232366231)](https://scrutinizer-ci.com/g/marcojanssen/silex-service-register-provider/)

**ServiceRegisterProvider** is a provider for registering other providers.

Features
--------

[](#features)

- Register providers through configuration
- Register multiple providers with the provider
- Register a single provider with the provider

Installing
----------

[](#installing)

- Install [Composer](http://getcomposer.org)
- Add `marcojanssen/silex-service-register-provider` to your `composer.json`:

```
{
    "require": {
        "marcojanssen/silex-service-register-provider": "1.1.*"
    }
}
```

- Install/update your dependencies

Usage
-----

[](#usage)

### Registering a single provider

[](#registering-a-single-provider)

`index.php`

```
use Silex\Application;
use MJanssen\Provider\ServiceRegisterProvider;

$app = new Application();

$provider = array(
    'class' => 'MJanssen\Provider\ServiceProviderFoo',
    'values' => array(
        'foo' => 'baz'
    )
);

$serviceRegisterProvider = new ServiceRegisterProvider();
$serviceRegisterProvider->registerServiceProvider($app, $provider);
```

### Registering multiple providers

[](#registering-multiple-providers)

`index.php`

```
use Silex\Application;
use MJanssen\Provider\ServiceRegisterProvider;

$app = new Application();
$serviceRegisterProvider = new ServiceRegisterProvider();

$providers = array(
    array(
        'class' => 'MJanssen\Provider\ServiceProviderFoo'
    ),
    array(
        'class' => 'MJanssen\Provider\ServiceProviderBaz'
    )
);

$serviceRegisterProvider->registerServiceProviders($app, $providers);
```

### Registering providers with configuration

[](#registering-providers-with-configuration)

For this example the [ConfigServiceProvider](https://github.com/igorw/ConfigServiceProvider) is used to read the yml file. The ServiceRegisterProvider picks the stored configuration through the node `config.providers` in `$app['config.providers']` by default. If you want to set a different key, add it as parameter when instantiating the ServiceRegisterProvider

`services.yml`

```
custom.providers.key:
  validator:
    class: Silex\Provider\ValidatorServiceProvider

  controller.service:
    class: Silex\Provider\ServiceControllerServiceProvider
```

`index.php`

```
use Silex\Application;
use Igorw\Silex\ConfigServiceProvider;
use MJanssen\Provider\ServiceRegisterProvider;

//Set all service providers
$app->register(
    new ConfigServiceProvider(__DIR__."/../app/config/services.yml")
);

//Register all providers
$app->register(
    new ServiceRegisterProvider('custom.providers.key')
);
```

**Note**: It's recommended to use php files instead of yml/xml/etc.

###  Health Score

28

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 90.2% 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 ~191 days

Total

3

Last Release

4177d ago

### Community

Maintainers

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

---

Top Contributors

[![marcojanssen](https://avatars.githubusercontent.com/u/2293642?v=4)](https://github.com/marcojanssen "marcojanssen (37 commits)")[![drinky78](https://avatars.githubusercontent.com/u/8080643?v=4)](https://github.com/drinky78 "drinky78 (4 commits)")

---

Tags

providersilex

### Embed Badge

![Health badge](/badges/drinky78-silex-service-register-provider/health.svg)

```
[![Health](https://phpackages.com/badges/drinky78-silex-service-register-provider/health.svg)](https://phpackages.com/packages/drinky78-silex-service-register-provider)
```

###  Alternatives

[jdesrosiers/silex-cors-provider

A silex service provider that adds CORS services to silex

83888.8k9](/packages/jdesrosiers-silex-cors-provider)[ddesrosiers/silex-annotation-provider

A silex service provider that allows the use of annotations in ServiceControllers.

25244.5k3](/packages/ddesrosiers-silex-annotation-provider)

PHPackages © 2026

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