/**
  * Returns the accepted encodings. If a specific encoding is defined,
  * the quality of that encoding will be returned. If the encoding is not
  * accepted, FALSE will be returned.
  *
  *     $encodings = Request::accept_encoding();
  *
  * [!!] Deprecated in favor of using [HTTP_Header::accepts_encoding_at_quality].
  *
  * @deprecated  since version 3.3.0
  * @param   string  $type Encoding type
  * @return  mixed   An array of all types or a specific type as a string
  * @uses    Request::_parse_accept
  */
 public static function accept_encoding($type = NULL)
 {
     static $accepts;
     if ($accepts === NULL) {
         // Parse the HTTP_ACCEPT_LANGUAGE header
         $accepts = Request::_parse_accept($_SERVER['HTTP_ACCEPT_ENCODING']);
     }
     if (isset($type)) {
         // Return the quality setting for this type
         return isset($accepts[$type]) ? $accepts[$type] : FALSE;
     }
     return $accepts;
 }
Example #2
0
 /**
  * Returns the accepted languages.
  *
  * @return  mixed   An array of all types or a specific type as a string
  * @uses    Request::_parse_accept
  */
 public static function accepted_languages()
 {
     return Request::_parse_accept($_SERVER['HTTP_ACCEPT_LANGUAGE']);
 }