[TYPO3-core] RFC: #1364, #5985, #7624: improved version of getUrl (cUrl, CURLOPT_FOLLOWLOCATION, error reporting)

Martin Kutschker martin.kutschker-n0spam at no5pam-blackbox.net
Sun Mar 2 19:17:25 CET 2008


Michael Stucki schrieb:
> Hi Martin,
> 
>> The idea is that in crucial points like the EM, the reason is reported
>> to the user, so she can check her setup, and figure out why eg TER
>> couldn't be reached.
> 
> Code review:
> 
> - As it seems $report will always contain only the last error that occured.
>   As far as I could see, this is ok as there is no case where more than two
>   errors occur.

It was meant that way.

> - Comments referring to PHP 4 should be changed (it is not supported, so it
>   doesn't need to be mentioned)

Removed

> Functional test:
> 
> - I only tried to update the TER updates using the cURL extension. Still
>   works well.
> 
> +1 from me, so this is now ready to be commited. Hurry up, please! :-)

Commited

>> PS: What about the PHP version now? If it's really 5.2 (as announced)
>> and not 5.1 (as in the current code) I could use error_get_last() to
>> report even file_get_contents() errors.
> 
> Officially 5.2 is the limit, but technically there are (afaik) still no
> requirements beyond PHP 5.1. I still care about those RH and SuSE systems
> who still seem to ship with 5.1 instead of something more recent (they call
> this "enterprise" software).

I have added this stuff:

if (function_exists('error_get_last')) {
   $phpError = error_get_last();
   $report['error'] = $phpError['type'];
   $report['message'] = $phpError['message'];
} else {
   $report['error'] = -1;
   $report['message'] = 'Couldn\'t get URL.';
}

Though there is little benefit.

Masi


More information about the TYPO3-team-core mailing list