summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-04-15 10:25:07 +0200
committerLukas Reschke <lukas@owncloud.com>2015-04-20 10:02:34 +0200
commitf672e120fc7423aacca2f2ae285eb202974646a6 (patch)
treeca06207c26e13d8253d3576c05cc2e7191ea25ed
parent9cb260d310de5bed546531eff5fbf0b7518f0f2f (diff)
downloadnextcloud-server-f672e120fc7423aacca2f2ae285eb202974646a6.tar.gz
nextcloud-server-f672e120fc7423aacca2f2ae285eb202974646a6.zip
Deprecate unused `\OCP\Response::sendFile`
This function is unused in our own code and can be better achieved using the AppFramework. Also very easy to do grave mistaked using this function.
-rw-r--r--lib/private/response.php7
-rw-r--r--lib/public/response.php2
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/private/response.php b/lib/private/response.php
index 018c44d2367..b75f11e364a 100644
--- a/lib/private/response.php
+++ b/lib/private/response.php
@@ -212,9 +212,10 @@ class OC_Response {
}
/**
- * Send file as response, checking and setting caching headers
- * @param string $filepath of file to send
- */
+ * Send file as response, checking and setting caching headers
+ * @param string $filepath of file to send
+ * @deprecated Use \OCP\AppFramework\Http\StreamResponse or another AppFramework controller instead
+ */
static public function sendFile($filepath) {
$fp = fopen($filepath, 'rb');
if ($fp) {
diff --git a/lib/public/response.php b/lib/public/response.php
index 1942c1ec373..ac27f3e0e6e 100644
--- a/lib/public/response.php
+++ b/lib/public/response.php
@@ -37,6 +37,7 @@ namespace OCP;
/**
* This class provides convenient functions to send the correct http response headers
* @since 4.0.0
+ * @deprecated Use AppFramework controllers instead and modify the response object
*/
class Response {
/**
@@ -103,6 +104,7 @@ class Response {
* Send file as response, checking and setting caching headers
* @param string $filepath of file to send
* @since 4.0.0
+ * @deprecated Use \OCP\AppFramework\Http\StreamResponse or another AppFramework controller instead
*/
static public function sendFile( $filepath ) {
\OC_Response::sendFile( $filepath );