Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Http / Header / AcceptCharset.php
blobb4f76b96bfef1d97fa86c77e7b0e8cb7318c510c
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Http\Header;
12 use Zend\Http\Header\Accept\FieldValuePart;
14 /**
15 * Accept Charset Header
17 * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.2
19 class AcceptCharset extends AbstractAccept
21 protected $regexAddType = '#^([a-zA-Z0-9+-]+|\*)$#';
23 /**
24 * Get field name
26 * @return string
28 public function getFieldName()
30 return 'Accept-Charset';
33 /**
34 * Cast to string
36 * @return string
38 public function toString()
40 return 'Accept-Charset: ' . $this->getFieldValue();
43 /**
44 * Add a charset, with the given priority
46 * @param string $type
47 * @param int|float $priority
48 * @return Accept
50 public function addCharset($type, $priority = 1)
52 return $this->addType($type, $priority);
55 /**
56 * Does the header have the requested charset?
58 * @param string $type
59 * @return bool
61 public function hasCharset($type)
63 return $this->hasType($type);
66 /**
67 * Parse the keys contained in the header line
69 * @param string $fieldValuePart
70 * @return \Zend\Http\Header\Accept\FieldValuePart\CharsetFieldValuePart
71 * @see \Zend\Http\Header\AbstractAccept::parseFieldValuePart()
73 protected function parseFieldValuePart($fieldValuePart)
75 $internalValues = parent::parseFieldValuePart($fieldValuePart);
77 return new FieldValuePart\CharsetFieldValuePart($internalValues);