PHPackages                             ocramius/ocra-service-manager - 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. ocramius/ocra-service-manager

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

ocramius/ocra-service-manager
=============================

ZF2 Service manager extensions to allow service proxies and dependency graph generation

2.1.2(11y ago)4840.0k18[7 issues](https://github.com/Ocramius/OcraServiceManager/issues)[1 PRs](https://github.com/Ocramius/OcraServiceManager/pulls)MITPHP

Since Dec 2Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Ocramius/OcraServiceManager)[ Packagist](https://packagist.org/packages/ocramius/ocra-service-manager)[ Docs](https://github.com/Ocramius/OcraServiceManager)[ RSS](/packages/ocramius-ocra-service-manager/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (9)Versions (16)Used By (0)

OcraServiceManager
==================

[](#ocraservicemanager)

OcraServiceManager is a Zend Framework 2 Module that decorates `Zend\ServiceManager\ServiceManager`to allow tracking dependencies between services.

It integrates with [ZendDeveloperTools](https://github.com/zendframework/ZendDeveloperTools)to provide aid in debugging what is happening between your dependencies, allowing you to produce dependency graphs such as the following one:

[![Example Dependency Graph generated by OcraServiceManager](https://camo.githubusercontent.com/c37bb9f3c58f2a92d046e36bfd96eff0066851bb29d3f3ffe8cb0aeb344dda18/687474703a2f2f79756d6c2e6d652f31633932663661352e706e67)](https://camo.githubusercontent.com/c37bb9f3c58f2a92d046e36bfd96eff0066851bb29d3f3ffe8cb0aeb344dda18/687474703a2f2f79756d6c2e6d652f31633932663661352e706e67)

It is **heavily tested** and supports proxying of any possible object type.

If you don't know what proxies are, you can read my article about [service proxies and why we need them](http://ocramius.github.com/blog/zf2-and-symfony-service-proxies-with-doctrine-proxies/).

Status
------

[](#status)

| Tests | Releases | Downloads | Dependencies | | ----- | -------- | ------- | ------------- | --------- | ------------ | |[![Build Status](https://camo.githubusercontent.com/c720c52322a8de946232f356e18e412cdddcc6b573497abf3d0bcb794ce5e773/68747470733a2f2f7472617669732d63692e6f72672f4f6372616d6975732f4f637261536572766963654d616e616765722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/Ocramius/OcraServiceManager) [![Scrutinizer Quality Score](https://camo.githubusercontent.com/8bf92f149788ea516ea588da01e9fa4c726f357fc997a172b2b72d8035a0938b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4f6372616d6975732f4f637261536572766963654d616e616765722f6261646765732f7175616c6974792d73636f72652e706e673f733d36306266323562613137373633306266666537626365326634626233656561393366316130663535)](https://scrutinizer-ci.com/g/Ocramius/OcraServiceManager/) [![Code Coverage](https://camo.githubusercontent.com/e672eb0402f676bb9333ebf23949b670307c09c02a6418f8e81718aa3a4a1af7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4f6372616d6975732f4f637261536572766963654d616e616765722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Ocramius/OcraServiceManager/?branch=master)|[![Latest Stable Version](https://camo.githubusercontent.com/8b2d7f525b7693dbe3f1205f87f7beb97ca7f9846cba32d499535e83db5ff043/68747470733a2f2f706f7365722e707567782e6f72672f6f6372616d6975732f6f6372612d736572766963652d6d616e616765722f762f737461626c652e706e67)](https://packagist.org/packages/ocramius/ocra-service-manager) [![Latest Unstable Version](https://camo.githubusercontent.com/aa9e32637ded4b45a9b366025a052972fe5f3280fc783e381216b0eabfc7ccff/68747470733a2f2f706f7365722e707567782e6f72672f6f6372616d6975732f6f6372612d736572766963652d6d616e616765722f762f756e737461626c652e706e67)](https://packagist.org/packages/ocramius/ocra-service-manager)|[![Total Downloads](https://camo.githubusercontent.com/73d7aced7e58624ff3642c38bcf051b9abfeb70997ff7c9f21664281f04df8b1/68747470733a2f2f706f7365722e707567782e6f72672f6f6372616d6975732f6f6372612d736572766963652d6d616e616765722f646f776e6c6f6164732e706e67)](https://packagist.org/packages/ocramius/ocra-service-manager)|[![Dependency Status](https://camo.githubusercontent.com/e8de85102ef773102c3210249a69243d4277772d6ae4da7e2b852797cff475c0/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7061636b6167652f7068702d2d6f6372616d6975732d2d6f6372612d736572766963652d6d616e616765722f62616467652e706e67)](https://www.versioneye.com/package/php--ocramius--ocra-service-manager)|

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

[](#installation)

The recommended way to install [`ocramius/ocra-service-manager`](https://packagist.org/packages/ocramius/ocra-service-manager) is through [composer](http://getcomposer.org/):

```
php composer.phar require ocramius/ocra-service-manager
```

You can then enable this module in your `config/application.config.php` by adding `OcraServiceManager` to the `modules` key:

```
// ...
    'modules' => array(
        // add OcraServiceManager and ZDT...
        'ZendDeveloperTools',
        'OcraServiceManager',
        // ... and then your stuff
        'MyOwnModule',
    ),
```

Please note that you need to enable service manager logging and the ZendDeveloperTools toolbar to actually see something working.

Configuration
-------------

[](#configuration)

Following config keys are provided by default, but you can change them as you want. You can drop a file `ocra-service-manager.local.php` into your `config/autoload` directory to enable or disable logging of your service manager instances:

```
return array(
    'ocra_service_manager' => array(
        // Turn this on to disable dependencies view in Zend Developer Tools
        'logged_service_manager' => true,
    ),
);
```

Please note that logging is enabled by default

Testing and Contributing
------------------------

[](#testing-and-contributing)

Please refer to the contents of [`.travis.yml`](.travis.yml) to see how to test your patches against OcraServiceManager.

Any pull requests will be accepted only if:

- code coverage on newly introduced code is &gt;= 90% (use `@coversNothing` on integration tests, please)
- coding standard complies with [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)
- generally tries to respect [object calisthenics](http://www.slideshare.net/guilhermeblanco/object-calisthenics-applied-to-php)

Known limitations:
------------------

[](#known-limitations)

- Installing the module itself won't allow tracking the first service-manager events in your application. If you need to have that working, you will need to override the implementation of `Zend\Mvc\Application::init()`
- If you have an authorization module enabled, be aware that `OcraServiceManager` registers a new controller `'OcraServiceManager\Controller\YumlController'` as well as a new route `'ocra_service_manager_yuml'`. You will need to enable access to both these in development mode in order to see the dependencies diagram.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 98.6% 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

Recently: every ~178 days

Total

14

Last Release

4023d ago

Major Versions

1.3.0 → 2.0.02013-11-25

### Community

Maintainers

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

---

Top Contributors

[![Ocramius](https://avatars.githubusercontent.com/u/154256?v=4)](https://github.com/Ocramius "Ocramius (141 commits)")[![EvanDotPro](https://avatars.githubusercontent.com/u/5607?v=4)](https://github.com/EvanDotPro "EvanDotPro (1 commits)")[![mikeSimonson](https://avatars.githubusercontent.com/u/907613?v=4)](https://github.com/mikeSimonson "mikeSimonson (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/ocramius-ocra-service-manager/health.svg)

```
[![Health](https://phpackages.com/badges/ocramius-ocra-service-manager/health.svg)](https://phpackages.com/packages/ocramius-ocra-service-manager)
```

###  Alternatives

[zf-commons/zfc-base

A set of genetic (abstract) classes which are commonly used across multiple modules.

1491.1M25](/packages/zf-commons-zfc-base)[bitweb/zf2-cron-module

BitWeb ZF2 module for cron.

1242.9k](/packages/bitweb-zf2-cron-module)

PHPackages © 2026

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