I’m having trouble with Soundcloud.php on my server. Although it runs just fine on my MAMP installation. Basically my test page won’t load and an error is logged declaring a problem in Soundcloud.php:
[03-Apr-2012 03:50:57] PHP Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /home2/mysite/public_html/mysubdomain/Soundcloud.php on line 685
the test code is fine – here it is for reference:
<?php
require 'Soundcloud.php';
$soundcloud = new Services_Soundcloud('Client_ID','Client_Secret', 'Redirect_URI');
try {
$info = json_decode($soundcloud->get('tracks', array('user_id' => 'blumarten')), true);
print_r($info);
}
catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {
exit($e->getMessage());
}
I just had the account upgraded to PHP 5.3 but the error still occurs, any ideas?
SoundCloud PHP API and documentation are very poor and buggy at the moment , hopefully will get better.
Replace this code around line 720
With this:
And add this function to the top of the file, before the class opening: