[TYPO3-core] RFC #- buffer output for debug function

Ingmar Schlecht ingmar at typo3.org
Sun Nov 25 13:18:58 CET 2007


Martin Kutschker schrieb:
> Ingmar Schlecht schrieb:
>> Martin Kutschker schrieb:
>>> Ingmar Schlecht schrieb:
>>>> Hi Steffen,
>>>>
>>>> this RFC has no corresponding bug report. Please add it, so that we can
>>>> properly track the changes.
>>>>
>>>> +1 based on reading the code and the ob_start() documentation.
>>> Did you notice the stackability of those buffers? Starting a new output
>>> buffer by calling debug() might result in unexpected behaviour for other
>>> code using buffers.
>>
>> I don't think so, because if someone does an
>>   ob_start()
>>   and some time later an
>>   ob_get_contents()
>> the behavior of the stack is not different if we would've done an
>> additional ob_start() at the very beginning which is flushed
>> automatically at the very end.
>>
>> The only problem occurs if someone uses debug() *inside* a stacked OB,
>> but that problem could be fixed by checking if we're inside any OBing
>> when debug() is executed. Steffen, could you add that check to your
>> patch?
> 
> You mean?
> 
> if (ob_get_level==0) {
>  ob_start();
> }

Yep.

> I think this is ok (+1). Perhaps this can even be added to 4.1 as the
> PHP error is more a bug than a mising feature.

Fine with me.

cheers
Ingmar

-- 
Ingmar Schlecht
TYPO3 Association Active Member


More information about the TYPO3-team-core mailing list