Re: Package proposal: Net_Ip (merge w/ HTTP?)
| From: | Eric | Date: | Fri, 30 May 2003 20:39:15 +0000 |
| Subject: | Re: Package proposal: Net_Ip (merge w/ HTTP?) | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-16849@lists.php.net to get a copy of this message | ||
Please respond to all. I receive digests, so I won't get your message
unless I am copied (or the next day).
I don't think calling it Net_Ip is a good idea. I am the Net_IPv4
maintainer, and I don't really see a conflict between these two packages.
I can't figure out where this package would go.
It's fairly specific to a web application. To me, this almost seems like
it should probably reflect that it's more to do with HTTP header/env
parsing. I think a better candidate for this functionality would be the
HTTP class.
It looks fairly straight-forward, but if you're going to wrapper
gethostbyname and gethostbyaddr, you should probably test to see if the
the lookup failed:
return (($ip = gethostbyname($host)) != $host ? $ip : FALSE);
or something like that. I'd also recommend renaming getHost and getAddr
to getRemoteHost/Addr. If it is to stay separate from HTTP, how about
HTTP_RemoteHost or something?
eric
On Fri, 30 May 2003, cagrET wrote:
> > 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).
>
> first positive opinion, thx ;-)
>
> This is only an idea, Ive found this class usefull for me, it could be
> extended, if someone miss something in it :]
>
> cheers,
> --
> cagrET
>
>
>