aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty/Sabre/HTTP/Response.php
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/Sabre/HTTP/Response.php')
-rwxr-xr-x[-rw-r--r--]3rdparty/Sabre/HTTP/Response.php53
1 files changed, 29 insertions, 24 deletions
diff --git a/3rdparty/Sabre/HTTP/Response.php b/3rdparty/Sabre/HTTP/Response.php
index dce6feac553..ffe9bda2082 100644..100755
--- a/3rdparty/Sabre/HTTP/Response.php
+++ b/3rdparty/Sabre/HTTP/Response.php
@@ -1,20 +1,20 @@
<?php
/**
- * Sabre_HTTP_Response
- *
+ * Sabre_HTTP_Response
+ *
* @package Sabre
* @subpackage HTTP
- * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
- * @author Evert Pot (http://www.rooftopsolutions.nl/)
+ * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
+ * @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
class Sabre_HTTP_Response {
/**
- * Returns a full HTTP status message for an HTTP status code
- *
- * @param int $code
+ * Returns a full HTTP status message for an HTTP status code
+ *
+ * @param int $code
* @return string
*/
public function getStatusMessage($code) {
@@ -64,6 +64,9 @@ class Sabre_HTTP_Response {
423 => 'Locked', // RFC 4918
424 => 'Failed Dependency', // RFC 4918
426 => 'Upgrade required',
+ 428 => 'Precondition required', // draft-nottingham-http-new-status
+ 429 => 'Too Many Requests', // draft-nottingham-http-new-status
+ 431 => 'Request Header Fields Too Large', // draft-nottingham-http-new-status
500 => 'Internal Server Error',
501 => 'Not Implemented',
502 => 'Bad Gateway',
@@ -71,25 +74,26 @@ class Sabre_HTTP_Response {
504 => 'Gateway Timeout',
505 => 'HTTP Version not supported',
506 => 'Variant Also Negotiates',
- 507 => 'Unsufficient Storage', // RFC 4918
+ 507 => 'Insufficient Storage', // RFC 4918
508 => 'Loop Detected', // RFC 5842
509 => 'Bandwidth Limit Exceeded', // non-standard
510 => 'Not extended',
- );
+ 511 => 'Network Authentication Required', // draft-nottingham-http-new-status
+ );
return 'HTTP/1.1 ' . $code . ' ' . $msg[$code];
}
/**
- * Sends an HTTP status header to the client
- *
- * @param int $code HTTP status code
- * @return void
+ * Sends an HTTP status header to the client
+ *
+ * @param int $code HTTP status code
+ * @return bool
*/
public function sendStatus($code) {
- if (!headers_sent())
+ if (!headers_sent())
return header($this->getStatusMessage($code));
else return false;
@@ -97,15 +101,16 @@ class Sabre_HTTP_Response {
/**
* Sets an HTTP header for the response
- *
- * @param string $name
- * @param string $value
- * @return void
+ *
+ * @param string $name
+ * @param string $value
+ * @param bool $replace
+ * @return bool
*/
public function setHeader($name, $value, $replace = true) {
$value = str_replace(array("\r","\n"),array('\r','\n'),$value);
- if (!headers_sent())
+ if (!headers_sent())
return header($name . ': ' . $value, $replace);
else return false;
@@ -115,8 +120,8 @@ class Sabre_HTTP_Response {
* Sets a bunch of HTTP Headers
*
* headersnames are specified as keys, value in the array value
- *
- * @param array $headers
+ *
+ * @param array $headers
* @return void
*/
public function setHeaders(array $headers) {
@@ -130,14 +135,14 @@ class Sabre_HTTP_Response {
* Sends the entire response body
*
* This method can accept either an open filestream, or a string.
- *
- * @param mixed $body
+ *
+ * @param mixed $body
* @return void
*/
public function sendBody($body) {
if (is_resource($body)) {
-
+
fpassthru($body);
} else {