PHPackages                             saga/dic-module - 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. saga/dic-module

ActiveDrupal-module[Utility &amp; Helpers](/categories/utility)

saga/dic-module
===============

This module provides the Dependency Injection Container integration in Drupal 7.

7.1.7(10y ago)713.9k5[2 issues](https://github.com/SagaConsultingGroup/DIC/issues)PHP

Since Nov 5Pushed 9y ago4 watchersCompare

[ Source](https://github.com/SagaConsultingGroup/DIC)[ Packagist](https://packagist.org/packages/saga/dic-module)[ RSS](/packages/saga-dic-module/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (9)Used By (0)

DIC - Dependency Injection Container
====================================

[](#dic---dependency-injection-container)

[![Build Status](https://camo.githubusercontent.com/2b2967fd428d2553b1ab1d8b40ef328d7a0321fc6a6e32c90f84b8eb4a8c795a/68747470733a2f2f7472617669732d63692e6f72672f53616761436f6e73756c74696e6747726f75702f4449432e737667)](https://travis-ci.org/SagaConsultingGroup/DIC) [![Latest Stable Version](https://camo.githubusercontent.com/974926472db7ea942c67e6842da4029b5b7f216e04cbc38ada6c8b7a29853f5a/68747470733a2f2f706f7365722e707567782e6f72672f736167612f6469632d6d6f64756c652f762f737461626c652e737667)](https://packagist.org/packages/saga/dic-module) [![Total Downloads](https://camo.githubusercontent.com/3e5f31e4cfc81b92404a7b8628eea435e8cddc839e0ea37f09aaade022725263/68747470733a2f2f706f7365722e707567782e6f72672f736167612f6469632d6d6f64756c652f646f776e6c6f6164732e737667)](https://packagist.org/packages/saga/dic-module) [![Latest Unstable Version](https://camo.githubusercontent.com/8a9803465cc25c279b815011881965f4e10e1cca34af43757d22a0e3ba4796dd/68747470733a2f2f706f7365722e707567782e6f72672f736167612f6469632d6d6f64756c652f762f756e737461626c652e737667)](https://packagist.org/packages/saga/dic-module)

Using this Drupal module, you can use the Symfony Dependency Injection Container in your Drupal 7 modules. This will help you writing custom Drupal modules in a more object-oriented, future-proof and maintainable way.

[Composer](https://getcomposer.org/ "Composer") is required in your project and this module expects a composer.json file in the root of your Drupal installation.

Installation and Configuration
------------------------------

[](#installation-and-configuration)

- Make sure Composer is installed.
- Add a composer.json file to the root of your Drupal 7 installation with the following content:

```
{
  "require": {
    "php": ">=5.3.0",
    "composer/installers": "~1.0",
    "saga/dic-module": "~7.1"
  },
  "extra": {
    "installer-paths": {
      "sites/all/modules/vendor/{$name}": ["type:drupal-module"]
    }
  }
}

```

- In terminal, go to the root of your Drupal 7 sites (where the composer.json file lives) and execute "composer install".
- The DIC module will now be available in "sites/all/modules/vendor/dic" and is ready to be installed using the regular module installation procedure.
- Make sure that the "/vendor" and "sites/\*/modules/vendor" folders are added to the .gitignore, you don't want these folders in your VCS.

Creating custom modules
-----------------------

[](#creating-custom-modules)

If you want to create custom modules that use the DIC module, make sure that the classes in your module are autoloaded correctly. You can use several methods to do this:

- Using the [Composer autoload functionality](https://getcomposer.org/doc/01-basic-usage.md#autoloading "Composer autoload functionality")
- Using the [xautoload](https://www.drupal.org/project/xautoload "xautoload") Drupal module
- Using the [registry\_autoload](https://www.drupal.org/project/registry_autoload "registry_autoload") Drupal module

Sponsors
--------

[](#sponsors)

This module is sponsored by [Saga Consulting Group](http://www.saga.be "Saga Consulting Group").

License
-------

[](#license)

This module is licensed under GENERAL PUBLIC LICENSE Version 2, June 1991. See the bundled LICENSE file for details.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 64.7% 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 ~42 days

Total

8

Last Release

3957d ago

### Community

Maintainers

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

---

Top Contributors

[![ozmodiar](https://avatars.githubusercontent.com/u/512738?v=4)](https://github.com/ozmodiar "ozmodiar (22 commits)")[![NoUseFreak](https://avatars.githubusercontent.com/u/879864?v=4)](https://github.com/NoUseFreak "NoUseFreak (11 commits)")[![cgoffin](https://avatars.githubusercontent.com/u/2912276?v=4)](https://github.com/cgoffin "cgoffin (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/saga-dic-module/health.svg)

```
[![Health](https://phpackages.com/badges/saga-dic-module/health.svg)](https://phpackages.com/packages/saga-dic-module)
```

###  Alternatives

[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k13](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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