summaryrefslogtreecommitdiffstats
path: root/lib/public/appframework/http/response.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/appframework/http/response.php')
-rw-r--r--lib/public/appframework/http/response.php27
1 files changed, 23 insertions, 4 deletions
diff --git a/lib/public/appframework/http/response.php b/lib/public/appframework/http/response.php
index b79777c5f1d..8fd5fdd8f53 100644
--- a/lib/public/appframework/http/response.php
+++ b/lib/public/appframework/http/response.php
@@ -37,6 +37,7 @@ use OCP\AppFramework\Http;
* Base class for responses. Also used to just send headers.
*
* It handles headers, HTTP status code, last modified and ETag.
+ * @since 6.0.0
*/
class Response {
@@ -85,6 +86,7 @@ class Response {
* @param int $cacheSeconds the amount of seconds that should be cached
* if 0 then caching will be disabled
* @return $this
+ * @since 6.0.0 - return value was added in 7.0.0
*/
public function cacheFor($cacheSeconds) {
@@ -106,6 +108,7 @@ class Response {
* to null cookie will be considered as session
* cookie.
* @return $this
+ * @since 8.0.0
*/
public function addCookie($name, $value, \DateTime $expireDate = null) {
$this->cookies[$name] = array('value' => $value, 'expireDate' => $expireDate);
@@ -117,6 +120,7 @@ class Response {
* Set the specified cookies
* @param array $cookies array('foo' => array('value' => 'bar', 'expire' => null))
* @return $this
+ * @since 8.0.0
*/
public function setCookies(array $cookies) {
$this->cookies = $cookies;
@@ -128,6 +132,7 @@ class Response {
* Invalidates the specified cookie
* @param string $name
* @return $this
+ * @since 8.0.0
*/
public function invalidateCookie($name) {
$this->addCookie($name, 'expired', new \DateTime('1971-01-01 00:00'));
@@ -138,6 +143,7 @@ class Response {
* Invalidates the specified cookies
* @param array $cookieNames array('foo', 'bar')
* @return $this
+ * @since 8.0.0
*/
public function invalidateCookies(array $cookieNames) {
foreach($cookieNames as $cookieName) {
@@ -149,6 +155,7 @@ class Response {
/**
* Returns the cookies
* @return array
+ * @since 8.0.0
*/
public function getCookies() {
return $this->cookies;
@@ -160,6 +167,7 @@ class Response {
* @param string $name The name of the HTTP header
* @param string $value The value, null will delete it
* @return $this
+ * @since 6.0.0 - return value was added in 7.0.0
*/
public function addHeader($name, $value) {
$name = trim($name); // always remove leading and trailing whitespace
@@ -180,6 +188,7 @@ class Response {
* Set the headers
* @param array $headers value header pairs
* @return $this
+ * @since 8.0.0
*/
public function setHeaders(array $headers) {
$this->headers = $headers;
@@ -191,6 +200,7 @@ class Response {
/**
* Returns the set headers
* @return array the headers
+ * @since 6.0.0
*/
public function getHeaders() {
$mergeWith = [];
@@ -217,6 +227,7 @@ class Response {
/**
* By default renders no output
* @return null
+ * @since 6.0.0
*/
public function render() {
return null;
@@ -224,10 +235,11 @@ class Response {
/**
- * Set response status
- * @param int $status a HTTP status code, see also the STATUS constants
- * @return Response Reference to this object
- */
+ * Set response status
+ * @param int $status a HTTP status code, see also the STATUS constants
+ * @return Response Reference to this object
+ * @since 6.0.0 - return value was added in 7.0.0
+ */
public function setStatus($status) {
$this->status = $status;
@@ -238,6 +250,7 @@ class Response {
* Set a Content-Security-Policy
* @param ContentSecurityPolicy $csp Policy to set for the response object
* @return $this
+ * @since 8.1.0
*/
public function setContentSecurityPolicy(ContentSecurityPolicy $csp) {
$this->contentSecurityPolicy = $csp;
@@ -248,6 +261,7 @@ class Response {
* Get the currently used Content-Security-Policy
* @return ContentSecurityPolicy|null Used Content-Security-Policy or null if
* none specified.
+ * @since 8.1.0
*/
public function getContentSecurityPolicy() {
return $this->contentSecurityPolicy;
@@ -256,6 +270,7 @@ class Response {
/**
* Get response status
+ * @since 6.0.0
*/
public function getStatus() {
return $this->status;
@@ -265,6 +280,7 @@ class Response {
/**
* Get the ETag
* @return string the etag
+ * @since 6.0.0
*/
public function getETag() {
return $this->ETag;
@@ -274,6 +290,7 @@ class Response {
/**
* Get "last modified" date
* @return \DateTime RFC2822 formatted last modified date
+ * @since 6.0.0
*/
public function getLastModified() {
return $this->lastModified;
@@ -284,6 +301,7 @@ class Response {
* Set the ETag
* @param string $ETag
* @return Response Reference to this object
+ * @since 6.0.0 - return value was added in 7.0.0
*/
public function setETag($ETag) {
$this->ETag = $ETag;
@@ -296,6 +314,7 @@ class Response {
* Set "last modified" date
* @param \DateTime $lastModified
* @return Response Reference to this object
+ * @since 6.0.0 - return value was added in 7.0.0
*/
public function setLastModified($lastModified) {
$this->lastModified = $lastModified;