[TYPO3-team-core-v5] Upcoming commit: Big change in the component manager
Malte Jansen
mail at maltejansen.de
Wed Jul 23 17:35:02 CEST 2008
Robert Lemke schrieb:
>> The @scope tag was just an example for a tag not known by phpDocComment.
>> With FLOW3CGL we have to check certain tags for a file-, class-, var-
>> or method-comment.
>> - Is the @package declared?
>> - Is the @author-tag used?
>> - @scope makes only sense in a class-comment (not abstract-class or
>> interface)...
>> - etc
>>
>> So there the basic tags from the phpDoc and the new ones introduced by
>> FLOW3
>>
>> For checking theses things I have created a model with the tags, so
>> you can check if a tag is valid or e.g. @param fits to the
>> method-argument.
>> Some tags are not allowed/does not make sense in a certain comment
>> like the @scope in a file or method comment etc.
>>
>> So I have implement a pretty easy extendable model, which should
>> automatiacly check, if component is available for this tag.
>> (FactoryPattern)
>> http://forge.typo3.org/repositories/browse/package-flow3cgl/trunk/Classes/DocComment/Elements
>>
>> http://forge.typo3.org/repositories/browse/package-flow3cgl/trunk/Classes/DocComment/Tags
>>
>
> Did you checkout the Reflection Service?
>
> http://forge.typo3.org/repositories/entry/package-flow3/trunk/Classes/Reflection/F3_FLOW3_Reflection_Service.php
>
>
> I guess getClassTagsValues() is what you're looking for, not?
I just check the reflection stuff.
Correct me if I'm wrong. If you want to analyze a class/file, you have
to include/require this by your script?
If it's this way, we cannot use it, because it's an security-gap for the
FLOW3CGL. If we check a package, we do not want to include it into our
running FLOW3-installation, because of possible bad code. We just read
it as text-file or tokenize it.
The DocCommentParser is pretty nice, but it does not help me either,
because we some more information like the line of tag etc.
By the way in Lines #58ff of
http://forge.typo3.org/repositories/entry/package-flow3/trunk/Classes/Reflection/F3_FLOW3_Reflection_DocCommentParser.php
While parsing what happens with a which is splitted in to several lines,
due some pretty long value. It's seems to me that these lines are ignored...
>> If you want to create your own Factory, you always have to inject the
>> ComponentManager and the ComponentFactory.
>>
>> Same issue for the F3_FLOW3_Validation_ValidatorResolver, it is also a
>> factory just using the getComponent and isComponentRegistered for
>> avoiding the exception from the factory. I pretty sure there are
>> already more locations, where you just create a "Subfactory", where
>> you could need it.
>
> yes, sure there are situations where we already need custom factories.
> But I don't get the connection to your tag parsing.
I have just used it as an example for the need of extending the
ComponentFactory.
Cheers,
Malte
More information about the TYPO3-team-core-v5
mailing list