1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the Ivory Http Adapter package. |
5
|
|
|
* |
6
|
|
|
* (c) Eric GELOEN <[email protected]> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please read the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Ivory\HttpAdapter\Event\Redirect; |
13
|
|
|
|
14
|
|
|
use Ivory\HttpAdapter\HttpAdapterException; |
15
|
|
|
use Ivory\HttpAdapter\HttpAdapterInterface; |
16
|
|
|
use Ivory\HttpAdapter\Message\InternalRequestInterface; |
17
|
|
|
use Ivory\HttpAdapter\Message\ResponseInterface; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* @author GeLo <[email protected]> |
21
|
|
|
*/ |
22
|
|
|
interface RedirectInterface |
23
|
|
|
{ |
24
|
|
|
const PARENT_REQUEST = 'parent_request'; |
25
|
|
|
const REDIRECT_COUNT = 'redirect_count'; |
26
|
|
|
const EFFECTIVE_URI = 'effective_uri'; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @return int |
30
|
|
|
*/ |
31
|
|
|
public function getMax(); |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @param int $max |
35
|
|
|
*/ |
36
|
|
|
public function setMax($max); |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @return bool |
40
|
|
|
*/ |
41
|
|
|
public function isStrict(); |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @param bool $strict |
45
|
|
|
*/ |
46
|
|
|
public function setStrict($strict); |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @return bool |
50
|
|
|
*/ |
51
|
|
|
public function getThrowException(); |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @param bool $throwException |
55
|
|
|
*/ |
56
|
|
|
public function setThrowException($throwException); |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @param ResponseInterface $response |
60
|
|
|
* @param InternalRequestInterface $internalRequest |
61
|
|
|
* @param HttpAdapterInterface $httpAdapter |
62
|
|
|
* |
63
|
|
|
* @throws HttpAdapterException |
64
|
|
|
* |
65
|
|
|
* @return InternalRequestInterface|false |
66
|
|
|
*/ |
67
|
|
|
public function createRedirectRequest( |
68
|
|
|
ResponseInterface $response, |
69
|
|
|
InternalRequestInterface $internalRequest, |
70
|
|
|
HttpAdapterInterface $httpAdapter |
71
|
|
|
); |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* @param ResponseInterface $response |
75
|
|
|
* @param InternalRequestInterface $internalRequest |
76
|
|
|
* |
77
|
|
|
* @return ResponseInterface |
78
|
|
|
*/ |
79
|
|
|
public function prepareResponse(ResponseInterface $response, InternalRequestInterface $internalRequest); |
80
|
|
|
} |
81
|
|
|
|