$phar->isWritable() works now too
| From: | Gregory Beaver | Date: | Thu, 10 Apr 2008 03:35:46 +0000 |
| Subject: | $phar->isWritable() works now too | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-36914@lists.php.net to get a copy of this message | ||
Hi,
I re-read the messages, and realized I had misunderstood what was being
requested, although it did pay off in finding a subtle bug in
is_writeable() for files within a phar.
I just implemented Phar->isWritable(), which can be used to detect the
right combination of file permissions, archive type, and phar.readonly
for creating archives. Thus, this can be used:
<?php
$phar = new Phar('blah.phar');
if ($phar->isWritable()) {
// add files or other modifications
}
?>
This should satisfy Elizabeth's wishlist, so to satisfy Lars and
Benjamin, we need to clean up the conversion/compression API.
Greg