1 | <?php |
||
12 | class Download implements RobotsTxtInterface |
||
13 | { |
||
14 | /** |
||
15 | * Base uri |
||
16 | * @var string |
||
17 | */ |
||
18 | protected $baseUri; |
||
19 | |||
20 | /** |
||
21 | * GuzzleHttp response |
||
22 | * @var \Psr\Http\Message\ResponseInterface |
||
23 | */ |
||
24 | private $response; |
||
25 | |||
26 | /** |
||
27 | * Download constructor. |
||
28 | * |
||
29 | * @param string $baseUri |
||
30 | * @param array $guzzleConfig |
||
31 | */ |
||
32 | public function __construct($baseUri, $guzzleConfig = []) |
||
56 | |||
57 | /** |
||
58 | * Parser client |
||
59 | * |
||
60 | * @param int|null $byteLimit |
||
61 | * @return Client |
||
62 | */ |
||
63 | public function parserClient($byteLimit = self::BYTE_LIMIT) |
||
67 | |||
68 | /** |
||
69 | * Status code |
||
70 | * |
||
71 | * @return int |
||
72 | */ |
||
73 | public function getStatusCode() |
||
77 | |||
78 | /** |
||
79 | * URL content |
||
80 | * |
||
81 | * @return string |
||
82 | */ |
||
83 | public function getContents() |
||
87 | |||
88 | /** |
||
89 | * Encoding |
||
90 | * |
||
91 | * @return string |
||
92 | */ |
||
93 | public function getEncoding() |
||
104 | |||
105 | /** |
||
106 | * Manually detect encoding |
||
107 | * |
||
108 | * @return string |
||
109 | */ |
||
110 | protected function detectEncoding() |
||
117 | } |
||
118 |