Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:36899 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70151 invoked from network); 9 Apr 2008 09:29:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Apr 2008 09:29:23 -0000 Authentication-Results: pb1.pair.com header.from=steph@zend.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=steph@zend.com; spf=permerror; sender-id=softfail Received-SPF: error (pb1.pair.com: domain zend.com from 64.97.136.147 cause and error) X-PHP-List-Original-Sender: steph@zend.com X-Host-Fingerprint: 64.97.136.147 smtpout0147.sc1.he.tucows.com Solaris 8 (1) Received: from [64.97.136.147] ([64.97.136.147:28736] helo=n082.sc1.he.tucows.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 33/41-04949-17C8CF74 for ; Wed, 09 Apr 2008 05:29:23 -0400 Received: from sc1-out04.emaildefenseservice.com (64.97.139.2) by n082.sc1.he.tucows.com (7.2.069.1) id 4769FAD4010CD9F5; Wed, 9 Apr 2008 09:29:15 +0000 X-SpamScore: 2 X-Spamcatcher-Summary: 2,0,0,8a155559d0e7a7a6,dee07722c5b14e2b,steph@zend.com,-,RULES_HIT:355:379:539:540:541:542:543:567:599:601:966:968:973:980:982:988:989:1155:1156:1260:1277:1311:1313:1314:1345:1437:1487:1515:1516:1518:1534:1542:1587:1593:1594:1711:1730:1747:1766:1792:2073:2075:2078:2196:2198:2199:2200:2377:2393:2559:2562:2689:2693:2828:2892:3027:3355:3622:3743:3865:3866:3867:3868:3869:3870:3871:3872:3873:3874:4250:4385:5007:6119:6261:7875,0,RBL:none,CacheIP:none,Bayesian: 0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:none,DNSBL:none,TSO:0 X-Spamcatcher-Explanation: Received: from foxbox (host86-130-56-54.range86-130.btcentralplus.com [86.130.56.54]) (Authenticated sender: steph.fox) by sc1-out04.emaildefenseservice.com (Postfix) with ESMTP; Wed, 9 Apr 2008 09:29:13 +0000 (UTC) Message-ID: <009c01c89a24$4d88f2e0$4001a8c0@foxbox> Reply-To: "Steph Fox" To: "Gregory Beaver" , "Lars Strojny" Cc: "php-dev" , "Marcus Boerger" References: <47ED6D97.3030109@chiaraquartet.net> <1206788577.3621.15.camel@localhost> <47EEC989.5020603@chiaraquartet.net> <1206839984.3621.71.camel@localhost> <47FC4A83.6080205@chiaraquartet.net> Date: Wed, 9 Apr 2008 10:30:05 +0100 Organization: Zend Technologies MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Subject: Re: [PHP-DEV] practical phar considerations From: steph@zend.com ("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 much more intuitive. offsetSet() could then simply be removed, > or perhaps be refactored as a way to pass in a PharFileInfo and clone > the information. Could you offer up some pseudo-code showing how this will be used? I can't visualize it at all from that description. > One problem with this suggestion is that phar renames the archive by > default when compressing. I would rather we combine compression and > format conversion into a single convert() method that accepts constants. > > $phar = new Phar('blah.phar'); > $phar = $phar->convert(Phar::GZ); // compress with gzip > $phar = $phar->convert(Phar::TAR | PHAR::GZ); // convert to .phar.tar.gz > $phar = $phar->convert(Phar::NONE | PHAR::DATA); // convert to > non-executable .tar, returns PharData object > $phar = $phar->convert(Phar::EXE); // convert back to .phar.tar Didn't we just go full circle here? There was a proposed convert() method that did absolutely everything (on e-paper) and it was far less intuitive than when conversion was separated from compression. That's why you ended up implementing them separately, as I recall. > This would also solve a subtle but important problem with the current > conversion API where intermediary files are lying around. Can't we simply delete those intermediary files on success? That would be the normal procedure when renaming, no? >>> Do you want to take a crack at a patch for any of these API features >>> once they are worked out (buildFromDirectory should be an easy one, if >>> you would like to start there)? >> >> Yes, I'm willing to help with it to a degree, as I said in a previous >> mail. > > How soon can we expect a patch for this? Steph also expressed interest, > and we are on a rather tight time schedule to get this to beta, which > will mean a feature freeze (no new crap, just bug fixes). I'll implement buildFromDirectory() this weekend. It would've been last weekend, but I got caught up in trying to bring the last few non-core PECL modules into line over versioning structure, which hasn't been entirely plain sailing. (Still 5 + IBM to go.) - Steph