Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:36909 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15908 invoked from network); 9 Apr 2008 19:30:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Apr 2008 19:30:26 -0000 Authentication-Results: pb1.pair.com smtp.mail=greg@chiaraquartet.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=greg@chiaraquartet.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain chiaraquartet.net from 38.99.98.18 cause and error) X-PHP-List-Original-Sender: greg@chiaraquartet.net X-Host-Fingerprint: 38.99.98.18 beast.bluga.net Linux 2.6 Received: from [38.99.98.18] ([38.99.98.18:47650] helo=mail.bluga.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7E/C8-64512-0591DF74 for ; Wed, 09 Apr 2008 15:30:25 -0400 Received: from mail.bluga.net (localhost.localdomain [127.0.0.1]) by mail.bluga.net (Postfix) with ESMTP id 8DF2391E0DF for ; Wed, 9 Apr 2008 12:30:23 -0700 (MST) Received: from [192.168.0.106] (CPE-76-84-4-101.neb.res.rr.com [76.84.4.101]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bluga.net (Postfix) with ESMTP id 50B1391E0DB for ; Wed, 9 Apr 2008 12:30:23 -0700 (MST) Message-ID: <47FD1952.2060802@chiaraquartet.net> Date: Wed, 09 Apr 2008 14:30:26 -0500 User-Agent: Thunderbird 2.0.0.12 (X11/20080227) MIME-Version: 1.0 To: internals Mailing List X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: phar API update From: greg@chiaraquartet.net (Gregory Beaver) Hi, I've just implemented these features: 1) new getContents() method allows directly retrieving file contents. Here is a full-circle example: getContents(); ?> 2) addFile/addEmptyDir/addFromString. API is identical to ext/zip addEmptyDir('hello'); var_dump($phar['hello']->isDir()); $phar->addFile('/path/to/file.txt'); var_dump($phar['/path/to/file.txt']->getContents()); $phar->addFile('/path/to/file.txt', 'file.txt'); var_dump($phar['file.txt']->getContents()); $phar->addFromString('localname.txt', 'hi'); var_dump($phar['localname.txt']); ?> Still left to do: 1) fix up conversion/compression and decide how best to do this 2) buildFromDirectory (Steph) Not going to do: 1) $phar['access']['directory']['this']['way'] Greg