Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:36678 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46795 invoked from network); 29 Mar 2008 16:32:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Mar 2008 16:32:08 -0000 X-Host-Fingerprint: 24.247.219.180 24-247-219-180.dhcp.cdwr.mi.charter.com Received: from [24.247.219.180] ([24.247.219.180:4136] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 91/5E-53970-80F6EE74 for ; Sat, 29 Mar 2008 11:32:08 -0500 Message-ID: <91.5E.53970.80F6EE74@pb1.pair.com> To: internals@lists.php.net Date: Sat, 29 Mar 2008 12:32:04 -0500 User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 References: <47EC1271.9020405@php.net> <24.59.25926.4B2ECE74@pb1.pair.com> <1944269410.20080329124509@marcus-boerger.de> In-Reply-To: <1944269410.20080329124509@marcus-boerger.de> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Posted-By: 24.247.219.180 Subject: Re: [PHP-DEV] Re: phar API From: auroraeosrose@gmail.com (Elizabeth M Smith) Hi Marcus, warning I smashed those two replies together into this > You are right about Phar::canWrite() however there is also > Phar::isWriteable(). All we have to do is overload it correctly so that it > returns SplFileInfo::isWriteable() && Phar::canWrite(). Sounds good - one gripe fixed ;) > A method named AddDirdectory() sounds very confusing to me as to me it > would just add an empty directory. So the thing you proposed should be > named addFromDirectory() which would be in line with buildFromIterator(). That makes sense > And in the end you could just use that with a DirectoryIterator. > > $phar = new Phar('/path/to/phar'); > if($phar->isWriteable()) > { > $phar->buildFromDirectory(new DirectoyIterator('/path/to/some/stuff')); > } I kind of feel like I'm talking to a brick wall over this - you also mentioned > We liked the Phar::buildFromIterator() approach a lot :-) That's nice for you, I don't appreciate it being my only option. I'm not a fan for normal use cases (might be useful if I want to pass a filteriterator in there to manipulate what I'm shoving in) However that is just not a normal use case for me. I'd venture to say most people won't need it and will find it annoying to not have an easier option. > > Now I am wondering only why we didn't do buildFromIterator() as a static > factory method and have the current one as addFromIterator(). > > Maybe you guys also want the *FromDirectory() versions? The buildFrom* versions as static factories and addFrom* versions work on the object - sounds like a winner to me Thanks, Elizabeth