I am trying to call a php file when adding torrent with the help of this code, in plugin init.php file ( its not the whole code but it works )
Code:
$theSettings->getOnInsertCommand(array('testing'.getUser(),getCmd('execute').'={'.getPHP().',/var/www/rutorrent/plugins/ratio/test.php,$'.getCmd("d.get_hash").'=,'.getUser().'}')),
then it calls the test.php file like this ( expert from rtorrent log )
Code:
php /var/www/rutorrent/plugins/ratio/test.php 43DBFC51ADCC175F3DE6B4BFACB50CBC2923B6AB
Test.php file
Code:
//~ include( dirname(__FILE__)."/../../php/xmlrpc.php" );
//~ include( dirname(__FILE__)."/../../php/settings.php");
//~ include( '/var/www/rutorrent/plugins/ratio/ratio.php');
include( "../../php/xmlrpc.php" );
include( "../../php/Torrent.php" );
include( "../../php/rtorrent.php" );
i am confused which file i should include cuz nothing is working
Code:
$hash = $argv[1];
$file_wrote = "/var/www/rutorrent/plugins/ratio/testing.txt";
$file_tell = fopen($file_wrote,'a');
fwrite($file_tell, $hash."\n");
fclose($file_tell);
$req = new rXMLRPCRequest( array (
new rXMLRPCCommand( "d.get_base_path", $hash ),
new rXMLRPCCommand( "d.get_custom1", $hash),
new rXMLRPCCommand( "d.get_name", $hash ),
));
if($req->run() && !$req->fault )
{
$basename = $req->val[0];
$label = rawurldecode($req->val[1]);
$torrentname = $req->val[2];
$data = "$basename :: $label :: $torrentname :: $hash";
$file_wrote = "/var/www/rutorrent/plugins/ratio/testing.txt";
$file_tell = fopen($file_wrote,'a');
fwrite($file_tell, $data."\n");
fclose($file_tell);
}
i m getting nothing with xmlrpc command in test.php file, it should get torrentname, label and basename but its getting nothing, i tried alot of other methods by calling from here and there but all get me nothing
anybody knows ? how's this possible
Code:
$theSettings->getOnInsertCommand(array('testing'.getUser(),getCmd('execute').'={'.getPHP().',/var/www/rutorrent/plugins/ratio/test.php,$'.getCmd("d.get_hash").'=,'.getUser().'}')),
then it calls the test.php file like this ( expert from rtorrent log )
Code:
php /var/www/rutorrent/plugins/ratio/test.php 43DBFC51ADCC175F3DE6B4BFACB50CBC2923B6AB
Test.php file
Code:
//~ include( dirname(__FILE__)."/../../php/xmlrpc.php" );
//~ include( dirname(__FILE__)."/../../php/settings.php");
//~ include( '/var/www/rutorrent/plugins/ratio/ratio.php');
include( "../../php/xmlrpc.php" );
include( "../../php/Torrent.php" );
include( "../../php/rtorrent.php" );
i am confused which file i should include cuz nothing is working
Code:
$hash = $argv[1];
$file_wrote = "/var/www/rutorrent/plugins/ratio/testing.txt";
$file_tell = fopen($file_wrote,'a');
fwrite($file_tell, $hash."\n");
fclose($file_tell);
$req = new rXMLRPCRequest( array (
new rXMLRPCCommand( "d.get_base_path", $hash ),
new rXMLRPCCommand( "d.get_custom1", $hash),
new rXMLRPCCommand( "d.get_name", $hash ),
));
if($req->run() && !$req->fault )
{
$basename = $req->val[0];
$label = rawurldecode($req->val[1]);
$torrentname = $req->val[2];
$data = "$basename :: $label :: $torrentname :: $hash";
$file_wrote = "/var/www/rutorrent/plugins/ratio/testing.txt";
$file_tell = fopen($file_wrote,'a');
fwrite($file_tell, $data."\n");
fclose($file_tell);
}
i m getting nothing with xmlrpc command in test.php file, it should get torrentname, label and basename but its getting nothing, i tried alot of other methods by calling from here and there but all get me nothing
anybody knows ? how's this possible