XML_Parser:setInput() (was: more on XML_Serialize/Unserialize)
| From: | Stephan Schmidt | Date: | Thu, 28 Aug 2003 09:17:06 +0000 |
| Subject: | XML_Parser:setInput() (was: more on XML_Serialize/Unserialize) | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-20723@lists.php.net to get a copy of this message | ||
Hi,
> eregi('^[a-z]+://', substr($fp, 0, 10))
>
> Does that look better? It wouldn't match any valid XML string, even if
> there was a comment at the top or something.
Of course this is better, but I still see some problems here. With your
patch it's possible to supply a URL with any scheme to setInput() although
setInputFile() should be used for this task. So users could get lazy (they
tend to do this sometimes) and always use the setInput() method. If the
location of the file changes from remote to local, they may forget to use
setInputFile() instead.
I can't see an advantage in being able to pass a URL to a method where a
string should be passed, if there already is a setInputFile() method. But
anyway, it's not my task to decide, as I'm not the maintainer of the
package....
Stephan