-
-
Notifications
You must be signed in to change notification settings - Fork 158
PoC PHP file resource metadata factory #983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 1.13
Are you sure you want to change the base?
Conversation
Co-authored-by: Dmitri Perunov <diimpp@gmail.com>
8ae6c72
to
da5094c
Compare
@@ -39,6 +39,9 @@ public function getConfigTreeBuilder(): TreeBuilder | |||
->arrayNode('mapping') | |||
->addDefaultsIfNotSet() | |||
->children() | |||
->arrayNode('imports') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it misses sth to filter on php file only.
|
||
$resourceAlias = $resource->getAlias(); | ||
|
||
if (null !== $resourceAlias) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Uh oh!
There was an error while loading. Please reload this page.