summaryrefslogtreecommitdiffstats
path: root/3rdparty/Sabre/HTTP/Response.php
diff options
context:
space:
mode:
authorFrank Karlitschek <karlitschek@kde.org>2012-02-15 20:40:37 +0100
committerFrank Karlitschek <karlitschek@kde.org>2012-02-15 20:40:37 +0100
commitdccdeca2581f705c69eb4266aa646173f588a9de (patch)
treef4cb27fc31b331e03f14cf1c2a1f4719ebb62cdc /3rdparty/Sabre/HTTP/Response.php
parentc2fb5fed029a77f4cdcd6a8b9a6308ef40091639 (diff)
downloadnextcloud-server-dccdeca2581f705c69eb4266aa646173f588a9de.tar.gz
nextcloud-server-dccdeca2581f705c69eb4266aa646173f588a9de.zip
remove the 3rdparty files. everything is now in https://gitorious.org/owncloud/3rdparty
Diffstat (limited to '3rdparty/Sabre/HTTP/Response.php')
-rw-r--r--3rdparty/Sabre/HTTP/Response.php152
1 files changed, 0 insertions, 152 deletions
diff --git a/3rdparty/Sabre/HTTP/Response.php b/3rdparty/Sabre/HTTP/Response.php
deleted file mode 100644
index dce6feac553..00000000000
--- a/3rdparty/Sabre/HTTP/Response.php
+++ /dev/null
@@ -1,152 +0,0 @@
-<?php
-
-/**
- * Sabre_HTTP_Response
- *
- * @package Sabre
- * @subpackage HTTP
- * @copyright Copyright (C) 2007-2011 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
- * @return string
- */
- public function getStatusMessage($code) {
-
- $msg = array(
- 100 => 'Continue',
- 101 => 'Switching Protocols',
- 102 => 'Processing',
- 200 => 'OK',
- 201 => 'Created',
- 202 => 'Accepted',
- 203 => 'Non-Authorative Information',
- 204 => 'No Content',
- 205 => 'Reset Content',
- 206 => 'Partial Content',
- 207 => 'Multi-Status', // RFC 4918
- 208 => 'Already Reported', // RFC 5842
- 226 => 'IM Used', // RFC 3229
- 300 => 'Multiple Choices',
- 301 => 'Moved Permanently',
- 302 => 'Found',
- 303 => 'See Other',
- 304 => 'Not Modified',
- 305 => 'Use Proxy',
- 306 => 'Reserved',
- 307 => 'Temporary Redirect',
- 400 => 'Bad request',
- 401 => 'Unauthorized',
- 402 => 'Payment Required',
- 403 => 'Forbidden',
- 404 => 'Not Found',
- 405 => 'Method Not Allowed',
- 406 => 'Not Acceptable',
- 407 => 'Proxy Authentication Required',
- 408 => 'Request Timeout',
- 409 => 'Conflict',
- 410 => 'Gone',
- 411 => 'Length Required',
- 412 => 'Precondition failed',
- 413 => 'Request Entity Too Large',
- 414 => 'Request-URI Too Long',
- 415 => 'Unsupported Media Type',
- 416 => 'Requested Range Not Satisfiable',
- 417 => 'Expectation Failed',
- 418 => 'I\'m a teapot', // RFC 2324
- 422 => 'Unprocessable Entity', // RFC 4918
- 423 => 'Locked', // RFC 4918
- 424 => 'Failed Dependency', // RFC 4918
- 426 => 'Upgrade required',
- 500 => 'Internal Server Error',
- 501 => 'Not Implemented',
- 502 => 'Bad Gateway',
- 503 => 'Service Unavailable',
- 504 => 'Gateway Timeout',
- 505 => 'HTTP Version not supported',
- 506 => 'Variant Also Negotiates',
- 507 => 'Unsufficient Storage', // RFC 4918
- 508 => 'Loop Detected', // RFC 5842
- 509 => 'Bandwidth Limit Exceeded', // non-standard
- 510 => 'Not extended',
- );
-
- return 'HTTP/1.1 ' . $code . ' ' . $msg[$code];
-
- }
-
- /**
- * Sends an HTTP status header to the client
- *
- * @param int $code HTTP status code
- * @return void
- */
- public function sendStatus($code) {
-
- if (!headers_sent())
- return header($this->getStatusMessage($code));
- else return false;
-
- }
-
- /**
- * Sets an HTTP header for the response
- *
- * @param string $name
- * @param string $value
- * @return void
- */
- public function setHeader($name, $value, $replace = true) {
-
- $value = str_replace(array("\r","\n"),array('\r','\n'),$value);
- if (!headers_sent())
- return header($name . ': ' . $value, $replace);
- else return false;
-
- }
-
- /**
- * Sets a bunch of HTTP Headers
- *
- * headersnames are specified as keys, value in the array value
- *
- * @param array $headers
- * @return void
- */
- public function setHeaders(array $headers) {
-
- foreach($headers as $key=>$value)
- $this->setHeader($key, $value);
-
- }
-
- /**
- * Sends the entire response body
- *
- * This method can accept either an open filestream, or a string.
- *
- * @param mixed $body
- * @return void
- */
- public function sendBody($body) {
-
- if (is_resource($body)) {
-
- fpassthru($body);
-
- } else {
-
- // We assume a string
- echo $body;
-
- }
-
- }
-
-}