tuupola / http-factory

Lightweight autodiscovering PSR-17 HTTP factories
MIT License
17 stars 6 forks source link

Detection based on stack back trace #1

Open drealecs opened 6 years ago

drealecs commented 6 years ago

In big projects where there are installed more than one framework, we could detect the needed library at runtime based on stack back trace. The result could be cached statically or per factory class instance that will be cached in framework's DI container. Detection could be configured or overridden by construct parameters.

tuupola commented 6 years ago

What problem would this fix or what would be the use case? I did not do any testing but I guess parsing stack trace would be slower than a call to class_exists().