PoC PHP file resource metadata factory#983
Conversation
Co-authored-by: Dmitri Perunov <diimpp@gmail.com>
8ae6c72 to
da5094c
Compare
| ->arrayNode('mapping') | ||
| ->addDefaultsIfNotSet() | ||
| ->children() | ||
| ->arrayNode('imports') |
There was a problem hiding this comment.
This new path ensures we do not load any files that are on Autoloader which cannot be include serveral times.
So here, we'll import config files (PHP ones).
There was a problem hiding this comment.
Interesting discussions there
api-platform/core#6943
| private function getPHPFileClosure(string $filePath): \Closure | ||
| { | ||
| return \Closure::bind(function () use ($filePath): mixed { | ||
| return require $filePath; |
There was a problem hiding this comment.
that's why we cannot import the mapping paths here.
require Classes, Trait, Interface and things like that is not possible. It needs to be basic php file.
| $finder->in($path); | ||
| } | ||
|
|
||
| return $finder->files(); |
There was a problem hiding this comment.
it misses sth to filter on php file only.
|
|
||
| $resourceAlias = $resource->getAlias(); | ||
|
|
||
| if (null !== $resourceAlias) { |
There was a problem hiding this comment.
I want to remove that RegistryInterface at some point. I need to work on this.
We should use the MetadataNameCollection instead.
bdeb733 to
09d90cc
Compare
c3a5b3a to
863f09b
Compare
863f09b to
d90f4ee
Compare
6a8beb2 to
3992255
Compare
2d69656 to
a0dd5eb
Compare
1842d63 to
4530671
Compare
19d2b8f to
3d74f73
Compare
3d74f73 to
e979ac1
Compare
|
Feature added in #1028 |
Uh oh!
There was an error while loading. Please reload this page.