XML_Parser::setInput()

From: Date: Tue, 13 Apr 2004 08:52:40 +0000
Subject: XML_Parser::setInput()
Groups: php.pear.qa 
Request: Send a blank email to pear-qa+get-1112@lists.php.net to get a copy of this message
Hi, I started working on XML_Parser and found something strange. The current CVS version has been changed and setInput() now also accepts files. To determine whether the parameter that has been parsed should be treated as file or string the following code is used:
        // see if it's an absolute URL (has a scheme at the beginning)
        elseif (eregi('^[a-z]+://', substr($fp, 0, 10))) {
            return $this->setInputFile($fp);
        }
        // see if it's a local file
        elseif (file_exists($fp)) {
            return $this->setInputFile($fp);
        }
        // it must be a string
        else {
            $this->fp = $fp;
            return true;
        }
To me, that's PHP guessing what I want to do. And all it does, is slowing down the process... There already are methods to set an input file and input string: XML_Parser::setInputFile() XML_Parser::setInputString() So I think this should be reverted to behave like XML_Parser 1.0.1 What do you guys think? Stephan

« previous php.pear.qa (#1112) next »