Conditions | 4 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
48 | public function setIp(string $ip, $queryRdns = false): void |
||
49 | { |
||
50 | $this->ip = $ip; |
||
51 | |||
52 | if ($queryRdns) { |
||
53 | |||
54 | // Check if your IP is from localhost, perhaps your are in development environment? |
||
55 | if ( |
||
56 | (substr($this->ip, 0 , 8) === '192.168.') || |
||
57 | (substr($this->ip, 0 , 6) === '127.0.') |
||
58 | ) { |
||
59 | $this->setRdns('localhost'); |
||
60 | } else { |
||
61 | $this->setRdns(gethostbyaddr($this->ip)); |
||
62 | } |
||
98 |