Re: Handles for multiple output buffers?

From: Date: Tue, 03 Aug 2004 05:10:13 +0000
Subject: Re: Handles for multiple output buffers?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-192521@lists.php.net to get a copy of this message
On Tue, 2004-08-03 at 00:44, Justin Patrin wrote: > On Tue, 03 Aug 2004 00:11:09 -0400, jtl_phpdotnet@spamex.com > <jtl_phpdotnet@spamex.com> wrote: > > Again, the internals list sent me to this forum for help. > > > > In trying to create a series of parsers in PHP, using only PHP core and no non-standard > > add-ons, I find myself emulating multiple character streams in a class that wraps the output buffer. > > Every time I open a new stream, I first save the current contents of the output buffer and then > > reset the stream. When the stream is closed, I then restore the output buffer to what it was > > before. > > > > I'd like more conventional 3GL behavior, where I am permitted multiple buffered > > streams via handles or stream objects. I see no way to do this with PHP as it stands. I also > > don't see anyway to emulate this without worsening the problem by creating a profusion of > > strings. > > > > I'm mostly able to work around the performance inefficiences of this wrapper-class > > approach by making the application smart about when to use a new stream. But I'd rather have > > native support. > > > > When can I expect to see this kind of conventional stream behavior in PHP? Are there any > > workaround I can use in the meantime? > > > > Why are you looking for such low level functionality in what is > essentially a scripting language? If you're this worried about speed, > you should probably be writing this in C. Or make an extension to PHP. > I know that you say "no non-standard extensions", but if you can't > have an extension, you're not likely to have any major speed > increases. Portability I would wager. And portability with as much efficiency as possible. I guess the current streams implementation requires him to perform a lot of low level emulation to get past perceived deficiencies in the stream handling architecture. Not every Joe has the luxury of installing extensions and so often a PHP script can provide the widest possible audience. Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'

« previous php.general (#192521) next »