PHPackages                             ocramius/ocra-di-compiler - 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-di-compiler

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

ocramius/ocra-di-compiler
=========================

Zend Framework 2 Module that compiles Zend\\Di definitions to speed up ZF2 applications

251.6k4[2 issues](https://github.com/Ocramius/OcraDiCompiler/issues)PHP

Since Jul 15Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Ocramius/OcraDiCompiler)[ Packagist](https://packagist.org/packages/ocramius/ocra-di-compiler)[ RSS](/packages/ocramius-ocra-di-compiler/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

OcraDiCompiler
==============

[](#ocradicompiler)

A compiler module to make `Zend\Di\Di` based applications blazing fast!

Requirements
------------

[](#requirements)

- [ZendFramework 2](https://github.com/zendframework/zf2).
- Any application similar to the [ZendSkeletonApplication](https://github.com/zendframework/ZendSkeletonApplication).

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

[](#installation)

1. Add `"ocramius/ocra-di-compiler": "dev-master"` to your `composer.json`
2. Run `php composer.phar install`
3. Enable the module in your `config/application.config.php` by adding `OcraDiCompiler` to `modules`

or

```
php composer.phar ocramius/ocra-di-compiler
```

Functionality
-------------

[](#functionality)

OcraDiCompiler interacts with the bootstrap process of your application by trying to write a compiled `Zend\Di\Di` class into your `data` directory. The compiled Di container will be available after the `bootstrap` event of your application. Before that, any attempt to access Di will fetch the default one. You can customize where the compiled Di class will be written (and from where it will be read) by overriding the values in `config/module.config.php` in your own config file in the `config/autoload` directory.

Performance comparison
----------------------

[](#performance-comparison)

Given a default setup of an application with `doctrine/DoctrineORMModule` enabled and following class:

```
