Questions tagged [auryn]

Auryn is used to bootstrap and wire together S.O.L.I.D., object-oriented PHP applications.

How It Works: Among other things, auryn recursively instantiates class dependencies based on the parameter type-hints specified in class constructor signatures. This requires the use of Reflection. You may have heard that "reflection is slow". Let's clear something up: anything can be "slow" if you're doing it wrong. Reflection is an order of magnitude faster than disk access and several orders of magnitude faster than retrieving information (for example) from a remote database. Additionally, each reflection offers the opportunity to cache the results if you're worried about speed. auryn caches any reflections it generates to minimize the potential performance impact.

Requirements : auryn requires PHP 5.3 or higher.

For more information take a look at the repository auryn

5 questions
2
votes
1 answer

Sharing the same instance of an object: auryn vs. PHP-DI

I am trying to build my first no-framework PHP application and I am following this tutorial. I am relatively new to some concepts described in the tutorial. Despite this, I decided to use, as Dependency Injector, PHP-DI instead of the suggested one…
Filippo Lauria
  • 1,965
  • 14
  • 20
2
votes
1 answer

DI fails with namespace

I'm following this tutorial to get a deeper understanding in dependency injection. Because our host is still on PHP5.3, I'm using Aura\Web -components for HTTP response/request. Dependency injection is done with Auryn\Injector So far I've managed to…
PaulH
  • 52
  • 7
0
votes
1 answer

Injecting the right config with Auryn

I have a use case where we're using Auryn to wire up our classes, and I need to inject a different configuration class depending on a parameter's value. Auryn's documentation gives an example of injecting a dependency: interface Engine {} class…
GordonM
  • 31,179
  • 15
  • 87
  • 129
0
votes
1 answer

How to use Auryn for DI in the "right" way?

I'm writing a little application from scratch, and I wanted to use some packages from packagist. For DI I choosed Auryn. Now, one of the first thing that I learnt about Auryn is that it tries to avoid to be a Dependency Container and it is…
Alpe89
  • 299
  • 2
  • 11
0
votes
0 answers

Auryn: Using make inside a prepare

I'm currently experiment with Auryn and am attempting to make a specific instance of a Monolog logger available everywhere via a dependency injection. The codebase I'm working with is using the PSR LoggerAwareInterface to indicate that a class can…
GordonM
  • 31,179
  • 15
  • 87
  • 129