by parkint » Thu Jan 13, 2005 12:05 pm
Absolutely, it is this easy from within a PHP script:
Code: Select all
//Connect to MM
$objSDB = new COM ("SongsDB.SDBApplication") or die ("Cannot create MediaMonkey SDB Object");
Obviously you have to have PHP installed on a windows box to get that working. You can either run that using the php cli executable, or via a webserver if that is your preference. Once you have the COM object created it is pretty much the same as accessing via vbscript, except obviously using PHP object calling syntax:
Code: Select all
//Get Album List
$strSQL = "SELECT * FROM Albums";
$objIter = $objSDB->Database->OpenSQL($strSQL);
It theoretically should also be possible to use the Activescript SAPI that comes with PHP on windows to get PHP to within the MM scriptlet control. I couldn't get it to work though, and there are questions about security if you register that DLL on your system. (i.e. it would be possible for a malicious website to host PHP code that would be run client side with no sandbox!)
Absolutely, it is this easy from within a PHP script:
[code]//Connect to MM
$objSDB = new COM ("SongsDB.SDBApplication") or die ("Cannot create MediaMonkey SDB Object");[/code]
Obviously you have to have PHP installed on a windows box to get that working. You can either run that using the php cli executable, or via a webserver if that is your preference. Once you have the COM object created it is pretty much the same as accessing via vbscript, except obviously using PHP object calling syntax:
[code]
//Get Album List
$strSQL = "SELECT * FROM Albums";
$objIter = $objSDB->Database->OpenSQL($strSQL);[/code]
It theoretically should also be possible to use the Activescript SAPI that comes with PHP on windows to get PHP to within the MM scriptlet control. I couldn't get it to work though, and there are questions about security if you register that DLL on your system. (i.e. it would be possible for a malicious website to host PHP code that would be run client side with no sandbox!)