This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of git://github.com/zendframework/zf2 into string
- Loading branch information
88 parents
843cf92
+
d21655a
+
1d20fd1
+
fe81bc5
+
96fadae
+
072c64d
+
d3c9780
+
9c15ae8
+
66a4342
+
85c9491
+
8ec8384
+
004366f
+
55a086d
+
ac7c7af
+
f02a226
+
00c4ac3
+
3f52720
+
5508474
+
49ed2f6
+
d562686
+
67b42b2
+
bdb1dae
+
9809630
+
7304e37
+
752a5af
+
8181c8f
+
53bdac2
+
c2f9414
+
f6341e9
+
57cde95
+
c750616
+
293054e
+
7432649
+
63f13f6
+
927c00d
+
44e0d4b
+
bc03833
+
1fd7c61
+
de0cb77
+
66e902f
+
24354dc
+
f0311bd
+
03ab3c8
+
6bce797
+
6ad2b62
+
1e41fbd
+
a0078e6
+
9db875b
+
2879406
+
9acc850
+
eddeb7d
+
6de3f68
+
cb8f354
+
5a77057
+
33c15ff
+
9f13ebf
+
a2ad2a5
+
c0ba21c
+
94e82a8
+
459f1f9
+
e0c8424
+
5ef6a39
+
58fd018
+
65e3b0b
+
9f886a2
+
845333c
+
96e9a1e
+
52fbeb6
+
7f76d90
+
fec4cec
+
24efdcc
+
219c9ad
+
3025666
+
17d48b4
+
00f4506
+
0800032
+
fc89677
+
e89d79b
+
f329014
+
a1bfde3
+
7dec05c
+
734f9f2
+
2756031
+
408f714
+
fd53447
+
f1f6e0d
+
e193ac7
+
dad06c3
commit be511e2
Showing
191 changed files
with
4,192 additions
and
1,995 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
<?php | ||
/** | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* @link http://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @package Zend_Http | ||
*/ | ||
|
||
namespace Zend\Http; | ||
|
||
use Zend\Stdlib\Message; | ||
|
||
/** | ||
* HTTP standard message (Request/Response) | ||
* | ||
* @category Zend | ||
* @package Zend_Http | ||
* @link http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4 | ||
*/ | ||
abstract class AbstractMessage extends Message | ||
{ | ||
/**#@+ | ||
* @const string Version constant numbers | ||
*/ | ||
const VERSION_10 = '1.0'; | ||
const VERSION_11 = '1.1'; | ||
/**#@-*/ | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $version = self::VERSION_11; | ||
|
||
/** | ||
* @var Headers|null | ||
*/ | ||
protected $headers = null; | ||
|
||
/** | ||
* Set the HTTP version for this object, one of 1.0 or 1.1 | ||
* (AbstractMessage::VERSION_10, AbstractMessage::VERSION_11) | ||
* | ||
* @param string $version (Must be 1.0 or 1.1) | ||
* @return AbstractMessage | ||
* @throws Exception\InvalidArgumentException | ||
*/ | ||
public function setVersion($version) | ||
{ | ||
if ($version != self::VERSION_10 && $version != self::VERSION_11) { | ||
throw new Exception\InvalidArgumentException( | ||
'Not valid or not supported HTTP version: ' . $version | ||
); | ||
} | ||
$this->version = $version; | ||
return $this; | ||
} | ||
|
||
/** | ||
* Return the HTTP version for this request | ||
* | ||
* @return string | ||
*/ | ||
public function getVersion() | ||
{ | ||
return $this->version; | ||
} | ||
|
||
/** | ||
* Provide an alternate Parameter Container implementation for headers in this object, | ||
* (this is NOT the primary API for value setting, for that see getHeaders()) | ||
* | ||
* @see getHeaders() | ||
* @param Headers $headers | ||
* @return AbstractMessage | ||
*/ | ||
public function setHeaders(Headers $headers) | ||
{ | ||
$this->headers = $headers; | ||
return $this; | ||
} | ||
|
||
/** | ||
* Return the header container responsible for headers | ||
* | ||
* @return Headers | ||
*/ | ||
public function getHeaders() | ||
{ | ||
if ($this->headers === null || is_string($this->headers)) { | ||
// this is only here for fromString lazy loading | ||
$this->headers = (is_string($this->headers)) ? Headers::fromString($this->headers) : new Headers(); | ||
} | ||
|
||
return $this->headers; | ||
} | ||
|
||
/** | ||
* Allow PHP casting of this object | ||
* | ||
* @return string | ||
*/ | ||
public function __toString() | ||
{ | ||
return $this->toString(); | ||
} | ||
} |
Oops, something went wrong.