Re: phar API
| From: | Elizabeth M Smith | Date: | Fri, 28 Mar 2008 18:50:28 +0000 |
| Subject: | Re: phar API | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-36659@lists.php.net to get a copy of this message | ||
>> The only things I see missing are an addFile and addDirectory shortcut
>> methods for when I don't want to mess with all the metadata or creating
>> iterators.
>
> addDirectory() is called createDirectory() in my RFC, just ignore the
> return value. What would you like addFile() to do? Adding an empty file?
>
> cu, Lars
Not add an empty directory - just add a directory and its contents much
like the Phar::create would do - an assumption that you want everything
in that directory inside with no iterators or magic required.
addFile(filename) would just add a file - no thinking required, although
if there was an addDirectory you wouldn't really need it.
I'm just of the opinion that the less I have to write for common actions
the better.
$phar = new Phar('/path/to/phar');
if($phar->isWriteable())
{
$phar->addDirectory('/path/to/some/stuff');
}
done ;)
Thanks,
Elizabeth