Open weierophinney opened 4 years ago
Thanks for your ideas. This is an interesting feature. I guess we could achieve this by utilizing the dependency resolver and a recursive iterator.
Originally posted by @tux-rampage at https://github.com/zendframework/zend-di/issues/42#issuecomment-440407342
@tux-rampage I think we need get rid of zend-code scanner as these are going to be removed, see: https://github.com/zendframework/zend-code/issues/124
I've noticed it works wrong with configuration files, like:
<?php
return [
'factories' => [
'service' => ClassName::class,
],
];
it doesn't break zend-di, but we get wrong class names (as reported in closed issue linked above).
Originally posted by @michalbundyra at https://github.com/zendframework/zend-di/issues/42#issuecomment-452215661
@webimpress thanks for pointing this out. I removed the zend-code bits for 3.1 and I am not planning to re-introduce it. I thought about roave's better reflection instead since they offer support for composer.json autoloaders. If you have any other suggestions, they'll be welcome.
Originally posted by @tux-rampage at https://github.com/zendframework/zend-di/issues/42#issuecomment-452361945
In order to improve AoT compiler, on my project I've done some changes.
The problem is that with AoT, dependency factories are not created. To accomplish my goal I've made a simple DependencyScanner that try to fetch every dependency classes:
And changed my
di-generate-aot.sh
to use it, getting everypsr-4
namespace directory (does not support dir arrays yet), and using the previous class to fetch every dependency class.It's just an example, but I think we can include something like that in
zend-code
and/or here, and improve the documentation in order to provide a better AoT compiler compared to others compiled containers.P.S. It does not resolve aliases yet.
Originally posted by @thomasvargiu at https://github.com/zendframework/zend-di/issues/42