Re: [PHP-DEV] Restore output buffer in case of exceptions

2007-11-17 Thread Stanislav Malyshev
That is the idea: You can do it, I think - just another bufferign inside try() and clean it on exception, then output it after try block ends. Buffers are stackable in PHP. -- Stanislav Malyshev, Zend Software Architect [EMAIL PROTECTED] http://www.zend.com/ (408)253-8829 MSN: [EMAIL PR

Re: [PHP-DEV] Restore output buffer in case of exceptions

2007-11-17 Thread Mehmet Yavuz Selim Soyturk
On Nov 18, 2007 1:38 AM, Evert | Rooftop <[EMAIL PROTECTED]> wrote: > Generally I make sure that the parts of my code that start an output > buffer are also responsible for closing the output buffer.. so something > like this wouldn't be uncommon in my code.. > > > ob_start(); > try { > do_someth

Re: [PHP-DEV] Restore output buffer in case of exceptions

2007-11-17 Thread Edward Z. Yang
Evert | Rooftop wrote: > Generally I make sure that the parts of my code that start an output > buffer are also responsible for closing the output buffer.. so something > like this wouldn't be uncommon in my code.. Agreed. If you'd like to implement transaction support using PHP's exceptions, you'

Re: [PHP-DEV] Restore output buffer in case of exceptions

2007-11-17 Thread Evert | Rooftop
Mehmet Yavuz Selim Soyturk wrote: Hello, I'm sorry if that's the wrong list. I am neither a PHP nor a webscripting guy so I'm sorry if this does not make sense. I just thought that it could be useful. PHP 5 supports exception handling. When an exception occurs, PHP does stack unwinding so that

Re: [PHP-DEV] Restore output buffer in case of exceptions

2007-11-17 Thread Alexey Zakhlestin
On 11/18/07, Antony Dovgal <[EMAIL PROTECTED]> wrote: > On 18.11.2007 01:36, Mehmet Yavuz Selim Soyturk wrote: > > That is the idea: > > > > > > > exceptional_ob_start(); > > > > echo "Begin\n"; > > try { > >echo "Exception\n"; > >throw new Exception(); > > } catch (Exception $e) {} > > ec

Re: [PHP-DEV] Restore output buffer in case of exceptions

2007-11-17 Thread Antony Dovgal
On 18.11.2007 01:36, Mehmet Yavuz Selim Soyturk wrote: > That is the idea: > > > exceptional_ob_start(); > > echo "Begin\n"; > try { >echo "Exception\n"; >throw new Exception(); > } catch (Exception $e) {} > echo "End\n"; > > exceptional_ob_end_flush(); > > ?> > > And that would be t

[PHP-DEV] Restore output buffer in case of exceptions

2007-11-17 Thread Mehmet Yavuz Selim Soyturk
Hello, I'm sorry if that's the wrong list. I am neither a PHP nor a webscripting guy so I'm sorry if this does not make sense. I just thought that it could be useful. PHP 5 supports exception handling. When an exception occurs, PHP does stack unwinding so that it restores the state of the script