2017 © Pedro Peláez
 

library compiler

A dependency injection compiler for Ray.Di

image

ray/compiler

A dependency injection compiler for Ray.Di

  • Saturday, July 14, 2018
  • by koriym
  • Repository
  • 2 Watchers
  • 0 Stars
  • 46,485 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 34 Versions
  • 10 % Grown

The README.md

Ray.Compiler

Dependency Injection Compiler

Scrutinizer Code Quality codecov Type Coverage Continuous Integration, (*1)

Ray.Compiler compiles Ray.Di bindings into PHP code, providing a performance boost that makes Dependency Injection couldn't be any faster., (*2)

Script Injector

ScriptInjector has the same interface as Ray.Di Injector; whereas Ray.Di Injector resolves dependencies based on memory bindings, ScriptInjector executes pre-compiled PHP code and is faster., (*3)

Ray.Di injector, (*4)

$injector = new Injector(new CarModule); // Ray.Di injector

Ray.Compiler injector, (*5)

$injector = new ScriptInjector($tmpDir, fn => new CarModule);

Precompile

You will want to compile all dependencies into code before deploying the production. The DiCompiler will compile all bindings into PHP code., (*6)

$compiler = new DiCompiler(new CarModule, $tmpDir);
$compiler->compile();

Object graph visualization

Object graph can be visualized with dumpGraph(). Graph HTML files will be output at graph folder under $tmpDir., (*7)

$compiler = new DiCompiler(new Module, $tmpDir);
$compiler->compile();
$compiler->dumpGraph();
open tmp/graph/Ray_Compiler_FakeCarInterface-.html

CompileInjector

The CompileInjector gives you the best performance in both development (x2) and production (x10) by switching two injector., (*8)

Get the injector by specifying the binding and cache, depending on the execution context of the application., (*9)

$injector = new CompileInjector($tmpDir, $injectorContext);

$injectorContext example:, (*10)

The __invoke() method prepares the modules needed in that context. The getCache() method specifies the cache of the injector itself., (*11)

Install DiCompileModule in the context for production. The injector is more optimized and dependency errors are reported at compile-time instead of run-time., (*12)

The Versions

14/07 2018

1.x-dev

1.9999999.9999999.9999999-dev

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

14/07 2018

1.3.5

1.3.5.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

14/07 2018

1.3.4

1.3.4.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

19/05 2018

1.3.3

1.3.3.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

15/05 2018

1.3.2

1.3.2.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

11/05 2018

1.3.1

1.3.1.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

07/05 2018

1.3.0

1.3.0.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

05/05 2018

dev-revert-45-no-meta

dev-revert-45-no-meta

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

05/05 2018

1.2.3

1.2.3.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

04/05 2018

1.2.2

1.2.2.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

01/05 2018

1.2.1

1.2.1.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

30/04 2018

1.2.0

1.2.0.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

06/03 2018

1.1.7

1.1.7.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

06/03 2018

dev-revert-36-singleton

dev-revert-36-singleton

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

27/05 2017

1.1.5

1.1.5.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

29/04 2017

1.1.4

1.1.4.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

28/03 2017

1.1.3

1.1.3.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

16/03 2017

1.1.2

1.1.2.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

16/03 2017

1.1.1

1.1.1.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

21/02 2017

1.1.0

1.1.0.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

16/10 2016

1.0.5

1.0.5.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

15/09 2016

1.0.4

1.0.4.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

29/09 2015

1.0.3

1.0.3.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

26/05 2015

1.0.2

1.0.2.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

22/05 2015

1.0.1

1.0.1.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

21/05 2015

1.0.0

1.0.0.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

14/05 2015

0.3.0

0.3.0.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Requires

 

The Development Requires

compiler code-gen ray.di

13/05 2015

0.2.0

0.2.0.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Development Requires

compiler code-gen ray.di

12/05 2015

0.1.5

0.1.5.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Development Requires

compiler code-gen ray.di

07/05 2015

0.1.4

0.1.4.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Development Requires

compiler code-gen ray.di

03/05 2015

0.1.3

0.1.3.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Development Requires

compiler code-gen ray.di

01/05 2015

0.1.2

0.1.2.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Development Requires

compiler code-gen ray.di

30/04 2015

0.1.1

0.1.1.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Development Requires

compiler code-gen ray.di

27/04 2015

0.1.0

0.1.0.0

A dependency injection compiler for Ray.Di

  Sources   Download

MIT

The Development Requires

compiler code-gen ray.di