]> source.dussan.org Git - nextcloud-server.git/commitdiff
Deprecate unused `\OCP\Response::sendFile`
authorLukas Reschke <lukas@owncloud.com>
Wed, 15 Apr 2015 08:25:07 +0000 (10:25 +0200)
committerLukas Reschke <lukas@owncloud.com>
Mon, 20 Apr 2015 08:02:34 +0000 (10:02 +0200)
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.

lib/private/response.php
lib/public/response.php

index 018c44d2367f8aa221ce43700728313d1e042099..b75f11e364af95227973954abd7615f0eb7ab5bd 100644 (file)
@@ -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) {
index 1942c1ec37308880ec3ee670c42c598e9d36a256..ac27f3e0e6e36f67a9c268c6f35f42c19cc1d3e3 100644 (file)
@@ -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 );