Completed
Push — master ( 57eaa4...748821 )
by Morris
35s
created

Response   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 21
rs 10
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setContentDispositionHeader() 0 3 1
A setContentLengthHeader() 0 3 1
1
<?php
2
/**
3
 * @copyright Copyright (c) 2016, ownCloud, Inc.
4
 *
5
 * @author Andreas Fischer <[email protected]>
6
 * @author Bart Visscher <[email protected]>
7
 * @author Frank Karlitschek <[email protected]>
8
 * @author Lukas Reschke <[email protected]>
9
 * @author Morris Jobke <[email protected]>
10
 * @author Robin Appelman <[email protected]>
11
 * @author Stefan Weil <[email protected]>
12
 * @author Thomas Müller <[email protected]>
13
 * @author Vincent Petry <[email protected]>
14
 *
15
 * @license AGPL-3.0
16
 *
17
 * This code is free software: you can redistribute it and/or modify
18
 * it under the terms of the GNU Affero General Public License, version 3,
19
 * as published by the Free Software Foundation.
20
 *
21
 * This program is distributed in the hope that it will be useful,
22
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
 * GNU Affero General Public License for more details.
25
 *
26
 * You should have received a copy of the GNU Affero General Public License, version 3,
27
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
28
 *
29
 */
30
31
/**
32
 * Public interface of ownCloud for apps to use.
33
 * Response Class.
34
 *
35
 */
36
37
// use OCP namespace for all classes that are considered public.
38
// This means that they should be used by apps instead of the internal ownCloud classes
39
namespace OCP;
40
41
/**
42
 * This class provides convenient functions to send the correct http response headers
43
 * @since 4.0.0
44
 * @deprecated 8.1.0 - Use AppFramework controllers instead and modify the response object
45
 */
46
class Response {
47
48
	/**
49
	 * Sets the content disposition header (with possible workarounds)
50
	 * @param string $filename file name
51
	 * @param string $type disposition type, either 'attachment' or 'inline'
52
	 * @since 7.0.0
53
	 */
54
	static public function setContentDispositionHeader( $filename, $type = 'attachment' ) {
0 ignored issues
show
Coding Style introduced by
As per PSR2, the static declaration should come after the visibility declaration.
Loading history...
55
		\OC_Response::setContentDispositionHeader( $filename, $type );
56
	}
57
58
	/**
59
	 * Sets the content length header (with possible workarounds)
60
	 * @param string|int|float $length Length to be sent
61
	 * @since 8.1.0
62
	 */
63
	static public function setContentLengthHeader($length) {
0 ignored issues
show
Coding Style introduced by
As per PSR2, the static declaration should come after the visibility declaration.
Loading history...
64
		\OC_Response::setContentLengthHeader($length);
65
	}
66
}
67