| Conditions | 7 |
| Paths | 7 |
| Total Lines | 19 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | public function getClientIp() |
||
| 10 | { |
||
| 11 | if (getenv('HTTP_CLIENT_IP')) { |
||
| 12 | $ipAddress = getenv('HTTP_CLIENT_IP'); |
||
| 13 | } elseif (getenv('HTTP_X_FORWARDED_FOR')) { |
||
| 14 | $ipAddress = getenv('HTTP_X_FORWARDED_FOR'); |
||
| 15 | } elseif (getenv('HTTP_X_FORWARDED')) { |
||
| 16 | $ipAddress = getenv('HTTP_X_FORWARDED'); |
||
| 17 | } elseif (getenv('HTTP_FORWARDED_FOR')) { |
||
| 18 | $ipAddress = getenv('HTTP_FORWARDED_FOR'); |
||
| 19 | } elseif (getenv('HTTP_FORWARDED')) { |
||
| 20 | $ipAddress = getenv('HTTP_FORWARDED'); |
||
| 21 | } elseif (getenv('REMOTE_ADDR')) { |
||
| 22 | $ipAddress = getenv('REMOTE_ADDR'); |
||
| 23 | } else { |
||
| 24 | $ipAddress = config('settings.nullIpAddress'); |
||
| 25 | } |
||
| 26 | |||
| 27 | return $ipAddress; |
||
| 28 | } |
||
| 30 |