[TYPO3-core] RFC: pageNotFound_handling HTTP status fix
Martin Kutschker
Martin.Kutschker at blackbox.net
Wed Apr 26 14:01:05 CEST 2006
Dmitry Dulepov <dima at spamcop.net> writes on
Wed, 26 Apr 2006 13:46:03 +0200 (METDST):
> Hi!
>
> Martin Kutschker wrote:
>
> > Do you think it would be better to return an array with an error
> > code and message. The code would signify what method has been
> > chosen (CURL, etc).
>
> It will break compatibility.
Right, silly me.
> > If you, the list members, don't like this, as I think you do, we
> > could add error logging (level notice or warning) into this
> > function.
>
> I do not see a reason for this. If cURL is enabled, it is used.
> Situation is pretty clear.
It's not clear if you put the error message into a log file, etc.
> getURL is used in a number of places in the core, I think logging it
> all will slow down the system.
Logging would only occur on error. Do we expect many failed getURL calls? Perhaps something like that?
$c = t3lib_div:getURL($url1);
if (!$c) t3lib_div:getURL($url2);
etc.
Hm, how about making a new function fetchURL that either returns an array on error or takes an array reference as argument to return the error. Or even something like this:
fetchURL($url,&$error,$includeHeader=0,$requestHeaders='') {
...
if (is_array($error)) {
if ($error['log']) {
// do logging
}
$error['msg'] = $error_msg;
$error['method'] = $method;
}
...
}
So $error is used to pass a logging request and to retrieve the error.
Masi
More information about the TYPO3-team-core
mailing list