RE: [PEAR-DEV] Package proposal: Net_Ip
| From: | Hans Lellelid | Date: | Fri, 30 May 2003 14:54:33 +0000 |
| Subject: | RE: [PEAR-DEV] Package proposal: Net_Ip | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-16837@lists.php.net to get a copy of this message | ||
Hi Stefan,
|
| You have a construct like if () { return foo; } else { return
| bar; } retun baz; there, in the method to get the ip.
|
I assume you're talking about get() method :
if (isset($ip)) {
$realip = $ip;
} else {
$realip = $this->_getReal();
}
if (ereg($this->pattern, $realip, $ip_array)) {
return $ip_array[0];
} elseif (isset($ip)) {
return false;
}
return $_SERVER['REMOTE_ADDR'];
... If this is what you meant, then you should have read this code a little
more closely before claiming that the last return is never executed.
Anyway -- I don't know whether this class duplicates existing IP stuff, but
I do think it's well written and I like the fact that it checks for proxy
servers (i.e. I can certainly use it).
Cheers,
Hans