cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

RE: CURLOPT_FTP_FILEMETHOD from php?

From: Gaetano Giunta <giunta.gaetano_at_sea-aeroportimilano.it>
Date: Wed, 22 Nov 2006 17:35:20 +0100

Sorry, but a qwik look in da code revealed that curl_setopt() internally calls the c function _php_curl_setopt.

This is a just big switch() statements, that acts only upon the curl constants that are enumerated in the source.
Passing a given INT value which has no corresponding php CURLOPT_XXX constant will do absolutely nothing (and possibly return TRUE...)
Doing otherwise would be very hard, since some curl options need a C int value, some a string, some a filepointer, etc..., and some have some side effects).

As Daniel said, the best option would be to patch the php source (it should not be too hard, if the option you want has no side effects).

Bye
Gaetano Giunta

> -----Original Message-----
> From: curl-and-php-bounces_at_cool.haxx.se
> [mailto:curl-and-php-bounces_at_cool.haxx.se]On Behalf Of Alan Pinstein
> Sent: Wednesday, November 22, 2006 5:22 PM
> To: curl with PHP
> Subject: Re: CURLOPT_FTP_FILEMETHOD from php?
>
>
> >> However, the php-curl integration doesn't define this option.
> >
> > Then patch it or possibly try a more recent version that has it!
>
> Well, patching is more of a last resort... I was hoping for
> some help
> on understanding why:
>
> curl_setopt($ch, 138 /* CURLOPT_FTP_FILEMETHOD */, 3 /
> CURLFTPMETHOD_SINGLECWD */);
>
> doesn't work...
>
> I would imagine curl_setopt passes through the parameters to
> curl_easy_setopt... but it doesn't work.
>
> If the *only* solution is patching, I'll probably do that or just
> switch to the direct ftp_* calls.
>
> Thanks,
> Alan
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2006-11-22