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 / AcceptRanges.php
blob732a161ee049a9f34f077396e209c1822f233994
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 /**
13 * Accept Ranges Header
15 * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.5
17 class AcceptRanges implements HeaderInterface
20 protected $rangeUnit = null;
22 public static function fromString($headerLine)
24 $header = new static();
26 list($name, $value) = GenericHeader::splitHeaderLine($headerLine);
28 // check to ensure proper header type for this factory
29 if (strtolower($name) !== 'accept-ranges') {
30 throw new Exception\InvalidArgumentException('Invalid header line for Accept-Ranges string');
33 $header->rangeUnit = trim($value);
35 return $header;
38 public function getFieldName()
40 return 'Accept-Ranges';
43 public function getFieldValue()
45 return $this->getRangeUnit();
48 public function setRangeUnit($rangeUnit)
50 $this->rangeUnit = $rangeUnit;
51 return $this;
54 public function getRangeUnit()
56 return $this->rangeUnit;
59 public function toString()
61 return 'Accept-Ranges: ' . $this->getFieldValue();