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 | * Update function for service. |
||
87 | * |
||
88 | * @return string |
||
89 | * |
||
90 | * @throws \Exception |
||
91 | */ |
||
92 | public function update() |
||
98 | |||
99 | /** |
||
100 | * Get the http client config. |
||
101 | * |
||
102 | * @return array |
||
103 | */ |
||
104 | 18 | private function getHttpClientConfig() |
|
124 | |||
125 | /** |
||
126 | * Check if secure url. |
||
127 | * |
||
128 | * @return bool |
||
129 | */ |
||
130 | private function isSecure() |
||
134 | } |
||
135 |