RE: [PEAR-DEV] New classes
| From: | Richard Heyes | Date: | Sat, 02 Feb 2002 16:22:49 +0000 |
| Subject: | RE: [PEAR-DEV] New classes | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-4353@lists.php.net to get a copy of this message | ||
> > HTTP_URL (http://phpguru.org/pear/HTTP_URL.phps)
> >
> > This class is intended to handle urls. Give it a url in the
> constructor and
> > it will split it up into it's constituent parts for easy access. Stig
> > mentioned on irc that it might be better named as URL, and also advised
> > looking up this java class which looks interesting:
> >
>
> http://hpdrc.cs.fiu.edu/sdbtools/VisualCafe/Documentation/Java/jav
> a.net.URL.
> > html
>
> How is this different from the built-in parse_url() function?
I still think this code could be useful. Obviously I'd change the parsing
routine to use parse_url(), but parse_url doesn't give any defaults. This
for example:
parse_url('#top')
gives this result:
Array
(
[path] =>
[fragment] => top
)
No server, protocol, port, path or file defaults. This extra functionality
could be provided by this class, along with the ability to generate a full
url given constituent parts, like the function in it already (getUrl()), or
the function in the manual notes for parse_url().
--
Richard Heyes
"If you have any trouble sounding condescending,
find a Unix user to show you how it's done." - Scott Adams