[TYPO3-v4] getUrl issues - linkvalidator

Ernesto Baschny [cron IT] ernst at cron-it.de
Wed Mar 16 08:17:12 CET 2011


Jigal van Hemert schrieb am 15.03.2011 12:28:
> Hi,
> 
> On 15-3-2011 9:27, Ernesto Baschny [cron IT] wrote:
>> But maybe we should just use "curl" and make it a required PHP module
>> for TYPO3 4.6? In my opinion curl has (almost) "all we need" (and more)
>> instead of writing yet another solution in straight PHP. Curl handles
>> proxies, HTTPs, GET, POST, Authentication, Cookies, Redirects, content
>> decoding, ...  And its shipped with all major distributions.
> 
> I'm not sure if all 'major' hosting companies (there are some obscure
> companies used by big organisations and governmental bodies) provide curl.
> 
>> What we just need is then a t3lib wrapper for the more complex stuff
>> cURL offers which we currently cannot influence in t3lib_div::getUrl
>> (like disabling SSL verification, doing POST, ...).
> 
> Maybe the best implementation is to use a handler. After the cURL
> handler we can always add a plain PHP version or one that uses another
> library.
> 
>> The only drawback to that is that we cannot request only the headers
>> with a "GET" statement, which is what the link validation needs (we've
>> experienced the same trouble already). Doing a HEAD is not enough for
>> checking if an URL really works, unfortunately. Maybe it could be done
>> with curl somehow?
> 
> Without cURL it would be quite easy: do a GET and stop retrieving
> information after the headers arrived.

Yes, of course, but then you have to still implement the "other
features" (like SSL support, proxy support ...). :)

So to me it would be a matter of evaluating first what is most feasible.
Maybe using a third party library to do it. Perhaps take a look at
HTTP_Request2 [1]

Cheers,
Ernesto

[1] http://pear.php.net/package/HTTP_Request2/docs


More information about the TYPO3-project-v4 mailing list