Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

fRequest and Pecl Intl extension

posted by aris 8 years ago

Hello. Just a question: is fRequest using Pecl Intl extension, if available, to retrieve HTTP Accept Values? If not, are there relevant differences we should be aware of?

Regards, A.

No, it does not use the Intl extension. I just implemented the algorithm outlined in RFC2616 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html), with the exception that I don't process or include any accept params other than q.

In addition to the plain fRequest::getAcceptTypes() and fRequest::getAcceptLanguages() methods, there are also methods that pick the best based on a set of supported options. This allows you to deliver the "best" option that you have available. These methods are fRequest::getBestAcceptType() and fRequest::getBestAcceptLanguage().

posted by wbond 8 years ago