Re: [PECL-DEV] New chmlib PHP binding

[email protected] (Jesús Espino)
Newsgroups php.pecl.dev
Message-ID <[email protected]>
On Sun, Aug 15, 2010 at 3:44 PM, Gustavo Lopes <[email protected]> wrote:
> On Sat, 14 Aug 2010 14:55:52 +0100, Jesús Espino <[email protected]> wrote:
>
>> Thanks.
>>
>> I think i follow all your suggestions, I have pushed the changes to
>> the repository, any other suggestion??
>
> I've noticed you open the file directly, without obeying
>
> 1) open_basedir/safe mode restrictions
> 2) the virtual current directory
>
> If the library you're wrapping supports receiving FILE* pointer, you can
> open the file with PHP's stream functions and cast the stream to FILE*.
> If it only accepts paths, you must do the checks and expand the path
> yourself. See e.g. here:
>
> http://lxr.php.net/opengrok/xref/PECL/rar/rararch.c#523
>

The library only have a filename input parameter, then i have a
question, is apropiated to make in the binding the function that
accept FILE objects or String objects, and then put it in a temporary
file, or is better to not give this options to the user?? Anyway i
will try to send a patch to the upstream developer to accept FILE
objects.

Greetings.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.