| 1 | <?php namespace Arcanedev\GeoIP\Support; |
||
| 9 | class IpDetector |
||
| 10 | { |
||
| 11 | /* ----------------------------------------------------------------- |
||
| 12 | | Properties |
||
| 13 | | ----------------------------------------------------------------- |
||
| 14 | */ |
||
| 15 | |||
| 16 | /** @var string */ |
||
| 17 | protected static $default = '127.0.0.0'; |
||
| 18 | |||
| 19 | /** @var array */ |
||
| 20 | protected static $remotes = [ |
||
| 21 | 'HTTP_X_FORWARDED_FOR', |
||
| 22 | 'HTTP_CLIENT_IP', |
||
| 23 | 'HTTP_X_FORWARDED', |
||
| 24 | 'HTTP_FORWARDED_FOR', |
||
| 25 | 'HTTP_FORWARDED', |
||
| 26 | 'REMOTE_ADDR', |
||
| 27 | 'HTTP_X_CLUSTER_CLIENT_IP', |
||
| 28 | ]; |
||
| 29 | |||
| 30 | /* ----------------------------------------------------------------- |
||
| 31 | | Main Methods |
||
| 32 | | ----------------------------------------------------------------- |
||
| 33 | */ |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Detect the IP address. |
||
| 37 | * |
||
| 38 | * @return string |
||
| 39 | */ |
||
| 40 | 18 | public static function detect() |
|
| 52 | } |
||
| 53 |