<?php
$params = &JComponentHelper::getParams( 'com_spstgsrv' );
$hash = $params->get('hash');
$password = $params->get('password');

/*
// Install
$data = array (
    'package_name' => $this->encrypt('plg_spthumbnail_v1.0.1.zip',$password,$hash),
    'package_path' => $this->encrypt('http://localhost/spstgmng/tmp/',$password,$hash),
    'created_by' => $this->encrypt('66',$password,$hash)
    );
$request_method = 'installer.install';
 * 
 */
// Read
$data = array (    
    'search' => $this->encrypt('',$password,$hash),
    'enabled' => $this->encrypt('',$password,$hash),
    'type' => $this->encrypt('',$password,$hash),
    'client' => $this->encrypt('',$password,$hash),
    'group' => $this->encrypt('',$password,$hash),
    'hideprotected' => $this->encrypt('',$password,$hash),
    'sp_limit' => $this->encrypt(20,$password,$hash),
    'start' => $this->encrypt(0,$password,$hash)
    );
$request_method = 'installer.read';

// create curl resource 
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, JURI::base() . "index.php?option=com_spstgsrv&task=$request_method&format=xmlrpc");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$output = curl_exec($ch);
curl_close($ch);
//echo $output;
CYENDFactory::print_r(json_decode($output));
?>
