func_xml.php is include_once into db.php then db.php is require_once all over the site. (this is not my code just a system I am working with).
I have gone through the whole site and ensured that there is no way this can be redefined anywhere but I am getting this error message:
Fatal error: Cannot redeclare class xmlreader in /httpdocs/_includes/functions/func_xml.php on line 19
Which should be a simple included too many times. Which is technically impossible due to the require_once/include_once.
To work around this I encased it in if (!class_exists('XMLReader')){}
Fatal error: Call to undefined method XMLReader::readParameters() in /httpdocs/_includes/functions/func_forms.php on line 149
if (!class_exists('XMLReader'))
{
class XMLReader {
var $XMLdata;
var $arrParameters = array();
var $xml_parser;
function XMLReader($XML) {
$this->XMLdata = $XML;
}
function readParameters() {
$this->xml_parser = xml_parser_create();
xml_parse_into_struct($this->xml_parser, $this->XMLdata, $vals, $index);
xml_parser_free($this->xml_parser);
$arrParameters = array();
for ($x=1; $x<sizeof($vals); $x++) {
if ((!empty($vals[$x]))&&($vals[$x]['tag']!="XML")) {
//if (isset($vals[$x]['value'])) {
$arrParameters[$vals[$x]['tag']] = $vals[$x]['value'];
//}
//echo $vals[$x]['tag'] . " - " . $vals[$x]['value'] . "<br>";
}
}
return $arrParameters; // tag, value
}
}
}
I have tried die('this works'); within the construct which isn't triggered.
Quite frankly I'm lost now anyone know of anything else that could be a factor? This site seems to be written for PHP4.