1 | <?php namespace Arcanedev\GeoIP\Drivers; |
||
13 | class IpApiDriver extends AbstractDriver |
||
14 | { |
||
15 | /* ------------------------------------------------------------------------------------------------ |
||
16 | | Properties |
||
17 | | ------------------------------------------------------------------------------------------------ |
||
18 | */ |
||
19 | /** |
||
20 | * Http client instance. |
||
21 | * |
||
22 | * @var \GuzzleHttp\Client |
||
23 | */ |
||
24 | protected $client; |
||
25 | |||
26 | /** |
||
27 | * A collection of continents. |
||
28 | * |
||
29 | * @var \Arcanedev\GeoIP\Entities\Continents |
||
30 | */ |
||
31 | protected $continents; |
||
32 | |||
33 | /* ------------------------------------------------------------------------------------------------ |
||
34 | | Main Functions |
||
35 | | ------------------------------------------------------------------------------------------------ |
||
36 | */ |
||
37 | /** |
||
38 | * Init the driver. |
||
39 | */ |
||
40 | 18 | protected function init() |
|
48 | |||
49 | /** |
||
50 | * Locate the ip address. |
||
51 | * |
||
52 | * @param string $ipAddress |
||
53 | * |
||
54 | * @return \Arcanedev\GeoIP\Location |
||
55 | * |
||
56 | * @throws \Exception |
||
57 | */ |
||
58 | 6 | public function locate($ipAddress) |
|
84 | |||
85 | /** |
||
86 | * Get the http client config. |
||
87 | * |
||
88 | * @return array |
||
89 | */ |
||
90 | 18 | private function getHttpClientConfig() |
|
110 | |||
111 | /** |
||
112 | * Check if secure url. |
||
113 | * |
||
114 | * @return bool |
||
115 | */ |
||
116 | private function isSecure() |
||
120 | } |
||
121 |