Re: [Proposal] Stream_Var

From: Date: Sat, 16 Aug 2003 08:15:37 +0000
Subject: Re: [Proposal] Stream_Var
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-19874@lists.php.net to get a copy of this message
Hi, Sorry for being somewhat late here, but could you also take a look at my premature package "LOB_Container"? I'm preparing this package to provide a generic container of data blocks of any sorts, which can be used in a way like javax.xml.transform.StreamSource of JAXP [1]. [Class hierarchy] LOB_Container | +- LOB_VariableContainer ... also provides variable stream | +- LOB_SHMContainer | +- LOB_FileContainer Forthcoming "VCS_CVS_Client", "VCS_CVS_Manipulator", and "Diff_Processor" have dependencies on this, so I hope this will be included as part of PEAR :) The ongoing effort can be fetched from: http://www.voltex.jp/downloads/phpcvsclient-20030816.tar.gz Moriyoshi [1] http://java.sun.com/j2se/1.4.1/docs/api/javax/xml/transform/stream/StreamSource.html "Stephan Schmidt" <schst@php-tools.net> wrote: > Hi PEAR-Devs, > > I'd like to propose a new package called Stream_Var. This package allows > stream based access to variables using the stream wrappers that have > been introduced in PHP4.3.2 > > That means you can do things like: > > $fp = fopen('var://GLOBALS/anyGlobalVar', 'r'); > > and then use fread, fwrite, fseek, etc. on this filepointer to read from > and modify the variable. It supports GLOBALS, GET, POST, etc. > If 'anyGlobalVar' is an array, it behaves like a directory, that means > you could do the following: > > $fp = fopen('var://GLOBALS/anyGlobalVar/anyKey', 'r'); > > of course with an unlimited depth :-) > > As arrays are directories, also the following is possible: > > $dir = opendir('var://GET'); > while($entry = readdir($dir)) { > echo "$entry<br />"; > } > > I still need to implement some minor things like different file modes > (r,r+,w,w+,a,...) and options so it's possible to trigger errors, that > give more detail, but the basic functionality is included. > @Greg: Yes, I know that I still have to include some inline > documentation, on which problem it does solve :-) I'll do that before > the first version is released. > > You can take a look at the sourcecode at: > http://www.php-tools.de/PEAR/Stream_Var/Var.phps > > Download it, with examples from: > http://www.php-tools.de/PEAR/Stream_Var/Stream_var.zip > > You can also take a look at the sourcecode of the examples at: > http://www.php-tools.de/PEAR/Stream_Var/examples/example.phps > http://www.php-tools.de/PEAR/Stream_Var/examples/example2.phps > > The will not work on this server, as PHP4.3.2 is not installed :-( (I > already informed the hoster), but you can download the zip and test it > on your local machine. > > So please send your feedback and comments, so I can include this in PEAR > as soon as possible :-) > > Best regards, > > Stephan > > > -- > PEAR Development Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.pear.dev (#19874) next »