Comment 0 for bug 831656

Revision history for this message
Hugh Guiney (hugh-guiney) wrote :

This applies to both the 2.x branch and the 1.x branch. Using 2.x for the examples.

My code:

try{
 $mbQuery = new mbQuery();
 $trackFilters = new mbTrackFilter();
 $trackFilters->title('…Baby One More Time');
 $trackFilters->artistName('Britney Spears');
 $trackFilters->limit('5');
 var_dump($mbQuery->getTracks($trackFilters));
} catch(mbRequestError $e) {
 echo $e->getMessage();
} catch(mbResponseError $e) {
 echo $e->getMessage();
} catch(Exception $e) {
 echo $e->getMessage();
}

Log:

PHP Warning: require_once(mbUser.php): failed to open stream: No such file or directory
PHP Fatal error: require_once(): Failed opening required 'mbUser.php'

Copied mbUser.php from the 1.x branch to 2.x and it went away, but then got:

PHP Notice: Undefined index: HTTP_status in /path/to/mbWebService.php on line 154
PHP Warning: xml_error_string() expects parameter 1 to be long, resource given in /path/to/xml/xmlParser.php on line 106

Second error was fixed by changing:

$this->_last_error = xml_get_current_line_number($this->_parser) . ": ". xml_error_string($this->_parser);

to:

$this->_last_error = xml_get_current_line_number($this->_parser) . ": ". xml_error_string(xml_get_error_code($this->_parser));

But the first one still remains. Additionally, the outputted XML error is:

1: Not well-formed (invalid token)

Can this please be fixed? I can't find any other MusicBrainz 2 PHP libraries.