Negotiates locale and charset based on HTTP headers
This class parses the Accept-Language and Accept-Charset headers in order to determine what are the user settings and use it when auto detecting localization settings.
When PHP2Go loads, and LANGUAGE.AUTO_DETECT is set to true, or CHARSET is set to 'auto', this class is used to determine the new values for these settings, based on the client browser preferences.
Located in /core/LocaleNegotiator.class.php (line 45)
Get the singleton of the LocaleNegotiator class
Class constructor
Loads supported languages and charsets from the HTTP_ACCEPT_LANGUAGE and HTTP_ACCEPT_CHARSET headers.
Get supported charset encodings
Each item of the returned array contains a charset code, along with the quality factor (if lower than 1.0).
Get supported language codes
Each item of the returned array contains a language code, along with the quality factor (if lower than 1.0).
Negotiate the charset encoding
Matches a set of charset codes supported by the application against the ones parsed from the HTTP headers
Negotiate the language code
This method expects a set of language codes supported by the application and a default language code to be used when negotiation fails.
The set of application language codes is compared with the languages parsed from the request.
Search for a value inside an array, using binary safe and case insensitive comparison
Internal method that parses Accept-* headers
Documentation generated on Sun, 07 Oct 2007 19:27:19 -0300 by phpDocumentor 1.3.2