Re: [PHP-DEV] practical phar considerations

2008-04-09 Thread Gregory Beaver
Steph Fox wrote: > Hi Greg, > >> What I would like to do, however, is to rethink offsetSet(). I think >> that we should introduce a property of PharFileInfo called "content" >> that is read/write, and can be used to perform the equivalent of >> file_get_contents()/file_put_contents(). This will

Re: [PHP-DEV] practical phar considerations

2008-04-09 Thread Gregory Beaver
Pierre Joye wrote: > Hi, > > On Wed, Apr 9, 2008 at 6:48 AM, Gregory Beaver <[EMAIL PROTECTED]> wrote: > > >> For other examples, take a look at at >> ext/zip. There is no support for opendir() in the stream wrapper of >> ext/zip because it requires the kind of path grepping that pecl/phar

Re: [PHP-DEV] practical phar considerations

2008-04-09 Thread Steph Fox
Hi Greg, What I would like to do, however, is to rethink offsetSet(). I think that we should introduce a property of PharFileInfo called "content" that is read/write, and can be used to perform the equivalent of file_get_contents()/file_put_contents(). This will allow a consistency that is muc

Re: [PHP-DEV] practical phar considerations

2008-04-08 Thread Pierre Joye
Hi, On Wed, Apr 9, 2008 at 6:48 AM, Gregory Beaver <[EMAIL PROTECTED]> wrote: > For other examples, take a look at at > ext/zip. There is no support for opendir() in the stream wrapper of > ext/zip because it requires the kind of path grepping that pecl/phar > does. That's easy to add and

Re: [PHP-DEV] practical phar considerations

2008-04-08 Thread Gregory Beaver
Lars Strojny wrote: > Hi Greg, > > Am Samstag, den 29.03.2008, 17:58 -0500 schrieb Greg Beaver: > [...] >> If one uses file_put_contents('/path/to/this/file', 'hi') and >> '/path/to/this' does not exist, there is an error. The same is true of >> fopen, regardless of mode. mkdir() even fails un

Re: [PHP-DEV] practical phar considerations

2008-03-30 Thread Steph Fox
Hi Greg, Phar::compressArchive() /* Steph hated this when I originally proposed it, perhaps she's changed her mind? */ Nope :) I still think compress(Phar::BZ2|GZ), uncompress(), compressAllFiles(), uncompressAllFiles(). And I also think compressAllFiles() only means something to a handful

Re: [PHP-DEV] practical phar considerations

2008-03-29 Thread Lars Strojny
Hi Greg, Am Samstag, den 29.03.2008, 17:58 -0500 schrieb Greg Beaver: [...] > If one uses file_put_contents('/path/to/this/file', 'hi') and > '/path/to/this' does not exist, there is an error. The same is true of > fopen, regardless of mode. mkdir() even fails unless the recursive > parameter

Re: [PHP-DEV] practical phar considerations

2008-03-29 Thread Greg Beaver
Lars Strojny wrote: Hi Greg, Am Freitag, den 28.03.2008, 17:13 -0500 schrieb Greg Beaver: [...] In addition, this would mean that offsetGet() would have to create a directory. Why? $phar['full']['path']['to']['file'] = 'hi' calls offsetGet() with 'full', 'path', and 'to', and offsetSet() on

Re: [PHP-DEV] practical phar considerations

2008-03-29 Thread Lars Strojny
Hi Greg, Am Freitag, den 28.03.2008, 17:13 -0500 schrieb Greg Beaver: [...] > In addition, this would mean that offsetGet() would have to create a > directory. Why? > > $phar['full']['path']['to']['file'] = 'hi' calls offsetGet() with > 'full', 'path', and 'to', and offsetSet() only with 'file

Re: [PHP-DEV] practical phar considerations

2008-03-28 Thread Steph Fox
Hi Greg, what benefit is there in adding complexity of remembering the Phar::GZ constant over setCompressedGZ()? We have to think hard about changes like this. We did think hard about them. In fact I thought you'd implemented compress(Phar::GZ) to replace the long-named one now :) Need to g

[PHP-DEV] practical phar considerations

2008-03-28 Thread Greg Beaver
Hi, Before I say anything, I have just concluded 20 hours of travel and feel kinda funny, so please take that into consideration :). Regarding API changes, let's first be clear: 1) Any changes to file creation need to be understood in terms of what they means. For instance, let's look at: