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
This applies to both the 2.x branch and the 1.x branch. Using 2.x for the examples.
My code:
try{ >title( '…Baby One More Time'); >artistName( 'Britney Spears'); >limit( '5'); $mbQuery- >getTracks( $trackFilters) ); Error $e) { eError $e) {
$mbQuery = new mbQuery();
$trackFilters = new mbTrackFilter();
$trackFilters-
$trackFilters-
$trackFilters-
var_dump(
} catch(mbRequest
echo $e->getMessage();
} catch(mbRespons
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 xml/xmlParser. php on line 106
PHP Warning: xml_error_string() expects parameter 1 to be long, resource given in /path/to/
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.