[TYPO3-core] RFC #10454: t3lib_div::makeInstanceClassName() allows to bypass checks for t3lib_Singleton
Jeff Segars
jsegars at alumni.rice.edu
Thu Feb 19 16:03:47 CET 2009
Ingo Renner wrote:
> Jeff Segars wrote:
>
> Hi Jeff,
>
>>> well to me this particular exception is pretty clear: language
>>> actually doesn't have a constructor - at least not an explicit one...
>>>
>>> If the message solely resulted from that, than I think it's ok. Could
>>> you test it with a different class again, a class that has a
>>> constructor, but doesn't expect arguments...
>>
>> I agree the message is clear; my only (very small) problem is that it
>> differs from happens with the when I create an object directly with
>> "new" and do not get a fatal error.
>>
>> After some more testing, the fatal error only occurs when there's not
>> a constructor at all. If there is a constructor with no arguments but
>> arguments are unexpectedly passed to the constructor, it works fine.
>
> So this is a rather rare case as it seems to me. As
> t3lib_div::makeInstance() is a quit central method and Reflection isn't
> the fastest I'd like to suggest to ignore these cases for now. We can
> (and of course should) address this issue when it really becomes an
> often occuring error. I'd also argue that this is a bug with reflection
> if the behavior is different from just using new.
>
> I'll attach your patch to the BT issue, so that it doesn't get lost in
> case we need it.
>
>
> all the best
> Ingo
>
Fair enough :) I had the same concerns about speed so like you said, we
can always add the additional checks if it proves to be a problem.
Thanks,
Jeff
More information about the TYPO3-team-core
mailing list