uw Thu Mar 15 09:34:07 2001 EDT
Modified files:
/php4/pear/XML Parser.php
Log:
If the creation of the parser fails, the constructor "throws" an error by returning
a XML_Parser_Error object. That means the user will get an object of the type
XML_Parser_Error and the methods parse() and parseString() can't get called.
Index: php4/pear/XML/Parser.php
diff -u php4/pear/XML/Parser.php:1.6 php4/pear/XML/Parser.php:1.7
--- php4/pear/XML/Parser.php:1.6 Thu Mar 15 09:30:01 2001
+++ php4/pear/XML/Parser.php Thu Mar 15 09:34:06 2001
@@ -222,10 +222,6 @@
return new XML_Parser_Error("no input");
}
- if (!is_resource($this->parser)) {
- return new XML_Parser_Error("no parser");
- }
-
while ($data = fread($this->fp, 2048)) {
$err = $this->parseString($data, feof($this->fp));
if (PEAR::isError($err)) {
@@ -234,7 +230,6 @@
}
return true;
-
}
// }}}
@@ -250,10 +245,6 @@
*/
function parseString($data, $eof = false) {
- if (!is_resource($this->parser)) {
- return new XML_Parser_Error("no parser");
- }
-
if (!xml_parse($this->parser, $data, $eof)) {
$err = new XML_Parser_Error($this->parser);
xml_parser_free($this->parser);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]